Repository navigation
CI Fix testing references to take into account string dtype #7830
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
Merged
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,10 +35,6 @@ def test_onehot_vs_skonehot(client): | |
|
|
||
|
|
||
| @pytest.mark.mg | ||
| @pytest.mark.xfail( | ||
| reason="Dask OneHotEncoder dtype/string issues; see https://github.com/rapidsai/cuml/issues/7826", | ||
| strict=True, | ||
| ) | ||
| @pytest.mark.parametrize( | ||
| "drop", [None, "first", {"g": Series("F"), "i": Series(3)}] | ||
| ) | ||
|
|
@@ -50,15 +46,12 @@ def test_onehot_inverse_transform(client, drop): | |
| ohe = enc.fit_transform(X) | ||
| inv = enc.inverse_transform(ohe) | ||
| assert_frame_equal( | ||
| inv.compute().to_pandas().reset_index(drop=True), df.to_pandas() | ||
| inv.compute().to_pandas().reset_index(drop=True), | ||
| X.compute().to_pandas().reset_index(drop=True), | ||
|
Contributor
Author
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.
|
||
| ) | ||
|
|
||
|
|
||
| @pytest.mark.mg | ||
| @pytest.mark.xfail( | ||
| reason="Dask OneHotEncoder dtype/string issues; see https://github.com/rapidsai/cuml/issues/7826", | ||
| strict=True, | ||
| ) | ||
| def test_onehot_categories(client): | ||
| X = DataFrame({"chars": ["a", "b"], "int": [0, 2]}) | ||
| X = dask_cudf.from_cudf(X, npartitions=2) | ||
|
|
@@ -105,10 +98,6 @@ def test_onehot_transform_handle_unknown(client): | |
|
|
||
|
|
||
| @pytest.mark.mg | ||
| @pytest.mark.xfail( | ||
| reason="Dask OneHotEncoder dtype/string issues; see https://github.com/rapidsai/cuml/issues/7826", | ||
| strict=True, | ||
| ) | ||
| def test_onehot_inverse_transform_handle_unknown(client): | ||
| X = DataFrame({"chars": ["a", "b"], "int": [0, 2]}) | ||
| X = dask_cudf.from_cudf(X, npartitions=2) | ||
|
|
@@ -119,7 +108,8 @@ def test_onehot_inverse_transform_handle_unknown(client): | |
| enc = enc.fit(X) | ||
| df = enc.inverse_transform(Y_ohe) | ||
| ref = DataFrame({"chars": [None, "b"], "int": [0, 2]}) | ||
| assert_frame_equal(df.compute().to_pandas(), ref.to_pandas()) | ||
| ref = dask_cudf.from_cudf(ref, npartitions=1).compute().to_pandas() | ||
| assert_frame_equal(df.compute().to_pandas(), ref) | ||
|
|
||
|
|
||
| @pytest.mark.mg | ||
|
|
@@ -152,10 +142,6 @@ def test_onehot_random_inputs(client, drop, as_array, sparse, n_samples): | |
|
|
||
|
|
||
| @pytest.mark.mg | ||
| @pytest.mark.xfail( | ||
| reason="Dask OneHotEncoder dtype/string issues; see https://github.com/rapidsai/cuml/issues/7826", | ||
| strict=True, | ||
| ) | ||
| def test_onehot_drop_idx_first(client): | ||
| X_ary = [["c", 2, "a"], ["b", 2, "b"]] | ||
| X = DataFrame({"chars": ["c", "b"], "int": [2, 2], "letters": ["a", "b"]}) | ||
|
|
@@ -168,15 +154,12 @@ def test_onehot_drop_idx_first(client): | |
| cp.testing.assert_array_equal(ohe.compute(), ref) | ||
| inv = enc.inverse_transform(ohe) | ||
| assert_frame_equal( | ||
| inv.compute().to_pandas().reset_index(drop=True), X.to_pandas() | ||
| inv.compute().to_pandas().reset_index(drop=True), | ||
| ddf.compute().to_pandas().reset_index(drop=True), | ||
| ) | ||
|
|
||
|
|
||
| @pytest.mark.mg | ||
| @pytest.mark.xfail( | ||
| reason="Dask OneHotEncoder dtype/string issues; see https://github.com/rapidsai/cuml/issues/7826", | ||
| strict=True, | ||
| ) | ||
| def test_onehot_drop_one_of_each(client): | ||
| X_ary = [["c", 2, "a"], ["b", 2, "b"]] | ||
| X = DataFrame({"chars": ["c", "b"], "int": [2, 2], "letters": ["a", "b"]}) | ||
|
|
@@ -190,7 +173,8 @@ def test_onehot_drop_one_of_each(client): | |
| cp.testing.assert_array_equal(ohe.compute(), ref) | ||
| inv = enc.inverse_transform(ohe) | ||
| assert_frame_equal( | ||
| inv.compute().to_pandas().reset_index(drop=True), X.to_pandas() | ||
| inv.compute().to_pandas().reset_index(drop=True), | ||
| ddf.compute().to_pandas().reset_index(drop=True), | ||
| ) | ||
|
|
||
|
|
||
|
|
@@ -199,14 +183,10 @@ def test_onehot_drop_one_of_each(client): | |
| "drop, pattern", | ||
| [ | ||
| [dict({"chars": "b"}), "`drop` should have as many columns"], | ||
| pytest.param( | ||
| [ | ||
| dict({"chars": "b", "int": [2, 0]}), | ||
| "Trying to drop multiple values", | ||
| marks=pytest.mark.xfail( | ||
| reason="Dask OneHotEncoder dtype/string issues; see https://github.com/rapidsai/cuml/issues/7826", | ||
| strict=True, | ||
| ), | ||
| ), | ||
| ], | ||
| [ | ||
| dict({"chars": "b", "int": 3}), | ||
| "Some categories [a-zA-Z, ]* were not found", | ||
|
|
@@ -226,10 +206,6 @@ def test_onehot_drop_exceptions(client, drop, pattern): | |
|
|
||
|
|
||
| @pytest.mark.mg | ||
| @pytest.mark.xfail( | ||
| reason="Dask OneHotEncoder dtype/string issues; see https://github.com/rapidsai/cuml/issues/7826", | ||
| strict=True, | ||
| ) | ||
| def test_onehot_get_categories(client): | ||
| X = DataFrame({"chars": ["c", "b", "d"], "ints": [2, 1, 0]}) | ||
| X = dask_cudf.from_cudf(X, npartitions=2) | ||
|
|
@@ -239,4 +215,4 @@ def test_onehot_get_categories(client): | |
| cats = enc.categories_ | ||
|
|
||
| for i in range(len(ref)): | ||
| np.testing.assert_array_equal(ref[i], cats[i].to_numpy()) | ||
| np.testing.assert_array_equal(ref[i], cats[i].to_pandas().to_numpy()) | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.