#12556·dask

Assigning a DataFrame column with dd.to_datetime() changes dtypes of unrelated columns

Author: andrewrliCreated Aug 15, 2026Updated Sep 21, 2026
Labelsneeds attentionneeds triage

Given a DataFrame, when I assign the results of dd.to_datetime() to a new column, then other columns may change their data types from integer to float64. This issue seems related to issues #3907 and #4398.

Example:

python
import pandas as pd
import dask.dataframe as dd

df = dd.from_dict({"a": [1, 2, 3]}, npartitions=1)
print("Original dtypes:")
print(df.dtypes)

df["b"] = dd.to_datetime(pd.Series([2024, 2025, 2026]), format=r"%Y")
print("\nNew dtypes:")
print(df.dtypes)
Original dtypes:
a    int64
dtype: object

New dtypes:
a           float64
b    datetime64[us]
dtype: object

Here, the a column has changed from an int64 to a float64, even though that column wasn't directly modified. This issue doesn't happen if Dask's dd.to_datetime() is replaced with pandas's pd.to_datetime().

Environment:

  • Dask version: Tested on commit ba5045e
  • Python version: 3.14.7
  • Operating System: Ubuntu on WSL
  • Install method: source