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

pii should not be required to auto-assign faker transformers #1194

Closed
amontanez24 opened this issue Jan 27, 2023 · 0 comments
Closed

pii should not be required to auto-assign faker transformers #1194

amontanez24 opened this issue Jan 27, 2023 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@amontanez24
Copy link
Contributor

Environment Details

Please indicate the following details about the environment in which you found the bug:

  • SDV version: 1.0.0.dev
  • Python version: Any
  • Operating System: Any

Error Description

When updating the sdtype of a column to one of the non-default types, the code will crash when attempting to assign transformers. The only way to fix this is by setting pii to True explicitly, but that should be the default. In other words, the transformer should be correctly assigned even when pii is not provided in the update_column call.

Steps to reproduce

data = pd.DataFrame(data={
    'id': ['N', 'A', 'K', 'F', 'P'],
    'numerical': [1, 2, 3, 2, 1],
    'categorical': ['A', 'A', 'B', 'B', 'B']
})

metadata = SingleTableMetadata()
metadata.detect_from_dataframe(data)

metadata.update_column(
    column_name='id',
    sdtype='first_name'
)
metadata.set_primary_key('id')
s = GaussianCopulaSynthesizer(metadata)
s.auto_assign_transformers(data)

The code above should run the same as the code below

data = pd.DataFrame(data={
    'id': ['N', 'A', 'K', 'F', 'P'],
    'numerical': [1, 2, 3, 2, 1],
    'categorical': ['A', 'A', 'B', 'B', 'B']
})

metadata = SingleTableMetadata()
metadata.detect_from_dataframe(data)

metadata.update_column(
    column_name='id',
    sdtype='first_name',
    pii=True
)
metadata.set_primary_key('id')
s = GaussianCopulaSynthesizer(metadata)
s.auto_assign_transformers(data)
@amontanez24 amontanez24 added the bug Something isn't working label Jan 27, 2023
@amontanez24 amontanez24 added this to the 1.0.0 milestone Jan 27, 2023
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

No branches or pull requests

2 participants