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

DataProfiler: hotfix for handling nan values in diff #647

Merged
merged 3 commits into from
Sep 20, 2022

Conversation

micdavis
Copy link
Contributor

@micdavis micdavis commented Sep 20, 2022

  • find_diff_of_lists_and_sets() handles nan values now
  • tests have been created to cover the new changes

@@ -1,11 +1,10 @@
"""Contains functions for checking for installations/dependencies."""
Copy link
Contributor Author

@micdavis micdavis Sep 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file was updated from pre-commit

@taylorfturner taylorfturner enabled auto-merge (squash) September 20, 2022 14:11
@micdavis micdavis self-assigned this Sep 20, 2022
@@ -140,7 +140,7 @@ def setUpClass(cls):
"id": [
{},
{
"bin_counts": "unchanged",
"bin_counts": [[1], [1, 1, 2], []],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated outputs based on the changes made to find_diff_of_lists_and_sets(stat1, stat2)

@@ -61,7 +61,7 @@ def test_find_diff(self):

# Ensure lists and sets are handled appropriately
self.assertEqual(
"unchanged", utils.find_diff_of_lists_and_sets([3, 2], [2, 3, 2])
[[], [3, 2], [2]], utils.find_diff_of_lists_and_sets([3, 2], [2, 3, 2])
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated outputs based on the changes made to find_diff_of_lists_and_sets(stat1, stat2)

unique2 = [element for element in stat2 if element not in stat1]
diff = [unique1, shared, unique2]
elif set(stat1) != set(stat2) or len(stat1) != len(stat2):
temp_stat1 = list(copy.deepcopy(stat1))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added deepcopy but then assigned to list because testing output expects lists not sets

@taylorfturner taylorfturner merged commit 7428892 into capitalone:main Sep 20, 2022
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.

None yet

3 participants