mirror of
https://github.com/ilri/csv-metadata-quality.git
synced 2025-05-11 15:46:03 +02:00
Improve exclude function
When a user explicitly requests that a field be excluded with -x we skip that field in most checks. Up until now that did not include the item-based checks using a transposed dataframe because we don't know the metadata field names (labels) until we iterate over them. Now the excludes are respected for item-based checks.
This commit is contained in:
@ -131,6 +131,7 @@ def test_fix_country_not_matching_region():
|
||||
country = "Kenya"
|
||||
region = ""
|
||||
missing_region = "Eastern Africa"
|
||||
exclude = list()
|
||||
|
||||
# Emulate a column in a transposed dataframe (which is just a series)
|
||||
d = {
|
||||
@ -140,7 +141,7 @@ def test_fix_country_not_matching_region():
|
||||
}
|
||||
series = pd.Series(data=d)
|
||||
|
||||
result = fix.countries_match_regions(series)
|
||||
result = fix.countries_match_regions(series, exclude)
|
||||
|
||||
# Emulate the correct series we are expecting
|
||||
d_correct = {
|
||||
|
Reference in New Issue
Block a user