Bug Fix: Use historical partition field name#1161
Merged
sungwy merged 2 commits intoapache:mainfrom Sep 12, 2024
Merged
Conversation
ndrluis
reviewed
Sep 11, 2024
pyiceberg/table/update/spec.py
Outdated
| if field_key[0] == source_id and field_key[2] == repr(transform): | ||
| if name is None or field_key[3] == name: | ||
| return PartitionField(source_id, field_key[1], transform, name) | ||
| return PartitionField(source_id, field_key[1], transform, field_key[3]) |
Collaborator
There was a problem hiding this comment.
What do you think about using an Enum to get the values from the field_key? I think that will make it easier to understand what each position means.
Collaborator
Author
There was a problem hiding this comment.
Hey, thank you for the great suggestion! I didn't use Enums, but updated it to use a list of PartitionField instead, which I think makes a lot more sense than the current approach.
kevinjqliu
approved these changes
Sep 11, 2024
Contributor
kevinjqliu
left a comment
There was a problem hiding this comment.
lgtm, thanks for adding the tests to show the difference between v1 and v2 spec
ndrluis
approved these changes
Sep 12, 2024
sungwy
added a commit
to sungwy/iceberg-python
that referenced
this pull request
Dec 7, 2024
* use historical partition field name * thanks ndrluis!
sungwy
added a commit
to sungwy/iceberg-python
that referenced
this pull request
Dec 7, 2024
* use historical partition field name * thanks ndrluis!
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes: #1131