From b7fd063c9801f22de2d5b84be4836c8faff66b3d Mon Sep 17 00:00:00 2001 From: HonahX Date: Tue, 21 Nov 2023 23:52:38 -0800 Subject: [PATCH] replace if with elif --- pyiceberg/table/__init__.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pyiceberg/table/__init__.py b/pyiceberg/table/__init__.py index 2740e4069..cc99eeb0b 100644 --- a/pyiceberg/table/__init__.py +++ b/pyiceberg/table/__init__.py @@ -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())