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

ColumnFormula raises ConstraintsNotMetError when checking NaN values #593

Closed
npatki opened this issue Sep 17, 2021 · 0 comments · Fixed by #601
Closed

ColumnFormula raises ConstraintsNotMetError when checking NaN values #593

npatki opened this issue Sep 17, 2021 · 0 comments · Fixed by #601
Assignees
Labels
bug Something isn't working feature:constraints Related to inputting rules or business logic
Milestone

Comments

@npatki
Copy link
Contributor

npatki commented Sep 17, 2021

Environment Details

  • SDV version: 0.12.0

Error Description

I have written a ColumnFormula constraint that I know is correct. (I have used it on the real data and confirmed it outputs the same values.)

However, whenever I apply it to my model, I get an error: ConstraintsNotMetError: Data is not valid for the given constraints. Upon closer inspection, I think it's because:

  • My ColumnFormula will sometimes output NaN values (for eg. [1, 2, NaN, 2, 3, NaN, NaN]) -- same values exist in my real data
  • The SDV is using a simple == to check equivalence (ref). Since NaN != NaN, it thinks my formula's output is invalid.

Expected Outcome

I expect the ColumnFormula should consider NaN == NaN for the purposes of validity.
Can we use some sort of other check here to ensure that the formula passes when it includes NaNs?

@npatki npatki added bug Something isn't working pending review labels Sep 17, 2021
@kveerama kveerama added the feature:constraints Related to inputting rules or business logic label Sep 19, 2021
@katxiao katxiao self-assigned this Sep 21, 2021
@katxiao katxiao added this to the 0.12.1 milestone Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature:constraints Related to inputting rules or business logic
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants