Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add add_constraint method to SingleTableMetadata #881

Closed
amontanez24 opened this issue Jul 8, 2022 · 0 comments
Closed

Add add_constraint method to SingleTableMetadata #881

amontanez24 opened this issue Jul 8, 2022 · 0 comments
Assignees
Labels
feature request Request for a new feature
Milestone

Comments

@amontanez24
Copy link
Contributor

amontanez24 commented Jul 8, 2022

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 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: An Inequality constraint is being applied to mismatched sdtypes ("child_age", "start_date"). Both columns must be either numerical or datetime.

Additional context

@amontanez24 amontanez24 added the feature request Request for a new feature label Jul 8, 2022
@amontanez24 amontanez24 added this to the 1.0.0 milestone Aug 16, 2022
@amontanez24 amontanez24 self-assigned this Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request for a new feature
Projects
None yet
Development

No branches or pull requests

1 participant