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 user, it would be very useful to be able to add constraints to the metadata programmatically since some of them often get missed the first time around.
Expected behavior
Add add_constraint method
This should add the constraint info to the dict
Parameters
constraint_name: string that is the name of the constraint class
**kwargs: Any other required key word arguments for the constraint.
>>>metadata.add_constraint(
constraint_name='FixedIncrements',
column_name='salary',
increment=5000)
# we should do a validation when they add this>>>metadata.add_constraint(
constraint_name='Inequality',
low_column_name='child_age',
high_column_name='start_date')
Error: AnInequalityconstraintisbeingappliedtomismatchedsdtypes ("child_age", "start_date"). Bothcolumnsmustbeeithernumericalordatetime.
Problem Description
As a user, it would be very useful to be able to add constraints to the metadata programmatically since some of them often get missed the first time around.
Expected behavior
add_constraint
methodconstraint_name
: string that is the name of the constraint class**kwargs
: Any other required key word arguments for the constraint.Additional context
_validate_inputs
method made in Add _validate_inputs class method to each constraint #878 and in Add validate method to SingleTableMetadata #879The text was updated successfully, but these errors were encountered: