8000 BUG: fix incorrect error handling for dtype('a') deprecation by ngoldbaum · Pull Request #26524 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

Comments

BUG: fix incorrect error handling for dtype('a') deprecation#26524

Merged
charris merged 1 commit intonumpy:mainfrom
ngoldbaum:fix-dtype-a
May 24, 2024
Merged

BUG: fix incorrect error handling for dtype('a') deprecation#26524
charris merged 1 commit intonumpy:mainfrom
ngoldbaum:fix-dtype-a

Conversation

@ngoldbaum
Copy link
Member
@ngoldbaum ngoldbaum commented May 24, 2024

Fixes #26521

@ngoldbaum ngoldbaum requested a review from mtsokol May 24, 2024 18:08
@ngoldbaum ngoldbaum added the 09 - Backport-Candidate PRs tagged should be backported label May 24, 2024
@charris charris merged commit 5807561 into numpy:main May 24, 2024
@charris
Copy link
Member
charris commented May 24, 2024

Thanks Nathan.

self.assert_deprecated(f)
f = lambda: np.array(["hello", "world"]).astype("a10")
self._check_for_warning(f)
self.assert_deprecated(f)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick fix! It doesn't matter, just FYI: assert_deprecated checks for both the warning and the error path, all that is needed to make it specific is setting message = ... as a class variable.

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: np.dtype("a") NumPy 2 deprecation seems not properly tested and raising fails.

3 participants

0