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

refactor(api!): refactor Python APIs for getting file list #1032

Merged
merged 4 commits into from
Dec 27, 2022

Conversation

wjones127
Copy link
Collaborator

@wjones127 wjones127 commented Dec 21, 2022

Description

This PR consolidates the four methods files(), file_paths(), file_uris(), files_by_partitions() into just two methods:

  • files() -> which returns paths as they are in the Delta Log (usually relative, but can be absolute, particularly if they are located outside of the delta table root).
  • file_uris(), which returns absolute URIs for all files.

Both of these now take the partition_filters parameter, making files_by_partitions() obsolete. That latter function has been marked deprecated, but it also returns it to its original behavior of returning absolute file paths and not relative ones, resolving #894.

Finally, the partition_filters parameter now supports passing values other than strings, such as integers and floats.

TODO:

  • Update documentation
  • Test behavior of filtering for null or non-null Null handling isn't supported by DNF filters IIUC
  • Test behavior of paths on object stores.

Related Issue(s)

Documentation

@wjones127 wjones127 marked this pull request as ready for review December 21, 2022 17:47
Copy link
Collaborator

@fvaleye fvaleye left a comment

Choose a reason for hiding this comment

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

Nice refactoring, thanks @wjones127 👍

@fvaleye fvaleye merged commit 4d64a1f into delta-io:main Dec 27, 2022
@wjones127 wjones127 deleted the fix/revert-uris branch December 27, 2022 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants