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

Tests and minor fixes for "anonymize_database.anonymize_data" function #22

Merged
merged 18 commits into from
Aug 28, 2020

Conversation

lorenz-gorini
Copy link
Member

@lorenz-gorini lorenz-gorini commented Aug 26, 2020

"anonymize_database.anonymize_data" function fixes:

Tests:

  • Added test for "anonymize_database.anonymize_data" function.
  • Added DataFrame mock "df_with_private_info" for creating a df with some private columns and other data columns

… mocks

Added test_med_exam_col_list, test_least_nan_cols, test_contains_duplicated_features, test_show_columns_type for the related dataframewithinfo methods
….ONEHOT (to exploit the Enum that gathers the supported functions for encoding.

Added tests for "get_enc_column_from_original" and "get_original_from_enc_column" methods
Added a FeatureOperation to df_info_with_operations fixture
…s to EncodingFunctions.ONEHOT.value() , which is actually an instance since it should be the actual encoder instance used to encode the feature
…Frame

Moved some tests inside Describe_DataFraneWithInfo class
Added tests for add_operation and find_operation_in_column methods
Added fixture for creating a DataFrameWithInfo instance with previous FeatureOperation instances (already added to be found)
….ONEHOT (to exploit the Enum that gathers the supported functions for encoding.

Added tests for "get_enc_column_from_original" and "get_original_from_enc_column" methods
Added a FeatureOperation to df_info_with_operations fixture
…s to EncodingFunctions.ONEHOT.value() , which is actually an instance since it should be the actual encoder instance used to encode the feature
Added a new error exception "NotShelveFileError" to handle the case where the filename is not a file created by using shelve module.
Fixed isinstance typo
…eWithInfo instances.

Added two fixtures for creating generic files with 'shelve' module and the builtin functions.
Fixed tests after rebase.
… in the column instead of the first one only.
… fixture that may be useful to multiple test scripts
…" function.

Added and reformatted all the comments.
Modified code to drop duplicates in DataFrame (function "create_private_info_db").
Fixes undefined "df_sani" variable with the correct variable.
Added DataFrame mock "df_with_private_info" for creating a df with some private columns and other data columns
@lorenz-gorini lorenz-gorini force-pushed the test_anonymize_database branch from a7ba5f8 to 1df8074 Compare August 27, 2020 17:47
src/pd_extras/anonymize_database.py Outdated Show resolved Hide resolved
src/pd_extras/anonymize_database.py Outdated Show resolved Hide resolved
src/pd_extras/anonymize_database.py Outdated Show resolved Hide resolved
src/pd_extras/anonymize_database.py Show resolved Hide resolved
src/pd_extras/anonymize_database.py Outdated Show resolved Hide resolved
src/pd_extras/anonymize_database.py Outdated Show resolved Hide resolved
src/tests/dataframewithinfo_util.py Outdated Show resolved Hide resolved
src/tests/dataframewithinfo_util.py Outdated Show resolved Hide resolved
src/tests/integration/test_anonymize_database.py Outdated Show resolved Hide resolved
src/tests/integration/test_anonymize_database.py Outdated Show resolved Hide resolved
@alessiamarcolini alessiamarcolini merged commit b2d9e41 into master Aug 28, 2020
@lorenz-gorini lorenz-gorini deleted the test_anonymize_database branch September 11, 2020 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants