Skip to content

Commit a9ebf19

Browse files
committed
BUG: Allow legacy dtypes to cast to datetime again
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
1 parent c900978 commit a9ebf19

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

numpy/core/src/multiarray/convert_datatype.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,6 @@ PyArray_GetCastingImpl(PyArray_DTypeMeta *from, PyArray_DTypeMeta *to)
106106
return NULL;
107107
}
108108
else {
109-
if (NPY_DT_is_parametric(from) || NPY_DT_is_parametric(to)) {
110-
Py_RETURN_NONE;
111-
}
112109
/* Reject non-legacy dtypes (they need to use the new API) */
113110
if (!NPY_DT_is_legacy(from) || !NPY_DT_is_legacy(to)) {
114111
Py_RETURN_NONE;

0 commit comments

Comments
 (0)