raghav-reglobe opened a new pull request, #10598:
URL: https://github.com/apache/arrow-rs/pull/10598
# Which issue does this PR close?
- Closes #10597.
# Rationale for this change
`typed_value_to_variant`'s fallback arm for unimplemented `typed_value`
types was `debug_assert!(false)` + `Ok(Variant::Null)`. Release builds compile
out the assert, so reading a row whose `typed_value` is valid but of an
unimplemented type (e.g. an object-shredded `Struct`) silently misreported the
stored value as `Variant::Null` — data that exists reads as null with no
signal, while the same read panics in debug builds.
# What changes are included in this PR?
- The fallback arm returns `ArrowError::NotYetImplemented` instead —
consistent across debug/release, and within `try_value`'s documented error
contract ("Errors if the data in `typed_value` cannot be interpreted as a valid
`Variant`").
- A regression test pinning that an object-shredded `typed_value` errors
rather than returning `Variant::Null`.
Implementing the remaining conversions (objects/lists) is left for a
follow-up — the borrowed `Variant<'_, '_>` return can't express an assembled
object without owned bytes, so that is a larger change.
# Are there any user-facing changes?
`VariantArray::try_value` now returns an error (and `value` panics in
release as it already did in debug) for unimplemented `typed_value` types,
instead of silently returning `Variant::Null` in release builds.
--
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]