Skip to content

Commit

Permalink
Make it easier to register configuration extension ... (#9781)
Browse files Browse the repository at this point in the history
... options

closes #9529
  • Loading branch information
milenkovicm authored Mar 25, 2024
1 parent ad89ff8 commit 0b95577
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion datafusion/execution/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ use std::{
sync::Arc,
};

use datafusion_common::{config::ConfigOptions, Result, ScalarValue};
use datafusion_common::{
config::{ConfigExtension, ConfigOptions},
Result, ScalarValue,
};

/// Configuration options for [`SessionContext`].
///
Expand Down Expand Up @@ -198,6 +201,12 @@ impl SessionConfig {
self
}

/// Insert new [ConfigExtension]
pub fn with_option_extension<T: ConfigExtension>(mut self, extension: T) -> Self {
self.options_mut().extensions.insert(extension);
self
}

/// Get [`target_partitions`]
///
/// [`target_partitions`]: datafusion_common::config::ExecutionOptions::target_partitions
Expand Down

0 comments on commit 0b95577

Please sign in to comment.