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

Improve user warnings and logic for remove_transformers and remove_transformers_by_sdtype #686

Closed
amontanez24 opened this issue Aug 16, 2023 · 0 comments · Fixed by #710
Closed
Assignees
Labels
feature request Request for a new feature
Milestone

Comments

@amontanez24
Copy link
Contributor

Problem Description

As a user, I want to be able to remove transformers from columns even if they are part of a multi_column transformer. The other columns should still go through that transformer.

Expected behavior

remove_transformers

  • When removing a transformer for a column, if that column is assigned to a multi-column transformer, assign its transformer to None, but leave the other columns.
# before
>>> ht.get_config()
{
  'sdtypes': {
    'A': 'city',
    'B': 'state',
    'C': 'country'
  },
  'transformers': {
    ('A', 'B', 'C'): RandomLocationGenerator()
  }
}

# removing one of the columns in this transformer
>>> ht.remove_transformers(column_names=['A'])
>>> ht.get_config()
{
  'sdtypes': {
    'A': 'city',
    'B': 'state',
    'C': 'country'
  },
  'transformers': {
    'A': None,
    ('B', 'C'): RandomLocationGenerator()
  }
}

remove_transformers_by_sdtype

This works similarly to remove_transformers() but for all matching columns

# before
>>> ht.get_config()
{
  'sdtypes': {
    'A': 'city',
    'B': 'state',
    'C': 'country'
  },
  'transformers': {
    ('A', 'B', 'C'): RandomLocationGenerator()
  }
}
>>> ht.remove_transformers_by_sdtype(
      sdtype='city', transformer='AnonymizedFaker')
>>> ht.get_config()
{
  'sdtypes': {
    'A': 'city',
    'B': 'state',
    'C': 'country'
  },
  'transformers': {
    'A': None,
    ('B', 'C'): RandomLocationGenerator()
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request for a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants