You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by gi...@apache.org on 2026/10/01 03:53:03 UTC
(datafusion) branch main updated: chore: gate Parquet opener encryption on `parquet_encryption` (#25907)
This is an automated email from the ASF dual-hosted git repository.
github-merge-queue[bot] pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git
The following commit(s) were added to refs/heads/main by this push:
new 14a5d1376d chore: gate Parquet opener encryption on `parquet_encryption` (#25907)
14a5d1376d is described below
commit 14a5d1376de4b916c05cc69b64c933783b30a7b1
Author: Neil Conway <ne...@gmail.com>
AuthorDate: Thu Oct 1 03:43:16 2026 +0000
chore: gate Parquet opener encryption on `parquet_encryption` (#25907)
## Which issue does this PR close?
- N/A
## Rationale for this change
Without the `parquet_encryption` feature, clippy fails on a dead stub in
`opener/encryption.rs` (`clippy::unused_async_trait_impl`). For example:
cargo clippy -p datafusion-datasource-parquet --all-targets -- -D
warnings
Every use of the module is already gated on the feature, so gate the
module itself and remove the stubs. CI doesn't catch this because its
`--workspace` build enables the feature.
## What changes are included in this PR?
See above.
## What is the testing strategy for this PR?
Tests pass, `clippy` command above now passes without warnings.
## Are there any user-facing changes?
No.
---
.../datasource-parquet/src/opener/encryption.rs | 34 ++--------------------
datafusion/datasource-parquet/src/opener/mod.rs | 1 +
2 files changed, 4 insertions(+), 31 deletions(-)
diff --git a/datafusion/datasource-parquet/src/opener/encryption.rs b/datafusion/datasource-parquet/src/opener/encryption.rs
index 498fe8acf7..232c356b9b 100644
--- a/datafusion/datasource-parquet/src/opener/encryption.rs
+++ b/datafusion/datasource-parquet/src/opener/encryption.rs
@@ -17,31 +17,24 @@
//! Encryption context used during Parquet file open.
//!
-//! Isolated here so the `#[cfg(feature = "parquet_encryption")]` gating does
-//! not pollute the rest of the opener module.
+//! This module is only compiled with the `parquet_encryption` feature. It is
+//! isolated here so the feature gating does not pollute the rest of the
+//! opener module.
-#[cfg(feature = "parquet_encryption")]
use std::sync::Arc;
use datafusion_common::Result;
-#[cfg(feature = "parquet_encryption")]
use datafusion_common::config::EncryptionFactoryOptions;
-#[cfg(feature = "parquet_encryption")]
use datafusion_common::encryption::FileDecryptionProperties;
-#[cfg(feature = "parquet_encryption")]
use datafusion_execution::parquet_encryption::EncryptionFactory;
use super::ParquetMorselizer;
-#[derive(Default)]
pub(super) struct EncryptionContext {
- #[cfg(feature = "parquet_encryption")]
file_decryption_properties: Option<Arc<FileDecryptionProperties>>,
- #[cfg(feature = "parquet_encryption")]
encryption_factory: Option<(Arc<dyn EncryptionFactory>, EncryptionFactoryOptions)>,
}
-#[cfg(feature = "parquet_encryption")]
impl EncryptionContext {
fn new(
file_decryption_properties: Option<Arc<FileDecryptionProperties>>,
@@ -74,32 +67,11 @@ impl EncryptionContext {
}
}
-#[cfg(not(feature = "parquet_encryption"))]
-#[expect(dead_code)]
-#[expect(clippy::unused_async)]
-impl EncryptionContext {
- pub(super) async fn get_file_decryption_properties(
- &self,
- _file_location: &object_store::path::Path,
- ) -> Result<
- Option<std::sync::Arc<datafusion_common::encryption::FileDecryptionProperties>>,
- > {
- Ok(None)
- }
-}
-
impl ParquetMorselizer {
- #[cfg(feature = "parquet_encryption")]
pub(super) fn get_encryption_context(&self) -> EncryptionContext {
EncryptionContext::new(
self.file_decryption_properties.clone(),
self.encryption_factory.clone(),
)
}
-
- #[cfg(not(feature = "parquet_encryption"))]
- #[expect(dead_code)]
- pub(super) fn get_encryption_context(&self) -> EncryptionContext {
- EncryptionContext::default()
- }
}
diff --git a/datafusion/datasource-parquet/src/opener/mod.rs b/datafusion/datasource-parquet/src/opener/mod.rs
index eb329fb303..6b2e47e134 100644
--- a/datafusion/datasource-parquet/src/opener/mod.rs
+++ b/datafusion/datasource-parquet/src/opener/mod.rs
@@ -18,6 +18,7 @@
//! [`ParquetMorselizer`] state machines for opening Parquet files
mod early_stop;
+#[cfg(feature = "parquet_encryption")]
mod encryption;
use self::early_stop::EarlyStoppingStream;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org