kumarUjjawal commented on code in PR #21603:
URL: https://github.com/apache/datafusion/pull/21603#discussion_r3078180643
##########
datafusion/common/src/config.rs:
##########
@@ -3024,8 +3024,18 @@ impl From<ConfigFileDecryptionProperties> for
FileDecryptionProperties {
}
#[cfg(feature = "parquet_encryption")]
-impl From<&Arc<FileDecryptionProperties>> for ConfigFileDecryptionProperties {
- fn from(f: &Arc<FileDecryptionProperties>) -> Self {
+impl TryFrom<&Arc<FileDecryptionProperties>> for
ConfigFileDecryptionProperties {
+ type Error = DataFusionError;
+
+ fn try_from(f: &Arc<FileDecryptionProperties>) -> Result<Self> {
+ let footer_key = f.footer_key(None).map_err(|e| {
Review Comment:
This still depends on `footer_key(None)` failing. A key retriever can
return a footer key even when it still cannot represent the full decryption
config. In that case thisconversion can still succeed, but `column_keys()` is
empty and we silently lose the column decryption info. Can we reject all
key-retriever-based `FileDecryptionProperties` directly and add a test for that
case?
##########
datafusion/common/src/config.rs:
##########
@@ -3024,8 +3024,18 @@ impl From<ConfigFileDecryptionProperties> for
FileDecryptionProperties {
}
#[cfg(feature = "parquet_encryption")]
-impl From<&Arc<FileDecryptionProperties>> for ConfigFileDecryptionProperties {
- fn from(f: &Arc<FileDecryptionProperties>) -> Self {
+impl TryFrom<&Arc<FileDecryptionProperties>> for
ConfigFileDecryptionProperties {
Review Comment:
This changes a public API from `From` to `TryFrom`, so downstream code
using `(&decrypt).into()` or `ConfigFileDecryptionProperties::from(&decrypt)`
will stop compiling. Can we add an upgrade note for this 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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]