mirror of
https://github.com/ilri/csv-metadata-quality.git
synced 2024-11-22 05:45:02 +01:00
csv_metadata_quality/fix.py: don't add "not found" region
country_converter returns the literal "not found" string if a coun- try cannot be found. In that case we do not want to consider that as a region!
This commit is contained in:
parent
7c61cae417
commit
473be5ac2f
@ -360,7 +360,9 @@ def countries_match_regions(row):
|
|||||||
# the parent regions ("Sub-Saharan Africa", "Africa", "World")
|
# the parent regions ("Sub-Saharan Africa", "Africa", "World")
|
||||||
un_region = cc.convert(names=country, to="UNRegion")
|
un_region = cc.convert(names=country, to="UNRegion")
|
||||||
|
|
||||||
if un_region not in regions:
|
# Add the new un_region to regions if it is not "not found" and if
|
||||||
|
# it doesn't already exist in regions.
|
||||||
|
if un_region != "not found" and un_region not in regions:
|
||||||
if un_region not in missing_regions:
|
if un_region not in missing_regions:
|
||||||
missing_regions.append(un_region)
|
missing_regions.append(un_region)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user