1
0
mirror of https://github.com/ilri/csv-metadata-quality.git synced 2025-05-09 22:56:01 +02:00

Add column name to output in date checks

This makes it easier to understand where the error is in case a CSV
has multiple date fields, for example:

    Missing date (dc.date.issued).
    Missing date (dc.date.issued[]).

If you have 126 items and you get 126 "Missing date" messages then
it's likely that 100 of the items have dates in one field, and the
others have dates in other field.
This commit is contained in:
2019-08-21 15:31:12 +03:00
parent 3247495cee
commit ed5612fbcf
2 changed files with 5 additions and 5 deletions

View File

@ -84,7 +84,7 @@ def run(argv):
# Check: invalid date
match = re.match(r'^.*?date.*$', column)
if match is not None:
df[column] = df[column].apply(check.date)
df[column] = df[column].apply(check.date, field_name=column)
# Check: filename extension
if column == 'filename':