BUG: merge_asof does not work with datetime by column on Pandas 2.1.x #55453
Labels
Datetime
Datetime data dtype
Regression
Functionality that used to work in a prior pandas version
Reshaping
Concat, Merge/Join, Stack/Unstack, Explode
Milestone
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
I get the following error when trying to do merge_asof with the 'by' column being a datetime64[ns] dtype. I've verified it doesn't work with other datetime units (e.g. datetime64[s] dtype), or with by=None.
Temporary workaround is to convert the 'by' column to int64 first, perform the merge_asof, then convert the 'by' column back to datetime64[ns]:
The text was updated successfully, but these errors were encountered: