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 MultiTableMetadata #895

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

Add add_constraint method to MultiTableMetadata #895

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

Comments

@amontanez24
Copy link
Contributor

Problem Description

As a user, it would be very useful to be able to add constraints for a table programmatically to my MultiTableMetadata.

Expected behavior

  • Add add_constraint method
    • This should just call the single table add_constraint method for the specified table
    • Parameters
      • table_name: string that is the name of the table
      • constraint_name: string that is the name of the constraint class
      • **kwargs: Any other required key word arguments for the constraint.
    • Errors:
      • Same as single table
      • If the table doesn't exist, raise an error
        Error: Unknown table name ('userss')
>>> metadata.add_constraint(
        table_name='users',
        ...)

>>> metadata.add_constraint(table_name='userss', ...)
Error: Unknown table name ('userss')

>>> metadata.add_constraint(
        table_name='users',
        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.
@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