REGR: passing dask arrays to Series or DataFrame · Issue #38645 · pandas-dev/pandas (original) (raw)

Code Sample, a copy-pastable example

import pandas as pd import dask.array as da a = da.ones((12,), chunks=4) s = pd.Series(a, index=range(12)) print(s.dtype)

Problem description

This has been detected by xarray's upstream-dev CI (environment): with 1.1.3, the dtype is float64 while on master (installed from scipy-wheels-nightly) this became object (and the series / dataframe contains dask scalars). Was that change intentional? Poking around on the merged PR list, this might have been #38563 (not sure, though).

To be clear, for us this only affects test code and since it would compute anyways we can easily work around this by computing the dask array before passing it to pd.Series or pd.DataFrame.

See also pydata/xarray#4717.

cc @TomAugspurger