Skip to content

Commit a3cc1ed

Browse files
committed
Fixed mypy checks
1 parent 5143fad commit a3cc1ed

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

bam_masterdata/cli/excel_to_entities.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,14 @@ def properties_to_dict(
131131
(
132132
codes,
133133
descriptions,
134-
mandatories,
135-
shows,
136134
sections,
137135
labels,
138136
data_types,
139137
vocabulary_codes,
140-
) = [], [], [], [], [], [], [], []
138+
) = [], [], [], [], [], []
139+
140+
mandatories: list[bool] = []
141+
shows: list[bool] = []
141142

142143
# Iterate over expected terms and extract corresponding column values
143144
for term in expected_terms:
@@ -303,7 +304,8 @@ def terms_to_dict(
303304
header_index = start_index_row + 3
304305
row_headers = [cell.value for cell in sheet[header_index]]
305306

306-
(codes, descriptions, urls, labels, officials) = [], [], [], [], []
307+
(codes, descriptions, urls, labels) = [], [], [], []
308+
officials: list[bool] = []
307309

308310
for term in expected_terms:
309311
if term not in row_headers:
@@ -407,7 +409,7 @@ def block_to_entity_dict(
407409
Returns:
408410
A dictionary containing the entity attributes.
409411
"""
410-
attributes_dict: dict[str, Any] = {}
412+
attributes_dict = {}
411413

412414
# Get the entity type from the specified cell
413415
entity_type_position = f"A{start_index_row}"
@@ -428,7 +430,7 @@ def block_to_entity_dict(
428430

429431
# Check if the entity type is valid
430432
if entity_type not in entity_types:
431-
logger.error(
433+
raise ValueError(
432434
"The entity type (cell A1) should be one of the following: SAMPLE_TYPE/OBJECT_TYPE, EXPERIMENT_TYPE/COLLECTION_TYPE, DATASET_TYPE, PROPERTY_TYPE, VOCABULARY_TYPE"
433435
)
434436
else:

0 commit comments

Comments
 (0)