-
Notifications
You must be signed in to change notification settings - Fork 26
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 cardinality_rule
parameter to AnonymizedFaker
#762
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #762 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 18 18
Lines 2031 2061 +30
=========================================
+ Hits 2031 2061 +30 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Can we add an integration test for the case cardinality_rule=match
to check that we generate the same cardinality or lower than inside the real data
@@ -474,7 +474,6 @@ def test_one_hot_categoricals(): | |||
|
|||
# Run | |||
transformed_data = transformer.fit_transform(test_data, column='A') | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we keep this blank line?
if enforce_uniqueness: | ||
warnings.warn( | ||
"The 'enforce_uniqueness' parameter is no longer supported. " | ||
"Please use the 'cardinality_rule' parameter instead.", | ||
FutureWarning | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After the warning, if self.cardinality_rule
is None
, we could set self.cardinality_rule
to 'unique'
to match the intent of enforce_uniqueness=True
. If self.cardinality_rule
isn't None
then the user definitely set both parameters and we should probably ignore enforce_uniqueness
CU-86az4dgdr, Resolve #756.