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

Updated null stats tests to include data initialized in setUpClass #898

Closed
wants to merge 2 commits into from

Conversation

jacob-buehler
Copy link
Contributor

Updated null stats tests to include data initialized in setUpClass function

@CLAassistant
Copy link

CLAassistant commented Jun 22, 2023

CLA assistant check
All committers have signed the CLA.

@taylorfturner taylorfturner enabled auto-merge (squash) June 22, 2023 15:37
Comment on lines -37 to +36
from . import utils as test_utils
from dataprofiler.tests.profilers import utils as test_utils
Copy link
Contributor

Choose a reason for hiding this comment

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

why did this need to change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the original line didn't import utils properly on my local, but the new line imports it consistently

Copy link
Contributor

Choose a reason for hiding this comment

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

That might be bc the test was run from the dir as opposed to base of repo. I think here we are trying to separate from test vs in lib by using relative. but open to convo if we need a change here.

Comment on lines 3605 to 3606
# file_path = os.path.join(test_root_path, "data", "csv/empty_rows.txt")
# data = pd.read_csv(file_path)
Copy link
Contributor

Choose a reason for hiding this comment

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

is this needed?

Comment on lines 3622 to 3635
# I commented out these lines of code, because they are a second
# test of the functions tested in the last four lines of code.
# Since we intend to use only the setUpClass data, there is no
# reason to keep these in, or test those functions a second time.

# file_path = os.path.join(test_root_path, "data", "csv/iris-with-null-rows.csv")
# data = pd.read_csv(file_path)
# data = self.data

# profile = dp.StructuredProfiler(data, options=profiler_options)
# self.assertEqual(13, profile.row_has_null_count)
# self.assertEqual(13 / 24, profile._get_row_has_null_ratio())
# self.assertEqual(3, profile.row_is_null_count)
# self.assertEqual(3 / 24, profile._get_row_is_null_ratio())
Copy link
Contributor

Choose a reason for hiding this comment

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

i'd recommend either deleting or keeping -- not just keeping commented out code in the file

@@ -3646,35 +3665,39 @@ def test_null_in_file(self):
"row_statistics.is_enabled": True,
}
)
data = dp.Data(filename_null_in_file)
# data = dp.Data(filename_null_in_file)
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need to keep commented out?

Comment on lines +3674 to +3675
names_idx = report["global_stats"]["profile_schema"]["names"][0]
numbers_idx = report["global_stats"]["profile_schema"]["numbers"][0]
Copy link
Contributor

Choose a reason for hiding this comment

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

changing becuase of new dataset

Comment on lines 3688 to 3698
# data = [
# ["test1", 1.0],
# ["test2", 2.0],
# ["test3", 3.0],
# [None, None],
# ["test5", 5.0],
# ["test6", 6.0],
# [None, None],
# ["test7", 7.0],
# ]
# data = pd.DataFrame(data, columns=["NAME", "VALUE"])
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above on commented out code

Comment on lines 3746 to 3751
# data = pd.DataFrame(
# {
# "full": [1, 2, 3, 4, 5, 6, 7, 8, 9],
# "sparse": [1, None, 3, None, 5, None, 7, None, 9],
# }
# )
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above

Comment on lines 3772 to 3777
# data2 = pd.DataFrame(
# {
# "sparse": [1, None, 3, None, 5, None, 7, None],
# "sparser": [1, None, None, None, None, None, None, 8],
# }
# )
Copy link
Contributor

Choose a reason for hiding this comment

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

same

Comment on lines 3814 to 3817
# self.assertSetEqual({}, profile._profile[0].null_types_index)
# self.assertSetEqual({}, profile._profile[1].null_types_index)
self.assertEqual({}, profile._profile[0].null_types_index)
self.assertEqual({}, profile._profile[1].null_types_index)
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this changing from a set to just assertEqual?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

to solve an issue: 'dict' has no attribute 'difference'

@taylorfturner taylorfturner added the Work In Progress Solution is being developed label Jun 22, 2023
auto-merge was automatically disabled June 22, 2023 15:55

Head branch was pushed to by a user without write access

Comment on lines -3595 to +3596
file_path = os.path.join(test_root_path, "data", "csv/empty_rows.txt")
data = pd.read_csv(file_path)
data = self.data

Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if there was intent to profile an empty csv. I'm concerned about changing the data.

Copy link
Contributor

@JGSweets JGSweets left a comment

Choose a reason for hiding this comment

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

I think we may need to take a step back here and identify the need of this PR.
Identify which tests in here are slow and work towards what we need to do to speed those up as oppose to a changing everything. I'm concerned by unifying to a single data source we are losing data variability which has intention within the structure of the data to test different cases of profiling.

@taylorfturner
Copy link
Contributor

Related to issue #866

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Work In Progress Solution is being developed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants