Skip to content

[Python] Add Arrow materializers for table snapshots - #949

Merged
PatrickJin-db merged 20 commits into
delta-io:mainfrom
zacdav-db:python-arrow-table-handles
Jul 29, 2026
Merged

PatrickJin-db merged 20 commits into
delta-io:mainfrom
zacdav-db:python-arrow-table-handles

Conversation

@zacdav-db

@zacdav-db zacdav-db commented May 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary
Adds Arrow-native materializers to Python table snapshots, following the staged object API plan in #860 and building on the table-handle APIs from #862.

This PR adds snapshot support through:

  • to_arrow()
  • to_record_batches()
  • to_record_batch_reader()

It also keeps the URL-based load_as_arrow(...) helper available for parity with the existing legacy read APIs.

Scope

  • snapshot Arrow materialization
  • lazy RecordBatch iteration and RecordBatchReader support
  • Delta timestamp columns normalized to timestamp[us, UTC] so parquet and delta-kernel paths return consistent schemas
  • focused coverage for object API wiring, legacy parity, schema normalization, partition columns, timestamp normalization, and kernel-path limits

CDF Arrow materialization is intentionally split into a follow-up PR.

Not Included

Testing

  • Python test suite: 87 passed, 126 skipped
  • dev/lint-python (compile, black, pycodestyle, flake8, mypy): passed
  • pydoc checks skipped because sphinx-build is not installed
  • git diff --check upstream/main: passed

Part of #860; builds on #862.

@zacdav-db
zacdav-db force-pushed the python-arrow-table-handles branch from a799778 to 5eb7c90 Compare May 19, 2026 06:25
@zacdav-db
zacdav-db marked this pull request as ready for review May 19, 2026 06:32
@zacdav-db

zacdav-db commented May 19, 2026 •

Copy link
Copy Markdown
Contributor Author

@PatrickJin-db this follows on from #862 (once merged)

@zacdav-db zacdav-db changed the title [Python] Add table handles and Arrow materializers [Python] Arrow materializers May 19, 2026
@zacdav-db
zacdav-db force-pushed the python-arrow-table-handles branch 2 times, most recently from 4edb330 to a660043 Compare June 13, 2026 01:25
@zacdav-db zacdav-db changed the title [Python] Arrow materializers [Python] Add Arrow materializers for table handles Jun 13, 2026
Comment thread python/delta_sharing/reader.py Resolved
Comment thread python/delta_sharing/reader.py Resolved
Comment thread python/delta_sharing/reader.py Resolved
Comment thread python/delta_sharing/reader.py Resolved
Comment thread python/delta_sharing/reader.py Resolved
Comment thread python/delta_sharing/reader.py Resolved
Comment thread python/delta_sharing/reader.py Resolved

@PatrickJin-db PatrickJin-db left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can we split the snapshot and CDF methods into separate PRs? This PR is a bit large.

Comment thread python/delta_sharing/delta_sharing.py Resolved
Comment thread python/delta_sharing/reader.py Resolved
Comment thread python/delta_sharing/reader.py Resolved
@zacdav-db
zacdav-db force-pushed the python-arrow-table-handles branch from f6d08c5 to 02b1cb1 Compare July 17, 2026 05:05
Zac Davies added 4 commits July 17, 2026 15:35
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>
@zacdav-db
zacdav-db force-pushed the python-arrow-table-handles branch from 5028f8b to afd537b Compare July 17, 2026 05:43
@zacdav-db zacdav-db changed the title [Python] Add Arrow materializers for table handles [Python] Add Arrow materializers for table snapshots Jul 17, 2026
Signed-off-by: Zac Davies <zachary.davies+data@databricks.com>

@PatrickJin-db PatrickJin-db left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Logic seems fine now but I would strongly prefer more test coverage. We also need to split up reader.py but that can be done after all the arrow PRs are merged.

Zac Davies added 8 commits July 21, 2026 17:07
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>
@zacdav-db

Copy link
Copy Markdown
Contributor Author

@PatrickJin-db Reused the existing snapshot coverage for pandas/Arrow parity, including parquet and kernel paths.

PatrickJin-db
PatrickJin-db previously approved these changes Jul 23, 2026
Comment thread python/delta_sharing/delta_sharing.py Resolved
Signed-off-by: Zac Davies <zachary.davies+data@databricks.com>
Zac Davies added 4 commits July 24, 2026 11:30
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>
@zacdav-db

zacdav-db commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor Author

@PatrickJin-db addressed your comments:

  • Made Arrow match pandas column naming: Parquet columns keep their physical casing, while added partition columns keep the Delta schema casing.
  • Kept those names consistent across Arrow tables, record batches, and record batch readers, and reused the first Parquet dataset.
  • Cleaned up the snapshot test helper and removed duplicate sorting.
  • Fixed the load_as_arrow wording.

Comment thread python/delta_sharing/reader.py Resolved
Signed-off-by: Zac Davies <zachary.davies+data@databricks.com>
@PatrickJin-db
PatrickJin-db merged commit 3430d2f into delta-io:main Jul 29, 2026
5 checks passed
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.

2 participants