You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/05/18 06:54:53 UTC

[GitHub] [arrow] AlenkaF commented on issue #13177: [Python] Reading JSON with explicit schema is ignoring not null constraint

AlenkaF commented on issue #13177:
URL: https://github.com/apache/arrow/issues/13177#issuecomment-1129639709

   Hi @Kowol, thank you for reporting this issue!
   This should work and it doesn't - I created a JIRA issue [ARROW-16603](https://issues.apache.org/jira/browse/ARROW-16603) to correct this behaviour.
   
   A (not very nice) workaround could be to go through `pydict` and then back to `pa.Table` again:
   
   ```python
   In [16]: middle = table.to_pydict()
   
   In [17]: pa.Table.from_pydict(middle, schema=schema)
   Out[17]: 
   pyarrow.Table
   id: string not null
   nested: struct<value: int64 not null>
     child 0, value: int64 not null
   ----
   id: [["value"]]
   nested: [
     -- is_valid: all not null
     -- child 0 type: int64
   [1]]
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org