kumarUjjawal opened a new issue, #21974:
URL: https://github.com/apache/datafusion/issues/21974

   ### Is your feature request related to a problem or challenge?
   
   The conversions from `ConfigFileDecryptionProperties` to 
`FileDecryptionProperties` (and the matching encryption pair) currently use 
`From`, but the implementations contain several `unwrap()` and `expect()` 
calls. Bad input, for example a config value with an invalid hex string for the 
footer key, a column key, or the AAD prefix  will panic instead of returning an 
error.
   
   This was raised by @nuno-faria as a follow-up on  
https://github.com/apache/datafusion/pull/21603#discussion_r3172906435
   
   ### Describe the solution you'd like
   
   Replace the two From impls with TryFrom, returning 
DataFusionError::Configuration (or a similar variant) for:
   
     - Invalid hex in `footer_key_as_hex`, `column_key_as_hex`, 
`aad_prefix_as_hex`, `footer_key_metadata_as_hex`, or `column_metadata_as_hex`.
     - Errors from 
`FileDecryptionProperties::builder(...).with_column_keys(...)` and .build().
     - Errors from `FileEncryptionProperties::builder(...).build()`.
   
   Update in-tree callers to use `try_from / try_into` 
   
   ### Describe alternatives you've considered
   
   Returning a Result only from a new constructor while keeping From for 
backward compatibility. Adds API surface without removing the panic risk.
   
   ### Additional context
   
   Origin: 
https://github.com/apache/datafusion/pull/21603#discussion_r3172906435
   
   Related follow-ups already filed for the encryption conversion work: #21634, 
https://github.com/apache/arrow-rs/issues/9721


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to