Skip to content

feat: Support passing kwargs to polars.scan_iceberg in Table.to_polars - #3868

Open
hedger9487 wants to merge 1 commit into
apache:mainfrom
hedger9487:feat/table-to-polars-kwargs-3128
Open

hedger9487 wants to merge 1 commit into
apache:mainfrom
hedger9487:feat/table-to-polars-kwargs-3128

Conversation

@hedger9487

@hedger9487 hedger9487 commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Closes #3128

Rationale for this change

Currently, Table.to_polars() does not accept keyword arguments and calls polars.scan_iceberg(self) directly without forwarding options. This prevents users from passing crucial scan configurations such as storage_options (cloud credentials for S3/GCS/Azure), snapshot_id (time-travel queries), or reader_override.

This change updates Table.to_polars() to accept **kwargs: Any and forward them to polars.scan_iceberg(self, **kwargs).

Are these changes tested?

Yes, tested with:

  • tests/table/test_init.py::test_table_to_polars_forwards_kwargs: Unit test verifying exact forwarding of keyword arguments (both empty and populated) matching the convention of other engine bridges (to_daft, to_bodo, to_ray).
  • All 114 tests in tests/table/test_init.py and 468 tests in tests/table/ pass cleanly.
  • All pre-commit static analysis checks (uv run prek run -a) pass 100%.

Are there any user-facing changes?

Yes, Table.to_polars() now accepts **kwargs forwarded to polars.scan_iceberg, enabling users to supply storage_options, snapshot_id, reader_override, etc.

Copilot AI lite review requested due to automatic review settings August 27, 2026 09:12

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@hedger9487
hedger9487 force-pushed the feat/table-to-polars-kwargs-3128 branch 2 times, most recently from 7f9e959 to 2696f07 Compare August 27, 2026 09:41

@Fokko Fokko 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.

API wise there is now harm in allowing this 👍 Thanks @hedger9487

@Fokko
Fokko enabled auto-merge September 7, 2026 09:04
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that's incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions.

@github-actions github-actions Bot added the stale label Oct 8, 2026
auto-merge was automatically disabled October 8, 2026 17:30

Head branch was pushed to by a user without write access

@hedger9487
hedger9487 force-pushed the feat/table-to-polars-kwargs-3128 branch from 2696f07 to be3cd92 Compare October 8, 2026 17:30
@hedger9487

Copy link
Copy Markdown
Contributor Author

Rebased onto latest main so the newly required CI checks (markdown-link-check, python-ci-required, python-integration-required) can run. cc @Fokko

@github-actions github-actions Bot removed the stale label Oct 9, 2026

This branch has not been deployed

No deployments
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 option to pass storage config to polars lazy read

3 participants