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

Add UnionByName functionality #296

Merged
merged 5 commits into from
Jan 26, 2024
Merged

Add UnionByName functionality #296

merged 5 commits into from
Jan 26, 2024

Conversation

Fokko
Copy link
Contributor

@Fokko Fokko commented Jan 23, 2024

Resolves #284

@HonahX HonahX added this to the PyIceberg 0.6.0 release milestone Jan 25, 2024
Copy link
Contributor

@HonahX HonahX left a comment

Choose a reason for hiding this comment

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

Thanks for the great work! @Fokko. It looks good. I left some comments and questions

type=ListType(
element_id=2,
element_type=ListType(
element_id=3,
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of curiosity, did you manually format the schema in this style or the make lint did the job? This looks nice, especially in case of multi-level nested schema 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pyiceberg/table/__init__.py Show resolved Hide resolved
pyiceberg/table/__init__.py Outdated Show resolved Hide resolved
else:
return self.new_schema.find_field(field_id).field_type

def field(self, field: NestedField, field_partner: Optional[int], field_result: bool) -> bool:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
def field(self, field: NestedField, field_partner: Optional[int], field_result: bool) -> bool:
def field(self, field: NestedField, partner_id: Optional[int], field_result: bool) -> bool:

Shall we name the second argument as partner_id to better reveal its content? We already did this in schema and struct. Same applied for *_partner arguments below

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I like it, thanks for the suggestion

pyiceberg/table/__init__.py Outdated Show resolved Hide resolved
pyiceberg/table/__init__.py Outdated Show resolved Hide resolved
pyiceberg/table/__init__.py Outdated Show resolved Hide resolved
pyiceberg/table/__init__.py Show resolved Hide resolved
Copy link
Contributor

@HonahX HonahX left a comment

Choose a reason for hiding this comment

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

Thanks @Fokko. LGTM!

pyiceberg/table/__init__.py Outdated Show resolved Hide resolved
@Fokko Fokko merged commit cd7fb50 into apache:main Jan 26, 2024
6 checks passed
@Fokko Fokko deleted the fd-add-name-mapping branch January 26, 2024 13:36
@Fokko
Copy link
Contributor Author

Fokko commented Jan 26, 2024

Thanks for the review @HonahX

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.

Add unionByName visitor to update schema
2 participants