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 Inequality CAG pattern #2384

Open
frances-h opened this issue Feb 25, 2025 · 0 comments
Open

Add Inequality CAG pattern #2384

frances-h opened this issue Feb 25, 2025 · 0 comments
Assignees
Labels
feature request Request for a new feature
Milestone

Comments

@frances-h
Copy link
Contributor

Problem Description

As we've built up our multi-table CAG patterns, we'd like to convert our each of our existing single table constraints to use the new CAG framework.

Expected behavior

Add the Inequality CAG pattern. This CAG should inherit from the base CAG class. This CAG should copy the functionality of the existing constraint, much of _fit, _transform, and _reverse_transform should be able to be directly copied without significant logical rewrites.

Args
low_column_name (str): Same as Inequality constraint
high_column_name (str): Same as Inequality constraint
strict_boundaries (str): Same as Inequality constraint
table_name (str, optional): The name of the table to apply the CAG pattern to.

Expected Functionality

_validate_pattern_with_metadata

  • If no table_name is provided, the metadata must only contain a single table (this should be considered the target table)
  • Validate that both the low_column_name and high_column_name columns exist in the table in the metadata.
  • Validate that both the low_column_name and high_column_name have the same sdtype, and that it is either numerical or datetime

_validate_pattern_with_data

  • Validate that the inequality requirement is met between the high and low columns

_get_updated_metadata

  • Add the diff column to the table (by default can be '{low_column_name}#{high_column_name}')
  • Drop the high_column_name from the metadata.

_fit

  • Same logic as the constraint

_is_valid

  • Same logic as the constraint

_transform

  • Same logic as the constraint

_reverse_transform

  • Same logic as the constraint

Additional context

@frances-h frances-h added the feature request Request for a new feature label Feb 25, 2025
@fealho fealho self-assigned this Mar 4, 2025
@fealho fealho added this to the 1.18.1 milestone Mar 4, 2025
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

2 participants