From 75e9804948d3a140b5150bbbd2710d0b6c668af8 Mon Sep 17 00:00:00 2001 From: Abdulaziz Aloqeely <52792999+Aloqeely@users.noreply.github.com> Date: Fri, 14 Jun 2024 15:19:42 +0300 Subject: [PATCH 1/2] CI: xfail test_to_xarray_index_types only on v2024.5 --- pandas/tests/generic/test_to_xarray.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/tests/generic/test_to_xarray.py b/pandas/tests/generic/test_to_xarray.py index 491f621783a76..ed786f17d06ea 100644 --- a/pandas/tests/generic/test_to_xarray.py +++ b/pandas/tests/generic/test_to_xarray.py @@ -37,7 +37,7 @@ def test_to_xarray_index_types(self, index_flat, df, using_infer_string, request pytest.skip("Test doesn't make sense for empty index") import xarray - if Version(xarray.__version__) >= Version("2024.5"): + if Version(xarray.__version__) == Version("2024.5"): request.applymarker( pytest.mark.xfail(reason="https://github.com/pydata/xarray/issues/9026") ) From c72543b9940d193ecb150b4edef28733b6786683 Mon Sep 17 00:00:00 2001 From: Abdulaziz Aloqeely <52792999+Aloqeely@users.noreply.github.com> Date: Fri, 14 Jun 2024 19:54:03 +0300 Subject: [PATCH 2/2] Remove xfail --- pandas/tests/generic/test_to_xarray.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/pandas/tests/generic/test_to_xarray.py b/pandas/tests/generic/test_to_xarray.py index ed786f17d06ea..d8401a8b2ae3f 100644 --- a/pandas/tests/generic/test_to_xarray.py +++ b/pandas/tests/generic/test_to_xarray.py @@ -9,7 +9,6 @@ date_range, ) import pandas._testing as tm -from pandas.util.version import Version pytest.importorskip("xarray") @@ -30,17 +29,11 @@ def df(self): } ) - def test_to_xarray_index_types(self, index_flat, df, using_infer_string, request): + def test_to_xarray_index_types(self, index_flat, df, using_infer_string): index = index_flat # MultiIndex is tested in test_to_xarray_with_multiindex if len(index) == 0: pytest.skip("Test doesn't make sense for empty index") - import xarray - - if Version(xarray.__version__) == Version("2024.5"): - request.applymarker( - pytest.mark.xfail(reason="https://github.com/pydata/xarray/issues/9026") - ) from xarray import Dataset