Implement configuration extension support#1391
Merged
timsaucer merged 8 commits intoapache:mainfrom Mar 27, 2026
Merged
Conversation
This was referenced Feb 23, 2026
c54db11 to
58fef4c
Compare
timsaucer
commented
Mar 20, 2026
68f0283 to
274d9e7
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for DataFusion configuration extensions so Python SessionConfig can be augmented with upstream/FFI-provided extension options (and demonstrates usage via the FFI example crate).
Changes:
- Add
SessionConfig.with_extension(...)to pass config extensions through the Python API. - Implement
PySessionConfig.with_extension(...)in Rust, extracting/mergingFFI_ExtensionOptionsfrom a PyCapsule. - Extend the FFI example crate with a
MyConfigextension and a Python test demonstratingSHOW/SETagainst the extension.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| python/datafusion/context.py | Exposes SessionConfig.with_extension(...) on the public Python wrapper. |
| crates/core/src/context.rs | Adds Rust binding logic to extract/merge extension options from a Python object/capsule. |
| crates/core/src/dataset_exec.rs | Minor type annotation change for schema (clarifies type inference). |
| examples/datafusion-ffi-example/src/lib.rs | Registers the new config module and exports MyConfig to Python. |
| examples/datafusion-ffi-example/src/config.rs | Implements a sample ConfigExtension/ExtensionOptions plus a capsule exporter method. |
| examples/datafusion-ffi-example/python/tests/_test_config.py | Adds an example test covering config extension usage via SHOW/SET. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #1390
Rationale for this change
With the upstream repository now supporting FFI configuration options, we should support these in
datafusion-python.What changes are included in this PR?
Adds methods to add config extensions to
SessionConfigAre there any user-facing changes?
New addition. Existing methods are not impacted.