From 131c023385dc59b14a98c3f28507082e8fdcb3ce Mon Sep 17 00:00:00 2001 From: Maximilian Roos <5635139+max-sixty@users.noreply.github.com> Date: Sun, 21 Jan 2024 13:42:21 -0800 Subject: [PATCH] xfail another dask/pyarrow test (#8636) * xfail another dask/pyarrow test Unsure why this wasn't showing prior -- having tests fail in the good state does make it much more difficult to ensure everything is fixed before merging. --- xarray/core/utils.py | 7 ++++++- xarray/tests/test_dask.py | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/xarray/core/utils.py b/xarray/core/utils.py index 3bbf06cf967..9da937b996e 100644 --- a/xarray/core/utils.py +++ b/xarray/core/utils.py @@ -1248,7 +1248,12 @@ def find_stack_level(test_mode=False) -> int: pkg_dir = Path(xr.__file__).parent test_dir = pkg_dir / "tests" - std_lib_dir = Path(sys.modules["os"].__file__).parent # Standard library path + std_lib_init = sys.modules["os"].__file__ + # Mostly to appease mypy; I don't think this can happen... + if std_lib_init is None: + return 0 + + std_lib_dir = Path(std_lib_init).parent frame = inspect.currentframe() n = 0 diff --git a/xarray/tests/test_dask.py b/xarray/tests/test_dask.py index 7d80ad01b17..d384d6a07fa 100644 --- a/xarray/tests/test_dask.py +++ b/xarray/tests/test_dask.py @@ -867,6 +867,10 @@ def test_to_dask_dataframe_coordinates(self): assert isinstance(actual, dd.DataFrame) assert_frame_equal(expected.compute(), actual.compute()) + @pytest.mark.xfail( + reason="Currently pandas with pyarrow installed will return a `string[pyarrow]` type, " + "which causes the index to have a different type depending on whether pyarrow is installed" + ) def test_to_dask_dataframe_not_daskarray(self): # Test if DataArray is not a dask array x = np.random.randn(10)