MCPcopy
hub / github.com/dask/dask / test_series_resample

Function test_series_resample

dask/dataframe/tseries/tests/test_resample_expr.py:85–107  ·  view source on GitHub ↗
(xfail, obj, method, npartitions, freq, closed, label)

Source from the content-addressed store, hash-verified

83 ),
84)
85def test_series_resample(xfail, obj, method, npartitions, freq, closed, label):
86 if PANDAS_GE_300 and freq == "D" and closed == "right":
87 # Temporary xfail until the upstream issue is resolved
88 xfail("https://github.com/pandas-dev/pandas/issues/62200")
89
90 index = pd.date_range("1-1-2000", "2-15-2000", freq="h")
91 index = index.union(pd.date_range("4-15-2000", "5-15-2000", freq="h"))
92 if obj == "series":
93 ps = pd.Series(range(len(index)), index=index)
94 elif obj == "frame":
95 ps = pd.DataFrame({"a": range(len(index))}, index=index)
96 ds = from_pandas(ps, npartitions=npartitions)
97 # Series output
98
99 result = resample(ds, freq, how=method, closed=closed, label=label)
100 expected = resample(ps, freq, how=method, closed=closed, label=label)
101
102 assert_eq(result, expected, check_dtype=False)
103
104 divisions = result.divisions
105
106 assert expected.index[0] == divisions[0]
107 assert expected.index[-1] == divisions[-1]
108
109
110def test_resample_agg(df, pdf):

Callers

nothing calls this directly

Calls 4

from_pandasFunction · 0.90
assert_eqFunction · 0.90
xfailFunction · 0.85
resampleFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…