mirror of
https://github.com/ilri/csv-metadata-quality.git
synced 2025-05-09 22:56:01 +02:00
Ignore subregion field for missing region checks
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Due to a sloppy regex I was sometimes matching the subregion field when checking for missing UN M.49 regions in the region field.
This commit is contained in:
@ -512,9 +512,9 @@ def countries_match_regions(row, exclude):
|
||||
if match is not None:
|
||||
country_column_name = label
|
||||
|
||||
# Find the name of the region column
|
||||
# Find the name of the region column, but make sure it's not subregion!
|
||||
match = re.match(r"^.*?region.*$", label)
|
||||
if match is not None:
|
||||
if match is not None and "sub" not in label:
|
||||
region_column_name = label
|
||||
|
||||
# Find the name of the title column
|
||||
|
@ -327,9 +327,9 @@ def countries_match_regions(row, exclude):
|
||||
if match is not None:
|
||||
country_column_name = label
|
||||
|
||||
# Find the name of the region column
|
||||
# Find the name of the region column, but make sure it's not subregion!
|
||||
match = re.match(r"^.*?region.*$", label)
|
||||
if match is not None:
|
||||
if match is not None and "sub" not in label:
|
||||
region_column_name = label
|
||||
|
||||
# Find the name of the title column
|
||||
|
Reference in New Issue
Block a user