Uh oh!
There was an error while loading. Please reload this page.
Add missing registration methods - #1474
Conversation
…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>
There was a problem hiding this comment.
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()andSessionContext.register_arrow()bindings. - Added
SessionContext.read_arrow()andSessionContext.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.
| File | Description |
|---|---|
crates/core/src/context.rs | Adds PyO3 bindings for Arrow IPC read/register, batch registration, and an empty DataFrame read method. |
python/datafusion/context.py | Exposes the new bindings on the public Python SessionContext wrapper. |
python/tests/test_context.py | Adds 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.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…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>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
d7555e7 to
03092edCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…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>
Uh oh!
There was an error while loading. Please reload this page.
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