Skip to content

Commit 3220a06

Browse files
authored
Merge pull request #58 from ImageMarkup/isic-135-require-newer-isic-metadata
2 parents c7c5f61 + 6a05585 commit 3220a06

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

isic_cli/cli/metadata.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from humanize import intcomma
1111
from isic_metadata.metadata import MetadataRow
1212
from isic_metadata.utils import get_unstructured_columns
13+
from pydantic import ValidationError
1314
from rich.console import Console
1415
from rich.progress import Progress, track
1516
from rich.table import Table
@@ -48,8 +49,8 @@ def validate(csv_file: io.BufferedReader):
4849

4950
for i, (_, row) in track(enumerate(df.iterrows(), start=2), total=len(df)):
5051
try:
51-
MetadataRow.parse_obj(row)
52-
except Exception as e:
52+
MetadataRow.model_validate(row.to_dict())
53+
except ValidationError as e:
5354
for error in e.errors():
5455
column = error["loc"][0]
5556
column_problems[(column, error["msg"])].append(i)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"django-s3-file-field-client",
4242
"girder-cli-oauth-client",
4343
"humanize",
44-
"isic-metadata>=0.0.6",
44+
"isic-metadata>=0.1.0",
4545
"more-itertools",
4646
"numpy",
4747
"packaging",

0 commit comments

Comments
 (0)