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

Bug Fix: Use historical partition field name #1161

Merged
merged 2 commits into from
Sep 12, 2024
Merged

Conversation

sungwy
Copy link
Collaborator

@sungwy sungwy commented Sep 11, 2024

Fixes: #1131

@sungwy sungwy changed the title Use historical partition field name Bug Fix: Use historical partition field name Sep 11, 2024
@@ -280,7 +280,7 @@ def _partition_field(self, transform_key: Tuple[int, Transform[Any, Any]], name:
for field_key in historical_fields:
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])
Copy link
Collaborator

Choose a reason for hiding this comment

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

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

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.

Copy link
Contributor

@kevinjqliu kevinjqliu left a comment

Choose a reason for hiding this comment

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

lgtm, thanks for adding the tests to show the difference between v1 and v2 spec

@sungwy sungwy merged commit 4035747 into apache:main Sep 12, 2024
8 checks passed
@sungwy sungwy deleted the sy-1131 branch September 12, 2024 12:16
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!
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.

Removing then adding the same partition in update_spec fails
3 participants