Skip to content

BUG: Allow legacy dtypes to cast to datetime again#21372

Merged
mattip merged 1 commit intonumpy:mainfrom
seberg:relax-legacycast-parametric
Apr 21, 2022
Merged

BUG: Allow legacy dtypes to cast to datetime again#21372
mattip merged 1 commit intonumpy:mainfrom
seberg:relax-legacycast-parametric

Conversation

@seberg
Copy link
Copy Markdown
Member

@seberg seberg commented Apr 21, 2022

This constraint was added out of a caution with the thought that nobody
uses it. Turns out ora does use it.
In practice, this only affects cast to and from datetimes (or possibly
strings but that seems even less likely).

Tested via ora (see gh-21365) the paths are not particularly special,
but the parametric dtype resolution is in principle missing.
This is not particularly problematic, since NumPy barely exposes that
though, and it never worked.

Closes gh-21365


Test is missing, it could be added a rational to string cast probably, but overall it seems ora is working fine with it (see issue) and I always only added the check because I thought that without a proper dtype resolution, this is probably useless in any case. (proper dtype resolution was not possible previously)

If there is a small chance of another 1.21.x release, this should also be backported to there.

This constraint was added out of a caution with the thought that nobody
uses it.  Turns out ora does use it.
In practice, this only affects cast to and from datetimes (or possibly
strings but that seems even less likely).

Tested via ora (see numpygh-21365) the paths are not particularly special,
but the parametric dtype resolution is in principle missing.
This is not particularly problematic, since NumPy barely exposes that
though, and it never worked.

Closes numpygh-21365
@seberg seberg added the 09 - Backport-Candidate PRs tagged should be backported label Apr 21, 2022
@mattip mattip merged commit f55ab1b into numpy:main Apr 21, 2022
@mattip
Copy link
Copy Markdown
Member

mattip commented Apr 21, 2022

Thanks @seberg. I will let @charris add the correct milestone.

@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: can't register cast functions between datetime64 and user dtype

3 participants