Skip to content
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

Workaround broken test from pyarrow #8634

Merged
merged 1 commit into from
Jan 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions xarray/tests/test_dask.py
Original file line number Diff line number Diff line change
Expand Up @@ -802,15 +802,15 @@
assert isinstance(actual, dd.DataFrame)

# use the .equals from pandas to check dataframes are equivalent
assert_frame_equal(expected.compute(), actual.compute())
assert_frame_equal(actual.compute(), expected.compute())

# test if no index is given
expected = dd.from_pandas(expected_pd.reset_index(drop=False), chunksize=4)

actual = ds.to_dask_dataframe(set_index=False)

assert isinstance(actual, dd.DataFrame)
assert_frame_equal(expected.compute(), actual.compute())
assert_frame_equal(actual.compute(), expected.compute())

def test_to_dask_dataframe_2D(self):
# Test if 2-D dataset is supplied
Expand All @@ -830,7 +830,11 @@
actual = ds.to_dask_dataframe(set_index=False)

assert isinstance(actual, dd.DataFrame)
assert_frame_equal(expected, actual.compute())
# TOOD: not sure if this is the correct behavior, but currently pandas with
# pyarrow installed will return a `string[pyarrow]` type, so matching that until
# we can fix the underlying issue
expected["y"] = expected["y"].astype("string[pyarrow]")

Check failure on line 836 in xarray/tests/test_dask.py

View workflow job for this annotation

GitHub Actions / ubuntu-latest py3.9 min-all-deps

TestToDaskDataFrame.test_to_dask_dataframe_2D ImportError: pyarrow>=1.0.0 is required for PyArrow backed StringArray.

Check failure on line 836 in xarray/tests/test_dask.py

View workflow job for this annotation

GitHub Actions / ubuntu-latest py3.12

TestToDaskDataFrame.test_to_dask_dataframe_2D ImportError: pyarrow>=10.0.1 is required for PyArrow backed StringArray.

Check failure on line 836 in xarray/tests/test_dask.py

View workflow job for this annotation

GitHub Actions / macos-latest py3.12

TestToDaskDataFrame.test_to_dask_dataframe_2D ImportError: pyarrow>=10.0.1 is required for PyArrow backed StringArray.
assert_frame_equal(actual.compute(), expected)

@pytest.mark.xfail(raises=NotImplementedError)
def test_to_dask_dataframe_2D_set_index(self):
Expand Down Expand Up @@ -875,7 +879,7 @@

actual = ds.to_dask_dataframe(set_index=True)
assert isinstance(actual, dd.DataFrame)
assert_frame_equal(expected, actual.compute())

Check failure on line 882 in xarray/tests/test_dask.py

View workflow job for this annotation

GitHub Actions / ubuntu-latest py3.9

TestToDaskDataFrame.test_to_dask_dataframe_not_daskarray AssertionError: DataFrame.index are different Attribute "dtype" are different [left]: object [right]: string[pyarrow]

Check failure on line 882 in xarray/tests/test_dask.py

View workflow job for this annotation

GitHub Actions / ubuntu-latest py3.10 flaky

TestToDaskDataFrame.test_to_dask_dataframe_not_daskarray AssertionError: DataFrame.index are different Attribute "dtype" are different [left]: object [right]: string[pyarrow]

Check failure on line 882 in xarray/tests/test_dask.py

View workflow job for this annotation

GitHub Actions / ubuntu-latest py3.11

TestToDaskDataFrame.test_to_dask_dataframe_not_daskarray AssertionError: DataFrame.index are different Attribute "dtype" are different [left]: object [right]: string[pyarrow]

Check failure on line 882 in xarray/tests/test_dask.py

View workflow job for this annotation

GitHub Actions / macos-latest py3.9

TestToDaskDataFrame.test_to_dask_dataframe_not_daskarray AssertionError: DataFrame.index are different Attribute "dtype" are different [left]: object [right]: string[pyarrow]

Check failure on line 882 in xarray/tests/test_dask.py

View workflow job for this annotation

GitHub Actions / macos-latest py3.11

TestToDaskDataFrame.test_to_dask_dataframe_not_daskarray AssertionError: DataFrame.index are different Attribute "dtype" are different [left]: object [right]: string[pyarrow]

def test_to_dask_dataframe_no_coordinate(self):
x = da.from_array(np.random.randn(10), chunks=4)
Expand Down
Loading