dask / dask-expr

BSD 3-Clause "New" or "Revised" License
79 stars 18 forks source link

Assigning a column by attribute does not work #1010

Closed rjzamora closed 3 months ago

rjzamora commented 3 months ago

Came across a subtle bug/change in dask-expr while debugging a dask-cudf test:

import dask.dataframe as dd

df = dd.from_dict({"a": [0, 1]}, 1)
df.dtypes.a  # dtype('int64')

df.a = df.a.astype("float")
df.dtypes.a  # `meta` is NOT updated: dtype('int64')

df["a"] = df.a.astype("float")
df.dtypes.a  # `meta` IS updated: dtype('float64')
phofl commented 3 months ago

This doesn't work at all fwiw, the column isn't updated either