Skip to content

BUG: use PyArray_SafeCast in array_astype#26317

Merged
charris merged 1 commit intonumpy:mainfrom
ngoldbaum:astype-stringdtype-fix
Apr 20, 2024
Merged

BUG: use PyArray_SafeCast in array_astype#26317
charris merged 1 commit intonumpy:mainfrom
ngoldbaum:astype-stringdtype-fix

Conversation

@ngoldbaum
Copy link
Member

@ngoldbaum ngoldbaum commented Apr 19, 2024

I noticed today that passing a distinct StringDType instance to astype wasn't sufficient to actually change the dtype with copy=False. This fixes that issue by using PyArray_SafeCast instead of PyArray_EquivTypes.

See #26147 which introduced PyArray_SafeCast and fixed a similar issue.

@ngoldbaum ngoldbaum added 00 - Bug 09 - Backport-Candidate PRs tagged should be backported labels Apr 19, 2024
@charris charris merged commit 28a3cb3 into numpy:main Apr 20, 2024
@charris
Copy link
Member

charris commented Apr 20, 2024

Thanks Nathan.

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.

2 participants