Repository navigation
Conversation
…time units ArrowSchemaConverter (and so ArrowWriter::try_new) now returns NYI for Union fields and an error for invalid Time32/Time64 units, instead of panicking.
etseidl
approved these changes
Dec 4, 2026
etseidl
left a comment
Contributor
There was a problem hiding this comment.
This looks reasonable to me, thanks.
| )) | ||
| } | ||
| } | ||
| DataType::Union(_, _) => unimplemented!("See ARROW-8817."), |
Contributor
There was a problem hiding this comment.
This seems to have migrated to #73 and is still open. we should at least note it in a comment here
This branch has not been deployed
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.
Which issue does this PR close?
ArrowWriter::try_newpanics on a schema with a Union field instead of returning an error #12510.Rationale for this change
ArrowWriter::try_newandArrowSchemaConverter::convertpanic on a schema with aUnionfield (top-level or nested), and on the invalid unitsTime32(Microsecond | Nanosecond)andTime64(Second | Millisecond). Thetry_newdocs say unsupported types such as unions make it fail, so they should return an error.What changes are included in this PR?
In
arrow_to_parquet_type:UnionreturnsParquetError::NYI("Datatype ... is not yet supported"), the same error the writer already returns for a union reached through an explicit Parquet schema.Time32/Time64units return anArrowErrorinstead of hittingunreachable!.Are these changes tested?
Yes.
test_union_field_returns_errorcovers a union at the top level and inside a struct, list and dictionary, through bothArrowSchemaConverterandArrowWriter::try_new.test_invalid_time_unit_returns_errorcovers the four invalid units. Both tests panic without the fix.Are there any significant user-facing changes?
No. Calls that used to panic now return an error.
AI usage disclosure
I used Claude Code to draft the fix and the tests. I reviewed the change, checked that the tests fail without the fix, and ran the parquet checks locally.