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

Fix unique key generation #306

Closed
fealho opened this issue Jan 27, 2021 · 0 comments · Fixed by #307
Closed

Fix unique key generation #306

fealho opened this issue Jan 27, 2021 · 0 comments · Fixed by #307
Assignees
Labels
bug Something isn't working
Milestone

Comments

@fealho
Copy link
Member

fealho commented Jan 27, 2021

The _make_ids function in sdv/metadata/table.py fails to generate high numbers of unique values.

def _make_ids(self, name, field_metadata, length):

Error message: ValueError: Unable to generate 1519994 unique values for field drug regex "[a-z][A-Z]+"

Changes

The _make_ids function should be adapted to use the strings_from_regex function from module sdv/metadata/utils.py
The total number requested IDs should be checked against the size returned by the strings_from_regex function and a ValueError should be raised if too many values are requested
The default regex should be changed from [a-z][A-Z]+ to [a-zA-Z]+

@fealho fealho added bug Something isn't working pending review labels Jan 27, 2021
@csala csala added this to the 0.6.2 milestone Jan 27, 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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants