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

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 24, 2024

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
65 of 67 checks passed
@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