-
Notifications
You must be signed in to change notification settings - Fork 365
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: add support for multiple partition columns and filters in to_pyarrow_dataset() and OR filters in write_datalake() #1722
Open
ldacey
wants to merge
13
commits into
delta-io:main
Choose a base branch
from
ldacey:partitions
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
4c0551a
Add support for multiple partition columns and multiple partitions in…
ldacey b128bc3
Add test_pyarrow_dataset_partitions pytest
ldacey 133f246
Add support for overwriting partitions based on multiple conditions
ldacey 3b53dc4
Add test_overwriting_multiple_partitions pytest
ldacey f42494c
Add check for empty lists in to_pyarrow_dataset partititions argument
ldacey 4d390d5
Add validate_filters and stringify_partition_values to _util.py
ldacey 99e2041
Refactor dataset expressions and fragment building DeltaTable
ldacey 87e397f
Add tests for filters_to_expression, stringify_partition_values, and …
ldacey 32224d4
Add test_encode_partition_value and reorder type checks
ldacey 1b52925
Clarify that the validate_filters returns a list of lists of tuples
ldacey e87a1ec
Update types and add validated_filters variable
ldacey 87ce8e1
Add @pytest.mark.pandas decorator to fix tests
ldacey 0b8b6bb
Add test for single filter
ldacey File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we creating a write transaction per filter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seemed like the create_write_transaction() was not able to handle a list of lists of tuples (OR conditions), so I had to treat each condition separately and loop through them.
[id_values0-account_values0-created_date_values0-updated_at_values0-value_values0-partition_by0-partition_filters0] TypeError: argument 'partitions_filters': 'list' object cannot be converted to 'PyTuple' [909, 1]
Looping through each filter results in this:
If we use a single list of tuples (AND condition) like the example below, there is still only one call to
table.update_incremental()
.