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/07 15:56:33 UTC

[GitHub] [arrow] kszucs opened a new pull request #7661: ARROW-9020: [Python] read_json won't respect explicit_schema in parse_options

kszucs opened a new pull request #7661:
URL: https://github.com/apache/arrow/pull/7661


   


----------------------------------------------------------------
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



[GitHub] [arrow] kszucs commented on a change in pull request #7661: ARROW-9020: [Python] read_json won't respect explicit_schema in parse_options

Posted by GitBox <gi...@apache.org>.
kszucs commented on a change in pull request #7661:
URL: https://github.com/apache/arrow/pull/7661#discussion_r451586029



##########
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:
       Updated.




----------------------------------------------------------------
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



[GitHub] [arrow] github-actions[bot] commented on pull request #7661: ARROW-9020: [Python] read_json won't respect explicit_schema in parse_options

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #7661:
URL: https://github.com/apache/arrow/pull/7661#issuecomment-654969459


   https://issues.apache.org/jira/browse/ARROW-9020


----------------------------------------------------------------
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



[GitHub] [arrow] jorisvandenbossche commented on a change in pull request #7661: ARROW-9020: [Python] read_json won't respect explicit_schema in parse_options

Posted by GitBox <gi...@apache.org>.
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



[GitHub] [arrow] kszucs commented on a change in pull request #7661: ARROW-9020: [Python] read_json won't respect explicit_schema in parse_options

Posted by GitBox <gi...@apache.org>.
kszucs commented on a change in pull request #7661:
URL: https://github.com/apache/arrow/pull/7661#discussion_r451585808



##########
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:
       Updated.

##########
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:
       Updated.




----------------------------------------------------------------
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



[GitHub] [arrow] jorisvandenbossche closed pull request #7661: ARROW-9020: [Python] read_json won't respect explicit_schema in parse_options

Posted by GitBox <gi...@apache.org>.
jorisvandenbossche closed pull request #7661:
URL: https://github.com/apache/arrow/pull/7661


   


----------------------------------------------------------------
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