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

Function test_interchange_protocol

dask/dataframe/dask_expr/tests/test_interchange.py:12–20  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10
11
12def test_interchange_protocol():
13 pdf = pd.DataFrame({"a": [1, 2, 3], "b": 1})
14 df = from_pandas(pdf, npartitions=2)
15 df_int = df.__dataframe__()
16 pd.testing.assert_index_equal(pdf.columns, df_int.column_names())
17 assert df_int.num_columns() == 2
18 assert df_int.num_rows() == 3
19 column = df_int.get_columns()[0]
20 assert column.dtype()[0] == DtypeKind.INT

Callers

nothing calls this directly

Calls 7

from_pandasFunction · 0.90
__dataframe__Method · 0.80
column_namesMethod · 0.80
num_columnsMethod · 0.80
get_columnsMethod · 0.80
num_rowsMethod · 0.45
dtypeMethod · 0.45

Tested by

no test coverage detected