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

UniqueCombinations constraint on only one column gets stuck in an infinite loop #509

Closed
fealho opened this issue Jul 12, 2021 · 0 comments · Fixed by #539
Closed

UniqueCombinations constraint on only one column gets stuck in an infinite loop #509

fealho opened this issue Jul 12, 2021 · 0 comments · Fixed by #539
Assignees
Labels
bug Something isn't working
Milestone

Comments

@fealho
Copy link
Member

fealho commented Jul 12, 2021

Using the UniqueCombinations constraint on only one column gets stuck in an infinite loop. This can be fixed by validating the constraint inputs, since the reason for the crash is that UniqueCombinations requires at least two column as input.

Code to reproduce the error:

import pandas as pd
from sdv.constraints import *
from sdv.tabular import *

zero_to_nine = [i for i in range(10)]
data = pd.DataFrame({
    'a': zero_to_nine,
    'b': zero_to_nine,
    'c': zero_to_nine
})

constraint = UniqueCombinations(
    columns=['a'],
)

model = CTGAN(constraints=[constraint])
model.fit(data)
@fealho fealho added bug Something isn't working pending review labels Jul 12, 2021
@katxiao katxiao self-assigned this Aug 2, 2021
@csala csala added this to the 0.12.0 milestone Aug 3, 2021
@csala csala closed this as completed in #539 Aug 3, 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.

3 participants