-
Notifications
You must be signed in to change notification settings - Fork 221
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
Fix downgrading of schema #176
Conversation
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.
LGTM! Thanks for the quick fix!
pyiceberg/table/__init__.py
Outdated
existing_schema_id: Optional[int] = None | ||
for schema in self._table.metadata.schemas: | ||
if new_schema == schema: | ||
existing_schema_id = schema.schema_id |
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.
Shall we add a break
here? Or may be:
existing_schema_id = next(
(schema.schema_id for schema in self.schemas if schema == new_schema), None)
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.
Oh, your suggestion is beautiful, thanks!
Thanks @danielcweeks and @HonahX for the review 🙌 |
No description provided.