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 RegexGenerator generate unlimited regexes even when enforce_uniqueness=True #753

Merged
merged 6 commits into from
Jan 19, 2024

Conversation

fealho
Copy link
Member

@fealho fealho commented Jan 11, 2024

CU-86ayz97gr, Resolve #749

@sdv-team
Copy link
Contributor

@fealho fealho changed the title Update logic Make RegexGenerator generate unlimited regexes when enforce_unique=True Jan 11, 2024
@fealho fealho changed the title Make RegexGenerator generate unlimited regexes when enforce_unique=True Make RegexGenerator generate unlimited regexes even when enforce_uniqueness=True Jan 11, 2024
@fealho fealho force-pushed the issue-749-regex-generator branch from d7f7302 to a66edd0 Compare January 12, 2024 17:44
@fealho fealho force-pushed the issue-749-regex-generator branch from a66edd0 to f1cc267 Compare January 17, 2024 18:55
@fealho fealho marked this pull request as ready for review January 17, 2024 20:23
@fealho fealho requested a review from a team as a code owner January 17, 2024 20:23
@fealho fealho requested review from pvk-developer, R-Palazzo and frances-h and removed request for a team and pvk-developer January 17, 2024 20:23
Copy link
Contributor

@frances-h frances-h left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just one question about messaging.

Comment on lines 195 to 196
self.reset_randomization()
remaining = self.generator_size
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just out of curiosity, why do we warn the user and request them to reset randomization if we do it here for them anyways?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

Copy link
Contributor

@R-Palazzo R-Palazzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just let one question

tests/integration/transformers/test_text.py Outdated Show resolved Hide resolved
tests/integration/transformers/test_text.py Outdated Show resolved Hide resolved

while len(reverse_transformed) < sample_size:
remaining_samples = sample_size - len(reverse_transformed)
if dtype == int:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the while boucle for the int case? It seems likely to resolve in one iteration

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I missed that.

@fealho fealho requested a review from R-Palazzo January 18, 2024 22:43
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (9f37fb4) 100.00% compared to head (4d867d9) 100.00%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #753   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           18        18           
  Lines         1960      1975   +15     
=========================================
+ Hits          1960      1975   +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@R-Palazzo R-Palazzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@fealho fealho merged commit 71a590b into main Jan 19, 2024
45 checks passed
@fealho fealho deleted the issue-749-regex-generator branch January 19, 2024 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RegexGenerator should create unlimited regexes, even if unique enforcement is on
5 participants