[Python] Add table-handle, Arrow, and CDF object APIs#861
Closed
zacdav-db wants to merge 20 commits intodelta-io:mainfrom
Closed
[Python] Add table-handle, Arrow, and CDF object APIs#861zacdav-db wants to merge 20 commits intodelta-io:mainfrom
zacdav-db wants to merge 20 commits intodelta-io:mainfrom
Conversation
added 5 commits
March 8, 2026 16:33
Add an additive object-based Python API for Delta Sharing reads. This introduces SharingClient.table(...), DeltaSharingTable, DeltaSharingScan, load_as_arrow(...), and lazy Arrow batch surfaces via to_record_batches(...) and to_record_batch_reader(...). Keep the legacy URL-based pandas interface intact and add regression coverage to ensure the new table-handle pandas path matches the existing load_as_pandas(...) behavior. Update examples and docs to show the new table-handle API, add an Arrow + DuckDB quickstart, and document the extra duckdb example dependency. Closes delta-io#860 Signed-off-by: Zac Davies <zac@databricks.com>
Signed-off-by: Zac Davies <zachary.davies+data@databricks.com>
Signed-off-by: Zac Davies <zachary.davies+data@databricks.com>
Signed-off-by: Zac Davies <zachary.davies+data@databricks.com>
added 9 commits
March 8, 2026 17:50
Signed-off-by: Zac Davies <zachary.davies+data@databricks.com>
Signed-off-by: Zac Davies <zachary.davies+data@databricks.com>
Signed-off-by: Zac Davies <zachary.davies+data@databricks.com>
Signed-off-by: Zac Davies <zachary.davies+data@databricks.com>
Signed-off-by: Zac Davies <zachary.davies+data@databricks.com>
Signed-off-by: Zac Davies <zachary.davies+data@databricks.com>
Signed-off-by: Zac Davies <zachary.davies+data@databricks.com>
Signed-off-by: Zac Davies <zachary.davies+data@databricks.com>
Signed-off-by: Zac Davies <zachary.davies+data@databricks.com>
Author
|
To assess performance of changes I've run a benchmarks on Limit 10,000
Limit 1,000,000
|
added 2 commits
March 9, 2026 00:20
Signed-off-by: Zac Davies <zachary.davies+data@databricks.com>
Signed-off-by: Zac Davies <zachary.davies+data@databricks.com>
Author
|
@PatrickJin-db can you please help review? |
Collaborator
|
Is there a chance to split this into a couple small PRs to make the review process easy and better understanding of unit test coverage? |
added 2 commits
March 11, 2026 11:43
Signed-off-by: Zac Davies <zachary.davies+data@databricks.com>
Signed-off-by: Zac Davies <zachary.davies+data@databricks.com>
Author
|
I can give it a go, do you have any preference for how we should split it? |
added 2 commits
March 11, 2026 11:55
Signed-off-by: Zac Davies <zachary.davies+data@databricks.com>
Signed-off-by: Zac Davies <zachary.davies+data@databricks.com>
Author
|
Closing in favour of smaller PRs, starting with #862 |
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.
Summary
This PR adds an additive object-based Python API for Delta Sharing reads and extends that object model to change data feed.
It introduces:
SharingClient.table("share.schema.table")DeltaSharingTableDeltaSharingScanDeltaSharingChangesload_as_arrow(...)table.to_arrow(...)table.to_record_batches(...)table.to_record_batch_reader(...)table.changes(...).to_pandas()table.changes(...).to_arrow()table.changes(...).to_record_batches()table.changes(...).to_record_batch_reader()The existing URL-based pandas and CDF APIs remain supported.
Closes #860
Motivation
The current Python API requires callers to build
"<profile>#<share>.<schema>.<table>"strings even when they are already working with aSharingClientand table concepts. That is awkward and makes Arrow-native consumers harder to support cleanly.CDF also remained outside the new object model. This PR brings snapshot and CDF reads under the same table-oriented surface while preserving existing legacy behavior.
What Changed
Python API
Added:
SharingClient.table(...)DeltaSharingTable.scan(...)DeltaSharingTable.changes(...)DeltaSharingTable.to_pandas(...)DeltaSharingTable.to_arrow(...)DeltaSharingTable.to_record_batches(...)DeltaSharingTable.to_record_batch_reader(...)DeltaSharingChanges.to_pandas()DeltaSharingChanges.to_arrow()DeltaSharingChanges.to_record_batches()DeltaSharingChanges.to_record_batch_reader()load_as_arrow(...)Compatibility
Kept unchanged:
load_as_pandas("<profile>#<share>.<schema>.<table>")load_table_changes_as_pandas(...)SharingClient.list_*behaviorAdded regression coverage to verify:
load_as_pandas(...)matchesclient.table(...).to_pandas(...)load_table_changes_as_pandas(...)matchesclient.table(...).changes(...).to_pandas(...)Reader internals
RecordBatchiterationRecordBatchReadersupportExamples and docs
examples/python/quickstart_pandas.pyto lead with the new syntax and keep the older syntax as a compatibility exampleexamples/python/quickstart_arrow.pyexamples/README.mdpython/README.mdTesting
Ran:
Local results:
Notes
This PR is intentionally additive. It does not remove or deprecate the existing URL-based snapshot or CDF APIs.