-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add safety check for showing common values (#124)
* Adds a frequency limit, and a check for how large the max_count is compared to the dataset size
- Loading branch information
1 parent
d28d65f
commit 4d96229
Showing
11 changed files
with
114 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
Field Name,Description,Field Type,Common Values | ||
Identité,,string, | ||
Province,,choice,"Equateur, Orientale, Katanga, Kinshasa" | ||
Province,,choice,"Equateur, Orientale, Katanga" | ||
DateNotification,,string, | ||
Classicfication ,,choice,"FISH, amphibie, oiseau, Mammifère, poisson, REPT, OISEAU" | ||
Classicfication ,,choice,"FISH, amphibie, oiseau, Mammifère, poisson, REPT" | ||
Nom complet ,,string, | ||
Date de naissance,,string, | ||
AgeAns,,number, | ||
AgeMois ,,number, | ||
Sexe,,choice,"F, M, f, m, f, m , inconnu" | ||
Sexe,,choice,"F, M, f, m, f, m " | ||
StatusCas,,choice,"Vivant, Décédé" | ||
DateDec,,string, | ||
ContSoins ,,choice,"Oui, Non" | ||
ContHumain Autre,,choice,"Non, Oui" | ||
AutreContHumain,,choice,"Non, Voyage, Autres, Voyage , Oui" | ||
AutreContHumain,,choice,"Non, Voyage, Autres, Voyage " | ||
ContactAnimal,,choice,"Oui, Non" | ||
Micropucé,,choice,"Oui, NON, OUI, oui" | ||
AnimalDeCompagnie,,choice,"Oui, Non, non" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
Field Name,Description,Field Type,Common Values | ||
Identité,Identity,string, | ||
Province,Province,choice,"Equateur, Orientale, Katanga, Kinshasa" | ||
Province,Province,choice,"Equateur, Orientale, Katanga" | ||
DateNotification,Notification Date,string, | ||
Classicfication ,Classification,choice,"FISH, amphibie, oiseau, Mammifère, poisson, REPT, OISEAU" | ||
Classicfication ,Classification,choice,"FISH, amphibie, oiseau, Mammifère, poisson, REPT" | ||
Nom complet ,Full Name,string, | ||
Date de naissance,Date of Birth,string, | ||
AgeAns,Age in Years,number, | ||
AgeMois ,Age in Months,number, | ||
Sexe,Gender,choice,"F, M, f, m, f, m , inconnu" | ||
Sexe,Gender,choice,"F, M, f, m, f, m " | ||
StatusCas,Case Status,choice,"Vivant, Décédé" | ||
DateDec,Date of Death,string, | ||
ContSoins ,Care Contact,choice,"Oui, Non" | ||
ContHumain Autre,Other Human Contact,choice,"Non, Oui" | ||
AutreContHumain,Other Human Contact,choice,"Non, Voyage, Autres, Voyage , Oui" | ||
AutreContHumain,Other Human Contact,choice,"Non, Voyage, Autres, Voyage " | ||
ContactAnimal,Animal Contact,choice,"Oui, Non" | ||
Micropucé,Microchipped,choice,"Oui, NON, OUI, oui" | ||
AnimalDeCompagnie,Pet Animal,choice,"Oui, Non, non" |
26 changes: 26 additions & 0 deletions
26
tests/test_autoparser/sources/config_missing_common_count.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
name = "config file for testing" | ||
description = "Autoparser config for generating CSV mappings and TOML" | ||
|
||
# Used by parse_choices() to generate values mapping | ||
# Using the delimiters below, we can parse this string: | ||
# oui=True, non=False | ||
# to this TOML: | ||
# { "oui" = True, "non" = False} | ||
|
||
choice_delimiter = "," | ||
choice_delimiter_map = "=" | ||
|
||
# max number of references to use in the parser file | ||
num_refs = 3 | ||
|
||
# Path to the target schemas, one per table | ||
[schemas] | ||
animals = "animals.schema.json" | ||
|
||
# Column mappings to standardise column names across data dictionaries | ||
[column_mappings] | ||
source_field = "Field Name" | ||
source_type = "Field Type" | ||
source_description = "Description" | ||
common_values = "Common Values" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters