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

Function test_values

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

Source from the content-addressed store, hash-verified

1585
1586
1587def test_values():
1588 from dask.array.utils import assert_eq
1589
1590 pdf = pd.DataFrame(
1591 {"x": ["a", "b", "c", "d"], "y": [2, 3, 4, 5]},
1592 index=pd.Index([1.0, 2.0, 3.0, 4.0], name="ind"),
1593 )
1594
1595 df = from_pandas(pdf, 2)
1596
1597 if pyarrow_strings_enabled() or PANDAS_GE_300:
1598 with pytest.warns(UserWarning, match="extension dtypes"):
1599 assert_eq(df.values, pdf.values)
1600 values = df.x.values
1601 if not PANDAS_GE_300:
1602 # https://github.com/dask/dask/issues/2713
1603 # dask lacks an extension array type.
1604 assert_eq(values, pdf.x.values)
1605 else:
1606 assert_eq(df.values, pdf.values)
1607 assert_eq(df.x.values, pdf.x.values)
1608 assert_eq(df.y.values, pdf.y.values)
1609 assert_eq(df.index.values, pdf.index.values)
1610
1611
1612def 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