You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a developer, it would be useful to check that the provided parameters for each constraint are valid since this is used when validating the metadata and also when creating a constraint.
Expected behavior
Add _validate_inputs class method to each constraint
The specific functionality differs for each constraint and is described below
Should catch and raise all errors together
Additional context
Constraint validation
Unique
"column_names" must be present Error: Missing required "column_names" in the Unique constraint
No additional attributes should be present Error: Invalid values ("pii") are present in a Unique constraint.
FixedCombinations
"column_names" must be present Error: Missing required values ("column_names") in a FixedCombinations constraint
No additional attributes should be present Error: Invalid values ("pii") are present in a FixedCombinations constraint.
Inequality
"high_column_name" and "low_column_name" must both be present Error: Missing required values ("high_column_name", "low_column_name") in an Inequality constraint
No additional attributes should be present Error: Invalid values ("pii") are present in a FixedCombinations constraint.
ScalarInequality
"relation", "column_name" and "value" must all be present Error: Missing required values ("relation", "column_name", "value") in a ScalarInequality constraint
"relation" must be one of ">", ">=", "<", "<=" Error: Invalid relation value ("==") in a ScalarInequality constraint. The relation must be one of: ">", ">=", "<" or "<=".
No additional attributes should be present Error: Invalid values ("pii") are present in a ScalarInequality constraint.
Range
"high_column_name", "between_column_name" and "low_column_name" must both all present Error: Missing required values ("high_column_name", "between_column_name", "low_column_name") in a Range constraint.
No additional attributes should be present Error: Invalid values ("pii") are present in a Range constraint.
ScalarRange
Required params must be present Error: Missing required values ("column_name", "low_value", "high_value") in a ScalarRange constraint.
No additional attributes should be present Error: Invalid values ("pii") are present in a ScalarRange constraint.
Positive
Required params must be present Error: Missing required values ("column_name") in a Positive constraint.
No additional attributes should be present Error: Invalid values ("pii") are present in a Positive constraint.
Negative
Required params must be present Error: Missing required values ("column_name") in a Negative constraint.
No additional attributes should be present Error: Invalid values ("pii") are present in a Negative constraint.
FixedIncrements
All required values should be present Error: Missing required values ("column_name", "increment") in a FixedIncrements constraint
increment_value should be an integer >0 Error: Invalid increment value (0.5) in a FixedIncrements constraint. Increments must be positive integers.
No additional attributes should be present Error: Invalid values ("pii") are present in a FixedIncrements constraint.
OneHotEncoding
"column_names" must be present Error: Missing required values ("column_names") in a OneHotEncoding constraint
No additional attributes should be present Error: Invalid values ("pii") are present in a OneHotEncoding constraint.
CustomConstraint
"column_names" must be present Error: Missing required values ("column_names") in a <name> constraint
The text was updated successfully, but these errors were encountered:
Problem Description
As a developer, it would be useful to check that the provided parameters for each constraint are valid since this is used when validating the metadata and also when creating a constraint.
Expected behavior
_validate_inputs
class method to each constraintAdditional context
Unique
Error: Missing required "column_names" in the Unique constraint
Error: Invalid values ("pii") are present in a Unique constraint.
FixedCombinations
Error: Missing required values ("column_names") in a FixedCombinations constraint
Error: Invalid values ("pii") are present in a FixedCombinations constraint.
Inequality
Error: Missing required values ("high_column_name", "low_column_name") in an Inequality constraint
Error: Invalid values ("pii") are present in a FixedCombinations constraint.
ScalarInequality
Error: Missing required values ("relation", "column_name", "value") in a ScalarInequality constraint
Error: Invalid relation value ("==") in a ScalarInequality constraint. The relation must be one of: ">", ">=", "<" or "<=".
Error: Invalid values ("pii") are present in a ScalarInequality constraint.
Range
Error: Missing required values ("high_column_name", "between_column_name", "low_column_name") in a Range constraint.
Error: Invalid values ("pii") are present in a Range constraint.
ScalarRange
Error: Missing required values ("column_name", "low_value", "high_value") in a ScalarRange constraint.
Error: Invalid values ("pii") are present in a ScalarRange constraint.
Positive
Error: Missing required values ("column_name") in a Positive constraint.
Error: Invalid values ("pii") are present in a Positive constraint.
Negative
Error: Missing required values ("column_name") in a Negative constraint.
Error: Invalid values ("pii") are present in a Negative constraint.
FixedIncrements
Error: Missing required values ("column_name", "increment") in a FixedIncrements constraint
Error: Invalid increment value (0.5) in a FixedIncrements constraint. Increments must be positive integers.
Error: Invalid values ("pii") are present in a FixedIncrements constraint.
Error: Missing required values ("column_names") in a OneHotEncoding constraint
Error: Invalid values ("pii") are present in a OneHotEncoding constraint.
CustomConstraint
Error: Missing required values ("column_names") in a <name> constraint
The text was updated successfully, but these errors were encountered: