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

Add a _update_multi_column_transformer method #757

Closed
R-Palazzo opened this issue Feb 1, 2024 · 0 comments · Fixed by #758
Closed

Add a _update_multi_column_transformer method #757

R-Palazzo opened this issue Feb 1, 2024 · 0 comments · Fixed by #758
Assignees
Labels
feature request Request for a new feature
Milestone

Comments

@R-Palazzo
Copy link
Contributor

R-Palazzo commented Feb 1, 2024

Problem Description

Currently, when a user calls update_transformers, he can modify any column to transformer mapping, including multi-column transformer. In this case, these changes can cause some multi-column transformers not to work (for instance, when they no longer have enough columns in their tuple).

Expected behavior

A _update_multi_column_transformer should be added to check that the new mappings are valid for the multi-columns.
For each multi-column, this method should:

  • Create a columns_to_sdtype dict based on the tuple of column
  • Validate the transformer by calling its _validate_sdtype() in a try/catch
  • If didn't crash, this means the config is valid.
  • If it crashes, the multi-column should be removed and each column should be assigned to its default transformer per sdtype. Also, a warning should be raised saying:
Userwarning: "Transformer 'RandomlocationGenerator' is incompatible with the multi-column field 'A'. Assigning default transformer to the columns."
  • Update the _multi_column_fields

Finally, this method should be called at the end of:

  • update_transformers
  • remove_transformers
  • remove_transformers_by_sdtype
  • update_sdtypes
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