We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a165ba7 commit e854829Copy full SHA for e854829
pyiceberg/table/__init__.py
@@ -1412,10 +1412,9 @@ def commit(self) -> None:
1412
"""Apply the pending changes and commit."""
1413
new_schema = self._apply()
1414
1415
- existing_schema_id: Optional[int] = None
1416
- for schema in self._table.metadata.schemas:
1417
- if new_schema == schema:
1418
- existing_schema_id = schema.schema_id
+ existing_schema_id = existing_schema_id = next(
+ (schema.schema_id for schema in self._table.metadata.schemas if schema == new_schema), None
+ )
1419
1420
# Check if it is different current schema ID
1421
if existing_schema_id != self._table.schema().schema_id:
0 commit comments