1
0
mirror of https://github.com/ilri/csv-metadata-quality.git synced 2025-05-11 07:36:01 +02:00

Output field name for more fixes and checks

This helps identify which field has the error.
This commit is contained in:
2020-01-16 12:35:11 +02:00
parent 40ba9bae6c
commit 28b5996aa6
5 changed files with 35 additions and 21 deletions

View File

@ -51,7 +51,7 @@ def isbn(field):
return field
def separators(field):
def separators(field, field_name):
"""Check for invalid multi-value separators (ie "|" or "|||").
Prints the field with the invalid multi-value separator.
@ -70,7 +70,7 @@ def separators(field):
match = re.findall(r"^.*?\|.*$", value)
if match:
print(f"Invalid multi-value separator: {field}")
print(f"Invalid multi-value separator ({field_name}): {field}")
return field