You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've started looking at these and will have a PR up tonight or tomorrow for some.
The failures in dask/dataframe/tests/test_dataframe.py::test_to_timedelta (and probably to_datetime)) boil down to pandas 3.x's support for non-ns resolution datetime / timedelta and value-dependent parsing to support that. For example:
In [9]: values= ["1", "2", "1 day 2 hours"]
In [10]: pd.to_timedelta(s[:2])
Out[10]:
00days00:00:00.00000000110days00:00:00.000000002dtype: timedelta64[ns]
In [11]: pd.to_timedelta(s[2:])
Out[11]:
21days02:00:00dtype: timedelta64[us]
Note that the dtype is ns for parsing just the first two, but us for the 3rd on. This is a problem for dask, since we want to know the dtype of the array without looking at the values: you don't want to infer different dtypes for different divisions.
There is an API to cast to a different unit:
In [18]: pd.to_timedelta(s[:2]).dt.as_unit("ns")
Out[18]:
00days00:00:00.00000000110days00:00:00.000000002dtype: timedelta64[ns]
In [19]: pd.to_timedelta(s[2:]).dt.as_unit("ns")
Out[19]:
21days02:00:00dtype: timedelta64[ns]
Which might work. But it'd be preferable to have that in the to_timedelta API (in both dask and pandas). I might raise that on pandas unless I find a workaround.
Activity
TomAugspurger commentedon Dec 3, 2025
I've started looking at these and will have a PR up tonight or tomorrow for some.
The failures in
dask/dataframe/tests/test_dataframe.py::test_to_timedelta(and probablyto_datetime)) boil down to pandas 3.x's support for non-ns resolution datetime / timedelta and value-dependent parsing to support that. For example:Note that the dtype is
nsfor parsing just the first two, butusfor the 3rd on. This is a problem for dask, since we want to know the dtype of the array without looking at the values: you don't want to infer different dtypes for different divisions.There is an API to cast to a different unit:
Which might work. But it'd be preferable to have that in the
to_timedeltaAPI (in both dask and pandas). I might raise that on pandas unless I find a workaround.TomAugspurger commentedon Dec 4, 2025
I thikn the resample errors are caused by pandas-dev/pandas#63262. I'll defer those for now.
TomAugspurger commentedon Dec 10, 2025
There's just one remaining error, which I'm not able to reproduce locally:
I notice that the counts are mostly the same:
so this looks like a sort stability issue, at least on some platforms?
Oh, https://pandas.pydata.org/docs/dev/reference/api/pandas.Series.value_counts.html#pandas.Series.value_counts mentions that as of 3.0 this is a stable sort.
Stable sort in Series.value_counts for pandas 3.x
TomAugspurger commentedon Dec 14, 2025
I think this was closed by #12191
jrbourbeau commentedon Dec 15, 2025
Thanks for tracking / handling @TomAugspurger