This is an automated email from the ASF dual-hosted git repository.
jakevin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git
The following commit(s) were added to refs/heads/main by this push:
new 8eaa292d8a Minor: Add `Extensions::new()` (#5676)
8eaa292d8a is described below
commit 8eaa292d8a1adf777ab7817ccfa4d749de0c7e1c
Author: Andrew Lamb <[email protected]>
AuthorDate: Wed Mar 22 05:22:12 2023 +0100
Minor: Add `Extensions::new()` (#5676)
* Minor: Add Extensions::new()
* Update datafusion/common/src/config.rs
---
datafusion/common/src/config.rs | 5 +++++
datafusion/core/src/execution/context.rs | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/datafusion/common/src/config.rs b/datafusion/common/src/config.rs
index ecc2f444ab..fb4c3422cb 100644
--- a/datafusion/common/src/config.rs
+++ b/datafusion/common/src/config.rs
@@ -561,6 +561,11 @@ pub trait ExtensionOptions: Send + Sync + std::fmt::Debug
+ 'static {
pub struct Extensions(BTreeMap<&'static str, ExtensionBox>);
impl Extensions {
+ /// Create a new, empty [`Extensions`]
+ pub fn new() -> Self {
+ Self(BTreeMap::new())
+ }
+
/// Registers a [`ConfigExtension`] with this [`ConfigOptions`]
pub fn insert<T: ConfigExtension>(&mut self, extension: T) {
assert_ne!(T::PREFIX, "datafusion");
diff --git a/datafusion/core/src/execution/context.rs
b/datafusion/core/src/execution/context.rs
index 378159c26b..39111bd139 100644
--- a/datafusion/core/src/execution/context.rs
+++ b/datafusion/core/src/execution/context.rs
@@ -2620,7 +2620,7 @@ mod tests {
fn task_context_extensions() -> Result<()> {
let runtime = Arc::new(RuntimeEnv::default());
let task_props = HashMap::from([("test.value".to_string(),
"24".to_string())]);
- let mut extensions = Extensions::default();
+ let mut extensions = Extensions::new();
extensions.insert(TestExtension::default());
let task_context = TaskContext::try_new(