sdf-jkl commented on code in PR #9563:
URL: https://github.com/apache/arrow-rs/pull/9563#discussion_r3016561344


##########
parquet-variant/src/variant.rs:
##########


Review Comment:
   > Hmm, what about:
   > 
   > > If there are user-facing changes then we may require documentation to be
   > > updated before approving the PR.
   > 
   > Do we have a docs gap to fill?
   
   It seems like there is no single place that has the casting logic defined. 
We could add it to the `Variant` doc
   
   
   
   ```suggestion
   ///
   /// # Casting Semantics
   ///
   /// Scalar conversion semantics intentionally follow Arrow cast behavior 
where applicable.
   /// Conversions in this module delegate to Arrow compute cast helpers such as
   /// [`num_cast`], [`cast_num_to_bool`], [`single_bool_to_numeric`], and
   /// [`cast_single_string_to_boolean_default`].
   ///
   /// - [`Self::as_boolean`] accepts boolean, numeric, and string variants.
   ///   Numeric zero maps to `false`; non-zero maps to `true`. String parsing 
follows
   ///   Arrow UTF8-to-boolean cast rules.
   /// - Numeric accessors such as [`Self::as_int8`], [`Self::as_int64`], 
[`Self::as_u8`],
   ///   [`Self::as_u64`], [`Self::as_f16`], [`Self::as_f32`], and 
[`Self::as_f64`] accept
   ///   boolean and numeric variants (integers, floating-point, and decimals 
with scale `0`).
   ///   They return `None` when conversion is not possible.
   /// - Decimal accessors such as [`Self::as_decimal4`], 
[`Self::as_decimal8`], and
   ///   [`Self::as_decimal16`] accept compatible decimal variants and integer 
variants.
   ///   They return `None` when conversion is not possible.
   ```



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