MCPcopy
hub / github.com/dask/dask / test_values

Function test_values

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

Source from the content-addressed store, hash-verified

1573
1574
1575def test_values():
1576 from dask.array.utils import assert_eq
1577
1578 pdf = pd.DataFrame(
1579 {"x": ["a", "b", "c", "d"], "y": [2, 3, 4, 5]},
1580 index=pd.Index([1.0, 2.0, 3.0, 4.0], name="ind"),
1581 )
1582
1583 df = from_pandas(pdf, 2)
1584
1585 if pyarrow_strings_enabled() or PANDAS_GE_300:
1586 with pytest.warns(UserWarning, match="extension dtypes"):
1587 assert_eq(df.values, pdf.values)
1588 values = df.x.values
1589 if not PANDAS_GE_300:
1590 # https://github.com/dask/dask/issues/2713
1591 # dask lacks an extension array type.
1592 assert_eq(values, pdf.x.values)
1593 else:
1594 assert_eq(df.values, pdf.values)
1595 assert_eq(df.x.values, pdf.x.values)
1596 assert_eq(df.y.values, pdf.y.values)
1597 assert_eq(df.index.values, pdf.index.values)
1598
1599
1600def 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

Used in the wild real call sites across dependent graphs

searching dependent graphs…