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

Metadata auto-detection should not assign a primary key if there are NaN values in it #1740

Closed
R-Palazzo opened this issue Jan 12, 2024 · 0 comments · Fixed by #1743
Closed
Assignees
Labels
bug Something isn't working
Milestone

Comments

@R-Palazzo
Copy link
Contributor

Environment Details

  • SDV version: 1.9.0

Error Description

This snippet code is currently crashing because the email column is assigned as primary key while it has missing values

import pandas as pd
from sdv.metadata import SingleTableMetadata
from sdv.single_table import GaussianCopulaSynthesizer

data = pd.DataFrame({
    'email': ['sdv@sdv.dev', 'info@datacebo.com', 'info@gmail.co.uk', None],
    'numerical': [0, 1, 2, 1],
})

metadata = SingleTableMetadata()
metadata.detect_from_dataframe(data)
synthesizer = GaussianCopulaSynthesizer(metadata)
synthesizer.fit(data)

Expected behavior

The metadata auto-detection should not set the primary key to a column that has missing values.

@R-Palazzo R-Palazzo added bug Something isn't working new Automatic label applied to new issues labels Jan 12, 2024
@npatki npatki changed the title metadata auto-detection will not assign a primary key if there are NaN values in it Metadata auto-detection should not assign a primary key if there are NaN values in it Jan 12, 2024
@npatki npatki removed the new Automatic label applied to new issues label Jan 12, 2024
@amontanez24 amontanez24 added this to the 1.10.0 milestone Feb 8, 2024
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