Skip to content

Commit 0b95577

Browse files
authored
Make it easier to register configuration extension ... (#9781)
... options closes #9529
1 parent ad89ff8 commit 0b95577

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

datafusion/execution/src/config.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ use std::{
2222
sync::Arc,
2323
};
2424

25-
use datafusion_common::{config::ConfigOptions, Result, ScalarValue};
25+
use datafusion_common::{
26+
config::{ConfigExtension, ConfigOptions},
27+
Result, ScalarValue,
28+
};
2629

2730
/// Configuration options for [`SessionContext`].
2831
///
@@ -198,6 +201,12 @@ impl SessionConfig {
198201
self
199202
}
200203

204+
/// Insert new [ConfigExtension]
205+
pub fn with_option_extension<T: ConfigExtension>(mut self, extension: T) -> Self {
206+
self.options_mut().extensions.insert(extension);
207+
self
208+
}
209+
201210
/// Get [`target_partitions`]
202211
///
203212
/// [`target_partitions`]: datafusion_common::config::ExecutionOptions::target_partitions

0 commit comments

Comments
 (0)