[ 
https://issues.apache.org/jira/browse/ARROW-16603?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17541941#comment-17541941
 ] 

Joris Van den Bossche commented on ARROW-16603:
-----------------------------------------------

The BlockParser docstring indicates that 
(https://github.com/apache/arrow/blob/985c25703c28e60a51dee09515bb8dd2a89c00e2/cpp/src/arrow/json/parser.h#L61):

{code}
/// Note that in addition to parse errors (such as malformed JSON) some 
conversion
/// errors are caught at parse time:
/// - A null value in non-nullable column
{code}

Although I don't directly see where that would be handled in parser.cc (cc 
[~bkietz] ?)

> [Python] pyarrow.json.read_json ignores nullable=False in explicit_schema 
> parse_options
> ---------------------------------------------------------------------------------------
>
>                 Key: ARROW-16603
>                 URL: https://issues.apache.org/jira/browse/ARROW-16603
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Python
>            Reporter: Alenka Frim
>            Priority: Major
>
> Reproducible example:
> {code:python}
> import json
> import pyarrow.json as pj
> import pyarrow as pa
> s = {"id": "value", "nested": {"value": 1}}
> with open("issue.json", "w") as write_file:
>     json.dump(s, write_file, indent=4)
> schema = pa.schema([
>     pa.field("id", pa.string(), nullable=False),
>     pa.field("nested", pa.struct([pa.field("value", pa.int64(), 
> nullable=False)]))
> ])
> table = pj.read_json('issue.json', 
> parse_options=pj.ParseOptions(explicit_schema=schema))
> print(schema)
> print(table.schema)
> {code}



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to