MCPcopy Create free account
hub / github.com/dask/dask / test_to_backend

Function test_to_backend

dask/dataframe/tests/test_dataframe.py:5136–5148  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5134
5135
5136def test_to_backend():
5137 # Test that `DataFrame.to_backend` works as expected
5138 with dask.config.set({"dataframe.backend": "pandas"}):
5139 # Start with pandas-backed data
5140 df = dd.from_dict({"a": range(10)}, npartitions=2)
5141 assert isinstance(df._meta, pd.DataFrame)
5142
5143 # Default `to_backend` shouldn't change data
5144 assert_eq(df, df.to_backend())
5145
5146 # Moving to a "missing" backend should raise an error
5147 with pytest.raises(ValueError, match="No backend dispatch registered"):
5148 df.to_backend("missing")
5149
5150
5151@pytest.mark.parametrize("func", ["max", "sum"])

Callers

nothing calls this directly

Calls 4

assert_eqFunction · 0.90
setMethod · 0.80
from_dictMethod · 0.45
to_backendMethod · 0.45

Tested by

no test coverage detected