We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4ef7fb8 commit c172cabCopy full SHA for c172cab
crates/core/src/context.rs
@@ -188,6 +188,11 @@ impl PySessionConfig {
188
}
189
190
pub fn with_extension(&self, extension: Bound<PyAny>) -> PyResult<Self> {
191
+ if !extension.hasattr("__datafusion_extension_options__")? {
192
+ return Err(pyo3::exceptions::PyAttributeError::new_err(
193
+ "Expected extension object to define __datafusion_extension_options__()",
194
+ ));
195
+ }
196
let capsule = extension.call_method0("__datafusion_extension_options__")?;
197
let capsule = capsule.cast::<PyCapsule>()?;
198
0 commit comments