Skip to content

Add UnionByName functionality#296

Merged
Fokko merged 5 commits intoapache:mainfrom
Fokko:fd-add-name-mapping
Jan 26, 2024
Merged

Add UnionByName functionality#296
Fokko merged 5 commits intoapache:mainfrom
Fokko:fd-add-name-mapping

Conversation

@Fokko
Copy link
Copy Markdown
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
Copy Markdown
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

Comment thread tests/test_schema.py
type=ListType(
element_id=2,
element_type=ListType(
element_id=3,
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment thread pyiceberg/table/__init__.py
Comment thread pyiceberg/table/__init__.py Outdated
Comment thread pyiceberg/table/__init__.py Outdated
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
Copy Markdown
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
Copy Markdown
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

Comment thread pyiceberg/table/__init__.py Outdated
Comment thread pyiceberg/table/__init__.py Outdated
Comment thread pyiceberg/table/__init__.py Outdated
Comment thread pyiceberg/table/__init__.py
Copy link
Copy Markdown
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!

Comment thread pyiceberg/table/__init__.py Outdated
Fokko and others added 3 commits January 26, 2024 14:08
Co-authored-by: Honah J. <undefined.newdb.newtable@gmail.com>
@Fokko Fokko merged commit cd7fb50 into apache:main Jan 26, 2024
@Fokko Fokko deleted the fd-add-name-mapping branch January 26, 2024 13:36
@Fokko
Copy link
Copy Markdown
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