You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Seems like this _apply_mapping is actually doing 2 things: first it filters a dataframe, and then renames the columns. Eg. if we have a filter + mapping dict like this: {"my_col": "my_new_col_name"} and a df with 2 columns, "my_col" and "my_other_col", after applying this function, we'd get a df with 1 column, "my_new_col_name".
So I guess this function is confusing for 3 reasons:
it does 2 things
the naming is misleading, as it only mentions one of the two things it's doing
the docstring doesn't explain what this func is doing, ony uses a generic term "applies mapping"
So it should probably be split into 2 functions or just native dataframe functions used (filtering a df and renaming columns are done with a single line of code in core pandas, so it's likely wrappers are not needed).
Check if
_apply_user_mapping()
is needed and if possible replace it withdf.rename(columns=mapping_dict)
.api_connection()
should be refactored intoto_records()
or just included as part ofto_df()
add unit tests
#1053 (comment)
The text was updated successfully, but these errors were encountered: