Skip to content

Commit

Permalink
replace if with elif
Browse files Browse the repository at this point in the history
  • Loading branch information
HonahX committed Nov 22, 2023
1 parent 53efa28 commit b7fd063
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pyiceberg/table/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,11 +397,9 @@ def apply_table_update(update: TableUpdate, base_metadata: TableMetadata, contex
def _(update: UpgradeFormatVersionUpdate, base_metadata: TableMetadata, context: _TableMetadataUpdateContext) -> TableMetadata:
if update.format_version > SUPPORTED_TABLE_FORMAT_VERSION:
raise ValueError(f"Unsupported table format version: {update.format_version}")

if update.format_version < base_metadata.format_version:
elif update.format_version < base_metadata.format_version:
raise ValueError(f"Cannot downgrade v{base_metadata.format_version} table to v{update.format_version}")

if update.format_version == base_metadata.format_version:
elif update.format_version == base_metadata.format_version:
return base_metadata

updated_metadata_data = copy(base_metadata.model_dump())
Expand Down

0 comments on commit b7fd063

Please sign in to comment.