Skip to content

Commit e811330

Browse files
committed
Remove constant used throughout
1 parent 859586b commit e811330

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

datafusion/common/src/config.rs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,6 +1326,8 @@ impl ConfigField for ConfigOptions {
13261326
}
13271327
}
13281328

1329+
pub const DATAFUSION_FFI_CONFIG_NAMESPACE: &str = "datafusion_ffi";
1330+
13291331
impl ConfigOptions {
13301332
/// Creates a new [`ConfigOptions`] with default values
13311333
pub fn new() -> Self {
@@ -1364,10 +1366,13 @@ impl ConfigOptions {
13641366
}
13651367

13661368
if !self.extensions.0.contains_key(prefix)
1367-
&& self.extensions.0.contains_key("datafusion_ffi")
1369+
&& self
1370+
.extensions
1371+
.0
1372+
.contains_key(DATAFUSION_FFI_CONFIG_NAMESPACE)
13681373
{
13691374
inner_key = key;
1370-
prefix = "datafusion_ffi";
1375+
prefix = DATAFUSION_FFI_CONFIG_NAMESPACE;
13711376
}
13721377

13731378
let Some(e) = self.extensions.0.get_mut(prefix) else {
@@ -1620,7 +1625,6 @@ impl Extensions {
16201625

16211626
/// Retrieves the extension of the given type if any
16221627
pub fn get_mut<T: ConfigExtension>(&mut self) -> Option<&mut T> {
1623-
println!("extensions trying get_mut on prefix {}", T::PREFIX);
16241628
let e = self.0.get_mut(T::PREFIX)?;
16251629
e.0.as_any_mut().downcast_mut()
16261630
}
@@ -2152,11 +2156,12 @@ impl TableOptions {
21522156
}
21532157

21542158
if !self.extensions.0.contains_key(prefix)
2155-
&& self.extensions.0.contains_key("datafusion_ffi")
2159+
&& self
2160+
.extensions
2161+
.0
2162+
.contains_key(DATAFUSION_FFI_CONFIG_NAMESPACE)
21562163
{
2157-
prefix = "datafusion_ffi";
2158-
} else {
2159-
println!("Existing keys {:?}", self.extensions.0.keys());
2164+
prefix = DATAFUSION_FFI_CONFIG_NAMESPACE;
21602165
}
21612166

21622167
let Some(e) = self.extensions.0.get_mut(prefix) else {

datafusion/ffi/src/config/extension_options.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ impl Clone for FFI_ExtensionOptions {
145145
}
146146

147147
impl ConfigExtension for FFI_ExtensionOptions {
148-
const PREFIX: &'static str = "datafusion_ffi";
148+
const PREFIX: &'static str =
149+
datafusion_common::config::DATAFUSION_FFI_CONFIG_NAMESPACE;
149150
}
150151

151152
impl ExtensionOptions for FFI_ExtensionOptions {

0 commit comments

Comments
 (0)