From 54918d889b042fd4fa54e1fa75137ab719489dd4 Mon Sep 17 00:00:00 2001 From: GALI PREM SAGAR Date: Wed, 23 Mar 2022 19:58:25 -0500 Subject: [PATCH] Add `scipy` skip for a test (#10502) This PR skips `scipy` related code-path that pandas takes. This isn't a failure in CI, but cudf dev env doesn't require having a `scipy` package, hence adding an `importorskip`. Authors: - GALI PREM SAGAR (https://github.com/galipremsagar) Approvers: - Vyas Ramasubramani (https://github.com/vyasr) - Ashwin Srinath (https://github.com/shwina) URL: https://github.com/rapidsai/cudf/pull/10502 --- python/cudf/cudf/tests/test_stats.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/cudf/cudf/tests/test_stats.py b/python/cudf/cudf/tests/test_stats.py index a6dae25dd80..98e3b255aaf 100644 --- a/python/cudf/cudf/tests/test_stats.py +++ b/python/cudf/cudf/tests/test_stats.py @@ -423,6 +423,10 @@ def test_cov1d(data1, data2): ) @pytest.mark.parametrize("method", ["spearman", "pearson"]) def test_corr1d(data1, data2, method): + if method == "spearman": + # Pandas uses scipy.stats.spearmanr code-path + pytest.importorskip("scipy") + gs1 = cudf.Series(data1) gs2 = cudf.Series(data2)