Skip to content

Add missing SessionContext utility methods#1475

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

Add missing SessionContext utility methods#1475
timsaucer wants to merge 4 commits intoapache:mainfrom
timsaucer:feat/add-utility-methods

Conversation

@timsaucer
Copy link
Copy Markdown
Member

Which issue does this PR close?

Closes #1459

Rationale for this change

These methods exist in the upstream repository but have not been exposed to Python.

What changes are included in this PR?

Add methods to the Python API
Add unit tests

Are there any user-facing changes?

New addition only.

Expose upstream DataFusion v53 utility methods: session_start_time,
enable_ident_normalization, parse_sql_expr, execute_logical_plan,
refresh_catalogs, remove_optimizer_rule, and table_provider. The
add_optimizer_rule and add_analyzer_rule methods are omitted as the
OptimizerRule and AnalyzerRule traits are not yet exposed to Python.
Closes apache#1459.

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

This PR exposes additional SessionContext utility/introspection methods in the datafusion-python API to match capabilities available in upstream DataFusion v53 (Issue #1459), and adds unit tests to cover the new Python surface area.

Changes:

  • Added Python SessionContext wrappers for: session_start_time, enable_ident_normalization, parse_sql_expr, execute_logical_plan, refresh_catalogs, remove_optimizer_rule, and table_provider.
  • Added corresponding Rust binding methods on PySessionContext to call into DataFusion v53 APIs.
  • Added unit tests validating the new Python methods.

Reviewed changes

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

File Description
python/datafusion/context.py Adds new SessionContext methods to the public Python API and wraps internal bindings (Expr, DataFrame, Table).
crates/core/src/context.rs Exposes the underlying DataFusion SessionContext methods via the PyO3 PySessionContext bindings.
python/tests/test_context.py Adds tests for the newly exposed SessionContext methods.

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

timsaucer and others added 2 commits April 5, 2026 08:14
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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 12:28
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 utility methods

2 participants