Skip to content

Add missing registration methods - #1474

Merged
timsaucer merged 11 commits into
apache:mainfrom
timsaucer:feat/add-missing-registration-methods
Apr 8, 2026
Merged

Add missing registration methods#1474
timsaucer merged 11 commits into
apache:mainfrom
timsaucer:feat/add-missing-registration-methods

Conversation

@timsaucer

Copy link
Copy Markdown
Member

Which issue does this PR close?

Closes#1458

Rationale for this change

These functions are available in the upstream repo but not exposed in Python

What changes are included in this PR?

Expose functions
Add unit tests

Are there any user-facing changes?

Addition only

…tches
Add read_arrow, read_empty, register_arrow, and register_batch methods to
SessionContext, exposing upstream DataFusion v53 functionality. The write_*
methods and read_batch/read_batches are already covered by DataFrame.write_*
and SessionContext.from_arrow respectively. Closesapache#1458.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 aims to expose additional upstream DataFusion SessionContext APIs in datafusion-python and add Python unit tests to validate the new bindings.

Changes:

  • Added SessionContext.register_batch() and SessionContext.register_arrow() bindings.
  • Added SessionContext.read_arrow() and SessionContext.read_empty() bindings.
  • Added unit tests covering Arrow IPC read/registration and RecordBatch registration.

Reviewed changes

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

FileDescription
crates/core/src/context.rsAdds PyO3 bindings for Arrow IPC read/register, batch registration, and an empty DataFrame read method.
python/datafusion/context.pyExposes the new bindings on the public Python SessionContext wrapper.
python/tests/test_context.pyAdds tests for read_arrow, read_empty, register_arrow, and register_batch.

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

Comment threadpython/datafusion/context.py Outdated
Comment threadcrates/core/src/context.rs Outdated
Comment threadpython/tests/test_context.py
Comment threadpython/datafusion/context.py
timsaucerand others added 3 commits April 5, 2026 07:41
…lias for empty_table
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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 11:48
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@timsaucer
timsaucerforce-pushed the feat/add-missing-registration-methods branch from d7555e7 to 03092edCompareApril 5, 2026 12:37
Comment threadpython/datafusion/context.py
Comment threadpython/datafusion/context.py
Comment threadconftest.py
timsaucerand others added 5 commits April 8, 2026 08:08
…rings
Demonstrate schema= and file_extension= keyword arguments in the
docstring examples for register_arrow and read_arrow, following project
guidelines for optional parameter documentation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Follow the same See Also alias convention used in functions.py since
read_empty is a simple alias for empty_table.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Avoid shared SessionContext state across doctests by having each
docstring example create its own ctx instance, matching the pattern
used throughout the rest of the codebase.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The pa alias is already provided by the doctest namespace in
conftest.py, so inline imports are unnecessary.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@timsaucer
timsaucer merged commit aa3b194 into apache:mainApr 8, 2026
21 checks passed
@timsaucer
timsaucer deleted the feat/add-missing-registration-methods branch April 8, 2026 13:22
Sign up for freeto 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 read/write and registration methods

3 participants

@timsaucer@ntjohnson1