Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: public method to get partitions for DeltaTable (#2671) #2816

Merged
merged 4 commits into from
Aug 30, 2024

Conversation

omkar-foss
Copy link
Contributor

Description

This adds a public method partitions() to the DeltaTable class to get properly formatted partitions (list of dicts) for the table. Also provides an option to return partitions as a list of tuples, and proxies the partition filters to rust get_active_partitions().

This also adds supporting tests for this feature.

Related Issue(s)

Documentation

Documentation included in method's docstring.

@github-actions github-actions bot added the binding/python Issues for the Python package label Aug 22, 2024
python/deltalake/table.py Outdated Show resolved Hide resolved
@thomasfrederikhoeck
Copy link
Contributor

How does this work if partition is a date or a datetime? Would be nice with a test for this

@rtyler rtyler enabled auto-merge August 23, 2024 13:52
auto-merge was automatically disabled August 23, 2024 20:45

Head branch was pushed to by a user without write access

@omkar-foss
Copy link
Contributor Author

omkar-foss commented Aug 23, 2024

How does this work if partition is a date or a datetime? Would be nice with a test for this

Thanks for the suggestion @thomasfrederikhoeck! Have added a test for a date partitioned table in this commit.

@thomasfrederikhoeck
Copy link
Contributor

How does this work if partition is a date or a datetime? Would be nice with a test for this

Thanks for the suggestion @thomasfrederikhoeck! Have added a test for a date partitioned table in this commit.

Nice! 👍🏻

@rtyler rtyler enabled auto-merge August 27, 2024 19:18
@omkar-foss
Copy link
Contributor Author

Hi @rtyler thanks for approving this PR. It seems that one of the concurrency tests for Windows is failing here with a PermissionDenied error.

Please let me know if I shall check this out, or if it's an intermittent issue that'll get resolved on re-running the test. Thanks!

This adds a public method `partitions()` to the `DeltaTable` class
to get properly formatted partitions (list of dicts) for the table.
Also provides an option to return partitions as a list of tuples,
and proxies the partition filters to rust `get_active_partitions()`.

This also adds supporting tests for this feature.
@rtyler rtyler dismissed ion-elgreco’s stale review August 30, 2024 18:45

already addressed

@rtyler rtyler added this pull request to the merge queue Aug 30, 2024
Merged via the queue into delta-io:main with commit 5437be2 Aug 30, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
binding/python Issues for the Python package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Function behaving similarly to SHOW PARTITIONS in the Python API
4 participants