Skip to content

Commit ada7ab7

Browse files
committed
Require datafusion for the kms_encryption module.
Signed-off-by: Corwin Joy <[email protected]>
1 parent fd9e6dd commit ada7ab7

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

crates/core/src/test_utils/kms_encryption.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use crate::operations::encryption::TableEncryption;
12
use crate::table::file_format_options::{
23
FileFormatOptions, TableOptions, WriterPropertiesFactory, WriterPropertiesFactoryRef,
34
};
@@ -13,18 +14,13 @@ use std::fmt::{Debug, Formatter};
1314
use std::sync::Arc;
1415
use uuid::Uuid;
1516

16-
#[cfg(feature = "datafusion")]
17-
use crate::operations::encryption::TableEncryption;
18-
1917
// More advanced factory with KMS support
20-
#[cfg(feature = "datafusion")]
2118
#[derive(Clone, Debug)]
2219
pub struct KMSWriterPropertiesFactory {
2320
writer_properties: WriterProperties,
2421
encryption: Option<crate::operations::encryption::TableEncryption>,
2522
}
2623

27-
#[cfg(feature = "datafusion")]
2824
impl KMSWriterPropertiesFactory {
2925
pub fn with_encryption(table_encryption: TableEncryption) -> Self {
3026
let writer_properties = WriterProperties::builder()
@@ -38,7 +34,6 @@ impl KMSWriterPropertiesFactory {
3834
}
3935
}
4036

41-
#[cfg(feature = "datafusion")]
4237
#[async_trait]
4338
impl WriterPropertiesFactory for KMSWriterPropertiesFactory {
4439
fn compression(&self, column_path: &ColumnPath) -> Compression {
@@ -63,14 +58,12 @@ impl WriterPropertiesFactory for KMSWriterPropertiesFactory {
6358
// -------------------------------------------------------------------------------------------------
6459
// FileFormatOptions for KMS encryption based on settings in TableEncryption
6560
// -------------------------------------------------------------------------------------------------
66-
#[cfg(feature = "datafusion")]
6761
pub struct KmsFileFormatOptions {
6862
table_encryption: TableEncryption,
6963
writer_properties_factory: WriterPropertiesFactoryRef,
7064
encryption_factory_id: String,
7165
}
7266

73-
#[cfg(feature = "datafusion")]
7467
impl KmsFileFormatOptions {
7568
pub fn new(table_encryption: TableEncryption) -> Self {
7669
let encryption_factory_id = format!("delta-{}", Uuid::new_v4());
@@ -85,15 +78,13 @@ impl KmsFileFormatOptions {
8578
}
8679
}
8780

88-
#[cfg(feature = "datafusion")]
8981
impl Debug for KmsFileFormatOptions {
9082
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
9183
f.debug_struct("KmsFileFormatOptions")
9284
.finish_non_exhaustive()
9385
}
9486
}
9587

96-
#[cfg(feature = "datafusion")]
9788
impl FileFormatOptions for KmsFileFormatOptions {
9889
fn table_options(&self) -> TableOptions {
9990
let mut table_options = TableOptions::default();

crates/core/src/test_utils/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
mod factories;
2+
#[cfg(feature = "datafusion")]
23
pub mod kms_encryption;
34

45
use std::{collections::HashMap, path::PathBuf, process::Command};

0 commit comments

Comments
 (0)