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

Update HyperTransformer API #298

Closed
amontanez24 opened this issue Oct 18, 2021 · 2 comments
Closed

Update HyperTransformer API #298

amontanez24 opened this issue Oct 18, 2021 · 2 comments
Assignees
Labels
feature request Request for a new feature
Milestone

Comments

@amontanez24
Copy link
Contributor

amontanez24 commented Oct 18, 2021

The following name changes should be made for the HyperTransformer API

  1. field_typesfield_data_types
    • This is a more accurate description of what the dictionary represents, and more consistent with data_type_transformers.
  2. data_type_transformersdefault_data_type_transformers
    • This suggestion is to make it more clear that this will only be updating the default transformer for a data type if no transformer is specified for a field.

The following methods should be added:

  1. update_field_data_types(field_data_types)

    • This method allows users to directly updatethe field_data_types dict.
    • field_data_types is the same format as the dict as in the initialization. It maps column names or tuples of column names to a data type.
  2. get_field_data_types()

    • This method returns the field_data_types dict.
  3. get_field_transformer_sequence(field_name)

    • This method would return a “pretty printed” version of the sequence of transformers for a field.
  4. set_field_transformer_sequence(field_transformers_sequence)

    • This method would allow a user to set the full sequence for a field.
    • field_transformers_sequence will be a dictionary matching the format of the current field_transformers dict ({full_field_name → transformer,...})
  5. set_first_transformers_for_fields(field_transformers)

    • Method allowing users to set the initial transformer for different fields
    • field_transformers will be a dict mapping field names to the initial transformer to use for the sequence.
  6. set_last_field_transformer(last_field_transformers)

    • Method allowing users to set the final transformer for a field’s sequence
    • last_field_transformers will be a dict mapping field names to the final transformer to use in the sequence
  7. get_default_data_type_transformers()

    • Method that pretty prints the default transformers for every data type
  8. update_default_data_type_transformers(data_type_transformers)

    • Method allowing users to update the data_type_transformers dict
    • data_type_transformers will be a dict mapping data types to transformers. This will update the dict created during initialization, not overwrite it.
@amontanez24 amontanez24 added feature request Request for a new feature pending review labels Oct 18, 2021
@amontanez24
Copy link
Contributor Author

@kveerama @csala
Please take a look at these proposed changes to make sure we are all in agreement. I am particularly interested in if any of these should be moved to a separate issue and handled later.

@amontanez24
Copy link
Contributor Author

I think we will do the name changes and the getter/setter methods in this issue. The more complex changes will be moved to another issue. Those are:

  1. get_field_transformer_sequence(field_name)
  2. set_field_transformer_sequence(field_transformers_sequence)
  3. set_last_field_transformer(last_field_transformers)

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

No branches or pull requests

1 participant