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

Make Unique constraint works with nans #797

Closed
amontanez24 opened this issue May 17, 2022 · 0 comments · Fixed by #799
Closed

Make Unique constraint works with nans #797

amontanez24 opened this issue May 17, 2022 · 0 comments · Fixed by #799
Assignees
Labels
feature request Request for a new feature
Milestone

Comments

@amontanez24
Copy link
Contributor

amontanez24 commented May 17, 2022

Problem Description

As a user, it is confusing and inconvenient when my Unique constraint fails validation because of missing values.

Currently

  • missing values are treated as unique values in the single column case
  • missing values cause failure 100% of the time in the multi column case

We want to make the behavior for the Unique constraint consistent in both cases when handling missing values.

Expected behavior

We should treat missing values (np.nan, None, etc.) as a unique category/value. Consider the following cases:

Should PASS → YES (right now this fails)

Col1		Col2
A		NaN
NaN		B
C		D
NaN		NaN

Should this pass? → NO

Col1	
A		
NaN	
C	
NaN

Should this pass? – NO

Col1		Col2
A		NaN
A		NaN
NaN		B
C		D
NaN		NaN

Should this pass? – NO

Col1		Col2
A		NaN
NaN		B
C		D
NaN		NaN
NaN		NaN

Currently all these cases will fail validation, but the first one should pass

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

Successfully merging a pull request may close this issue.

2 participants