Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for this change
Fixes #43115.
ChunkedStructArrayBuilderreconstructed output fields from only their names and converted child types. That reset every explicit field's nullability to the default (nullable=true), including fields nested inside structs. The resulting Arrow table no longer matched the schema supplied throughParseOptions::explicit_schema, which can fail downstream validation when the table is written.What changes are included in this PR?
ChunkedStructArrayBuilderinstead of discarding it.Are these changes tested?
Yes, against an editable Arrow C++ 27.0.0/SNAPSHOT and PyArrow build in WSL.
2 passed.python -m pytest pyarrow/tests/test_json.py -q:84 passed, 2 skipped.clang-format==18.1.8 --dry-run --Werror,flake8withpython/setup.cfg, andautopep8 --diffpassed on the modified files.Are there any user-facing changes?
Yes. JSON tables created with an explicit schema now retain the declared nullability of top-level and nested struct fields instead of silently replacing it with
nullable=true. Data and types are otherwise unchanged.Was AI used for this PR?
In accordance to the AI generation guidelines, AI was used for implementation, tests, and description. The behavior was reproduced against the unmodified base, reviewed, and validated against a local Arrow build before submission.
PR code and description written by:
Reviewed before submission by: