MCPcopy
hub / github.com/dask/dask / test_series_repr

Function test_series_repr

dask/dataframe/dask_expr/tests/test_format.py:99–129  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

97
98
99def test_series_repr():
100 s = pd.Series([1, 2, 3, 4, 5, 6, 7, 8], index=list("ABCDEFGH"))
101 dtype = "string" if pyarrow_strings_enabled() else "object"
102 ds = from_pandas(s, 3)
103
104 exp = dedent("""\
105 Dask Series Structure:
106 npartitions=3
107 A int64
108 D ...
109 G ...
110 H ...
111 Dask Name: frompandas, 1 expression
112 Expr=df""")
113 assert repr(ds) == exp
114
115 # Not a cheap way to determine if series is empty
116 # so does not prefix with "Empty" as we do w/ empty DataFrame
117 s = pd.Series([])
118 ds = from_pandas(s, 3)
119
120 exp = dedent(f"""\
121 Dask Series Structure:
122 npartitions=3
123 {dtype}
124 ...
125 ...
126 ...
127 Dask Name: frompandas, 1 expression
128 Expr=df""")
129 assert repr(ds) == exp
130
131
132def test_df_repr():

Callers

nothing calls this directly

Calls 2

pyarrow_strings_enabledFunction · 0.90
from_pandasFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…