Skip to content

Commit 95e587d

Browse files
Apply suggestions from code review
Co-authored-by: kirkrodrigues <[email protected]>
1 parent 7600b1b commit 95e587d

File tree

1 file changed

+7
-6
lines changed
  • components/clp-package-utils/clp_package_utils

1 file changed

+7
-6
lines changed

components/clp-package-utils/clp_package_utils/general.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -564,16 +564,17 @@ def validate_path_for_container_mount(path: pathlib.Path) -> None:
564564

565565
def validate_dataset(db_config: Database, dataset: str) -> None:
566566
"""
567-
Checks if `dataset` currently exists in the metadata database.
567+
Validates that `dataset` exists in the metadata database.
568+
568569
:param db_config:
569570
:param dataset:
570-
:raise: ValueError
571+
:raise: ValueError if the dataset doesn't exist.
571572
"""
572-
sql_adapter: SQL_Adapter = SQL_Adapter(db_config)
573-
clp_db_connection_params: dict[str, any] = db_config.get_clp_connection_params_and_type(True)
574-
table_prefix: str = clp_db_connection_params["table_prefix"]
573+
sql_adapter = SQL_Adapter(db_config)
574+
clp_db_connection_params = db_config.get_clp_connection_params_and_type(True)
575+
table_prefix = clp_db_connection_params["table_prefix"]
575576
with closing(sql_adapter.create_connection(True)) as db_conn, closing(
576577
db_conn.cursor(dictionary=True)
577578
) as db_cursor:
578579
if dataset not in fetch_existing_datasets(db_cursor, table_prefix):
579-
raise ValueError(f"Dataset `{dataset}` does not exist.")
580+
raise ValueError(f"Dataset `{dataset}` doesn't exist.")

0 commit comments

Comments
 (0)