mirror of
https://github.com/ilri/csv-metadata-quality.git
synced 2024-11-17 19:47:03 +01:00
csv_metadata_quality/app.py: Don't crash if fields are missing
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
We don't need to crash if someone feeds us a CSV file that is miss- ing commont DSpace fields like title, type, and subject.
This commit is contained in:
parent
28f9026286
commit
bd8943f36a
@ -164,6 +164,7 @@ def run(argv):
|
|||||||
|
|
||||||
# Check: duplicate items
|
# Check: duplicate items
|
||||||
# We extract just the title, type, and date issued columns to analyze
|
# We extract just the title, type, and date issued columns to analyze
|
||||||
|
try:
|
||||||
duplicates_df = df.filter(
|
duplicates_df = df.filter(
|
||||||
regex=r"dcterms\.title|dc\.title|dcterms\.type|dc\.type|dcterms\.issued|dc\.date\.issued"
|
regex=r"dcterms\.title|dc\.title|dcterms\.type|dc\.type|dcterms\.issued|dc\.date\.issued"
|
||||||
)
|
)
|
||||||
@ -171,6 +172,8 @@ def run(argv):
|
|||||||
|
|
||||||
# Delete the temporary duplicates DataFrame
|
# Delete the temporary duplicates DataFrame
|
||||||
del duplicates_df
|
del duplicates_df
|
||||||
|
except IndexError:
|
||||||
|
pass
|
||||||
|
|
||||||
##
|
##
|
||||||
# Perform some checks on rows so we can consider items as a whole rather
|
# Perform some checks on rows so we can consider items as a whole rather
|
||||||
|
Loading…
Reference in New Issue
Block a user