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 2020/07/08 07:54:34 UTC
[GitHub] [arrow] jorisvandenbossche commented on a change in pull request #7661: ARROW-9020: [Python] read_json won't respect explicit_schema in parse_options
jorisvandenbossche commented on a change in pull request #7661:
URL: https://github.com/apache/arrow/pull/7661#discussion_r451349616
##########
File path: python/pyarrow/_json.pyx
##########
@@ -91,19 +92,29 @@ cdef class ParseOptions:
newlines_in_values: bool, optional (default False)
Whether objects may be printed across multiple lines (for example
pretty printed). If false, input must end with an empty line.
+ unexpected_field_behavior: str, default "infer"
+ How JSON fields outside of explicit_schema (if given) are treated.
+ Possible behaviors:
+ - "ignore": unexpected JSON fields are ignored
+ - "error": error out on unexpected JSON fields
+ - "infer": unexpected JSON fields are type-inferred and included in
+ the output
Review comment:
```suggestion
- "infer": unexpected JSON fields are type-inferred and included in
the output
```
##########
File path: python/pyarrow/_json.pyx
##########
@@ -91,19 +92,29 @@ cdef class ParseOptions:
newlines_in_values: bool, optional (default False)
Whether objects may be printed across multiple lines (for example
pretty printed). If false, input must end with an empty line.
+ unexpected_field_behavior: str, default "infer"
+ How JSON fields outside of explicit_schema (if given) are treated.
+ Possible behaviors:
+ - "ignore": unexpected JSON fields are ignored
Review comment:
```suggestion
Possible behaviors:
- "ignore": unexpected JSON fields are ignored
```
(I *think* rst needs a blank line here)
##########
File path: python/pyarrow/_json.pyx
##########
@@ -132,6 +143,47 @@ cdef class ParseOptions:
def newlines_in_values(self, value):
self.options.newlines_in_values = value
+ @property
+ def unexpected_field_behavior(self):
+ """
+ How JSON fields outside of explicit_schema (if given) are treated.
+
+ Possible behaviors:
+ - "ignore": unexpected JSON fields are ignored
+ - "error": error out on unexpected JSON fields
+ - "infer": unexpected JSON fields are type-inferred and included in
+ the output
Review comment:
Same formatting comments here
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org