-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN: Exception in core.dtypes #28387
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
Changes from all commits
7544cf4
1dca606
3c675ac
50e1eba
802682c
c417825
662c436
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,7 +67,7 @@ def test_astype_cannot_cast(self, index, dtype): | |
index.astype(dtype) | ||
|
||
def test_astype_invalid_dtype(self, index): | ||
msg = "data type 'fake_dtype' not understood" | ||
msg = 'data type "fake_dtype" not understood' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to change the quoting here? I'm actually surprised this doesn't cause failures since the exception message shown in diff uses single quotes around the bad dtype There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is now passing through an exception raised by numpy |
||
with pytest.raises(TypeError, match=msg): | ||
index.astype("fake_dtype") | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can easily end up here with something that does not raise a syntaxError
But I assume the idea is that in that case the TypeError generated by numpy is fine to raise directly?
If so, can you add a comment for that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(based on your comment below, I suppose that is indeed the case)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jorisvandenbossche I am not sure it matters; this will raise a TypeError if its invalid anyhow (catching the SyntaxError is just for hygiene of the error message)