Skip to content

Add missing deregister methods to SessionContext#1473

Open
timsaucer wants to merge 4 commits intoapache:mainfrom
timsaucer:feat/deregister-methods
Open

Add missing deregister methods to SessionContext#1473
timsaucer wants to merge 4 commits intoapache:mainfrom
timsaucer:feat/deregister-methods

Conversation

@timsaucer
Copy link
Copy Markdown
Member

Which issue does this PR close?

Closes #1457

Rationale for this change

These methods exist in the upstream repository but were not exposed to the Python API.

What changes are included in this PR?

Expose methods to python
Add unit tests

Are there any user-facing changes?

Addition only

Expose upstream DataFusion deregister methods (deregister_udf, deregister_udaf,
deregister_udwf, deregister_udtf, deregister_object_store) in both the Rust
PyO3 bindings and Python wrappers, closing the gap identified in apache#1457.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Exposes additional SessionContext deregistration APIs in the Python bindings to match upstream DataFusion capabilities, and adds tests for UDF/UDAF/UDWF/UDTF deregistration.

Changes:

  • Add Python SessionContext wrappers for deregister_object_store, deregister_udf, deregister_udaf, deregister_udwf, and deregister_udtf.
  • Add corresponding Rust PySessionContext bindings for the missing deregister methods.
  • Add Python unit tests verifying UDF/UDAF/UDWF/UDTF deregistration behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
python/datafusion/context.py Adds new public Python API methods on SessionContext to deregister object stores and user-defined functions.
crates/core/src/context.rs Adds PyO3-exposed Rust bindings that call through to DataFusion SessionContext/RuntimeEnv deregistration methods.
python/tests/test_context.py Adds tests covering deregistration of scalar UDFs, aggregate UDAFs, window UDWFs, and table UDTFs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

timsaucer and others added 3 commits April 4, 2026 09:38
DataFusion raises ValueError for planning errors when a deregistered
function is used in a query.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Url::parse() can fail on invalid input. Use .map_err() to convert
the error into a Python exception instead of panicking.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@timsaucer timsaucer marked this pull request as ready for review April 5, 2026 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add missing SessionContext deregister methods

2 participants