ump45nose opened a new pull request, #12098:
URL: https://github.com/apache/arrow-rs/pull/12098

   > CI enabled in fork Actions.
   
   # Which issue does this PR close?
   
   - Closes #11946
   
   # Rationale for this change
   
   `cast_to_variant` took an all-null / empty-array shortcut before checking 
whether the source type is supported. Empty and all-null duration or interval 
arrays (including when nested in lists or structs) therefore succeeded, while 
the same types with non-null values returned `InvalidArgumentError`. Type 
acceptance should not depend on batch length or null contents.
   
   # What changes are included in this PR?
   
   `cast_to_variant_with_options` now builds the row builder (which rejects 
duration/interval, including nested) before the all-null shortcut. Supported 
empty and all-null arrays still take the fast path after validation.
   
   # Are these changes tested?
   
   Extended `test_cast_to_variant_duration_or_interval_errors` to cover empty 
and all-null arrays for every duration/interval unit, nested list and struct 
forms, and supported-type controls (`Int64`, `Null`).
   
   # Are there any significant user-facing changes?
   
   Yes: empty and all-null arrays of unsupported duration/interval types (and 
nested containers of those types) now error instead of returning an all-null 
`VariantArray`. Populated arrays of those types already failed.
   
   # AI assistance
   
   This change was prepared with AI assistance. I reviewed the diff, ran the 
`parquet-variant-compute` cast_to_variant unit tests plus clippy for that 
crate, and own the change.
   


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to