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

Function test_values

dask/dataframe/dask_expr/tests/test_collection.py:1629–1651  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1627
1628
1629def test_values():
1630 from dask.array.utils import assert_eq
1631
1632 pdf = pd.DataFrame(
1633 {"x": ["a", "b", "c", "d"], "y": [2, 3, 4, 5]},
1634 index=pd.Index([1.0, 2.0, 3.0, 4.0], name="ind"),
1635 )
1636
1637 df = from_pandas(pdf, 2)
1638
1639 if pyarrow_strings_enabled() or PANDAS_GE_300:
1640 with pytest.warns(UserWarning, match="extension dtypes"):
1641 assert_eq(df.values, pdf.values)
1642 values = df.x.values
1643 if not PANDAS_GE_300:
1644 # https://github.com/dask/dask/issues/2713
1645 # dask lacks an extension array type.
1646 assert_eq(values, pdf.x.values)
1647 else:
1648 assert_eq(df.values, pdf.values)
1649 assert_eq(df.x.values, pdf.x.values)
1650 assert_eq(df.y.values, pdf.y.values)
1651 assert_eq(df.index.values, pdf.index.values)
1652
1653
1654def test_depth(df):

Callers

nothing calls this directly

Calls 3

from_pandasFunction · 0.90
pyarrow_strings_enabledFunction · 0.90
assert_eqFunction · 0.90

Tested by

no test coverage detected