-
Notifications
You must be signed in to change notification settings - Fork 915
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
Reduce pytest runtime #10203
Reduce pytest runtime #10203
Changes from 18 commits
4d7ae60
1f9e36d
70932d5
b94cce4
67e3994
e05d8bc
f367e01
9e37504
d298d4a
6e9a0ef
e4a98d0
289a13b
2e25ed2
9393bd0
a20102e
9c800cd
025c69d
60a0a92
6128b2a
227be3c
ecdb986
e3b6500
62d56be
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6670,7 +6670,6 @@ def test_dataframe_info_null_counts(): | |
"data1", | ||
[ | ||
[1, 2, 3, 4, 5, 6, 7], | ||
[1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0], | ||
[ | ||
1.9876543, | ||
2.9876654, | ||
|
@@ -6689,31 +6688,12 @@ def test_dataframe_info_null_counts(): | |
-6.88918237, | ||
-7.00001, | ||
], | ||
[ | ||
1.987654321, | ||
2.987654321, | ||
3.987654321, | ||
0.1221, | ||
2.1221, | ||
0.112121, | ||
-21.1212, | ||
], | ||
[ | ||
-1.987654321, | ||
-2.987654321, | ||
-3.987654321, | ||
-0.1221, | ||
-2.1221, | ||
-0.112121, | ||
21.1212, | ||
], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here I am just deleting tests that might be redundant. I am basing this off the assumption that all these different sets of numbers are not really increasing test coverage. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For some values of rtol and atol, the deleted values seem to be testing the behavior of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AFAICT the these tests were only covering There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, I wasn't very clear. The issue isn't really about data types. It's about the rtol / atol precision requiring If you look at the I agree that this test is grossly over-parametrized, but the deletions here are removing an important case to check. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's just undo these changes and add a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree that would be good. I can file an issue describing what I've discussed with @brandon-b-miller via Slack. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good to me. Thank you, Bradley! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Issue #10284 filed. I can put this in my backlog of things to do, or I can help someone else construct the specific cases I have in mind for test coverage. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change has been reverted |
||
], | ||
) | ||
@pytest.mark.parametrize( | ||
"data2", | ||
[ | ||
[1, 2, 3, 4, 5, 6, 7], | ||
[1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0], | ||
[ | ||
1.9876543, | ||
2.9876654, | ||
|
@@ -6732,24 +6712,6 @@ def test_dataframe_info_null_counts(): | |
-6.88918237, | ||
-7.00001, | ||
], | ||
[ | ||
1.987654321, | ||
2.987654321, | ||
3.987654321, | ||
0.1221, | ||
2.1221, | ||
0.112121, | ||
-21.1212, | ||
], | ||
[ | ||
-1.987654321, | ||
-2.987654321, | ||
-3.987654321, | ||
-0.1221, | ||
-2.1221, | ||
-0.112121, | ||
21.1212, | ||
], | ||
], | ||
) | ||
@pytest.mark.parametrize("rtol", [0, 0.01, 1e-05, 1e-08, 5e-1, 50.12]) | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,4 +1,4 @@ | ||||||||||||||||||
# Copyright (c) 2021, NVIDIA CORPORATION. | ||||||||||||||||||
# Copyright (c) 2021-2022, NVIDIA CORPORATION. | ||||||||||||||||||
|
||||||||||||||||||
from itertools import combinations | ||||||||||||||||||
|
||||||||||||||||||
|
@@ -1292,45 +1292,43 @@ def test_loc_datetime_index(sli, is_dataframe): | |||||||||||||||||
|
||||||||||||||||||
|
||||||||||||||||||
@pytest.mark.parametrize( | ||||||||||||||||||
bdice marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||
"gdf", | ||||||||||||||||||
"gdf_kwargs", | ||||||||||||||||||
[ | ||||||||||||||||||
cudf.DataFrame({"a": range(1000000)}), | ||||||||||||||||||
cudf.DataFrame({"a": range(1000000), "b": range(1000000)}), | ||||||||||||||||||
cudf.DataFrame({"a": range(20), "b": range(20)}), | ||||||||||||||||||
cudf.DataFrame( | ||||||||||||||||||
{ | ||||||||||||||||||
{"data": {"a": range(100000)}}, | ||||||||||||||||||
{"data": {"a": range(100000), "b": range(100000)}}, | ||||||||||||||||||
{ | ||||||||||||||||||
"data": { | ||||||||||||||||||
"a": range(20), | ||||||||||||||||||
"b": range(20), | ||||||||||||||||||
"c": ["abc", "def", "xyz", "def", "pqr"] * 4, | ||||||||||||||||||
} | ||||||||||||||||||
), | ||||||||||||||||||
cudf.DataFrame(index=[1, 2, 3]), | ||||||||||||||||||
cudf.DataFrame(index=range(1000000)), | ||||||||||||||||||
cudf.DataFrame(columns=["a", "b", "c", "d"]), | ||||||||||||||||||
cudf.DataFrame(columns=["a"], index=range(1000000)), | ||||||||||||||||||
cudf.DataFrame( | ||||||||||||||||||
columns=["a", "col2", "...col n"], index=range(1000000) | ||||||||||||||||||
), | ||||||||||||||||||
cudf.DataFrame(index=cudf.Series(range(1000000)).astype("str")), | ||||||||||||||||||
cudf.DataFrame( | ||||||||||||||||||
columns=["a", "b", "c", "d"], | ||||||||||||||||||
index=cudf.Series(range(1000000)).astype("str"), | ||||||||||||||||||
), | ||||||||||||||||||
}, | ||||||||||||||||||
{"index": [1, 2, 3]}, | ||||||||||||||||||
{"index": range(100000)}, | ||||||||||||||||||
{"columns": ["a", "b", "c", "d"]}, | ||||||||||||||||||
{"columns": ["a"], "index": range(100000)}, | ||||||||||||||||||
{"columns": ["a", "col2", "...col n"], "index": range(100000)}, | ||||||||||||||||||
{"index": cudf.Series(range(100000)).astype("str")}, | ||||||||||||||||||
{ | ||||||||||||||||||
"columns": ["a", "b", "c", "d"], | ||||||||||||||||||
"index": cudf.Series(range(100000)).astype("str"), | ||||||||||||||||||
}, | ||||||||||||||||||
], | ||||||||||||||||||
) | ||||||||||||||||||
@pytest.mark.parametrize( | ||||||||||||||||||
"slice", | ||||||||||||||||||
[ | ||||||||||||||||||
slice(250000, 500000), | ||||||||||||||||||
slice(250000, 250001), | ||||||||||||||||||
slice(500000), | ||||||||||||||||||
slice(25000, 50000), | ||||||||||||||||||
slice(25000, 25001), | ||||||||||||||||||
slice(50000), | ||||||||||||||||||
slice(1, 10), | ||||||||||||||||||
slice(10, 20), | ||||||||||||||||||
slice(15, 24000), | ||||||||||||||||||
slice(6), | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we're testing multiple combinations, we should have coverage of unique code paths: three-argument slices like
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried some of these and we actually get multiple failures with these. Raising an issue now There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Glad I could help catch a bug here. Please tag me in that issue, I'm interested in seeing what you found. Slice all the things! 🥷⚔️🥷 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. raised #10292 |
||||||||||||||||||
], | ||||||||||||||||||
) | ||||||||||||||||||
def test_dataframe_sliced(gdf, slice): | ||||||||||||||||||
def test_dataframe_sliced(gdf_kwargs, slice): | ||||||||||||||||||
gdf = cudf.DataFrame(**gdf_kwargs) | ||||||||||||||||||
pdf = gdf.to_pandas() | ||||||||||||||||||
|
||||||||||||||||||
actual = gdf[slice] | ||||||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1105,9 +1105,9 @@ def test_parquet_reader_list_large_multi_rowgroup_nulls(tmpdir): | |
assert_eq(expect, got) | ||
|
||
|
||
@pytest.mark.parametrize("skip", range(0, 128)) | ||
@pytest.mark.parametrize("skip", [0, 1, 5, 10]) | ||
def test_parquet_reader_list_skiprows(skip, tmpdir): | ||
num_rows = 128 | ||
num_rows = 10 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here I reason that that if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe even replace |
||
src = pd.DataFrame( | ||
{ | ||
"a": list_gen(int_gen, 0, num_rows, 80, 50), | ||
|
@@ -1124,9 +1124,9 @@ def test_parquet_reader_list_skiprows(skip, tmpdir): | |
assert_eq(expect, got, check_dtype=False) | ||
|
||
|
||
@pytest.mark.parametrize("skip", range(0, 120)) | ||
@pytest.mark.parametrize("skip", [0, 1, 5, 10]) | ||
def test_parquet_reader_list_num_rows(skip, tmpdir): | ||
num_rows = 128 | ||
num_rows = 20 | ||
src = pd.DataFrame( | ||
{ | ||
"a": list_gen(int_gen, 0, num_rows, 80, 50), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?