Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Enable many complex number tests #54761
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
Enable many complex number tests #54761
Changes from 9 commits
6125494
e7a285a
02719d9
f9bfeb9
077213f
9fda0ef
d25baa2
ad841bf
7535374
7ef6052
f1139f5
19d3127
67e2dbc
909ced4
48cb330
bc96021
d98e6f0
dabaf6f
61c9b32
6ed24ad
e923878
5efad33
51450c8
c31b213
9473130
a86c896
de56177
198a16d
554a5c3
6ddb7f7
c4a17a7
040c98b
3a58f5a
29aa747
5210c8b
9f4bea5
be1f02b
b3edefa
89ea60b
4dc3bea
4e273fa
abfdedb
59b50c9
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
@jbrockmendel is there something in our type conversion / introspection functions that lets us cast to the nearest inexact data type? If not that might be something we want to do here or in a follow up PR to better handle this
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.
I don't think so, no. i expected maybe_promote to do that, but looks like it always gives float64
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.
Do you know where the
ValueError
is being thrown? I think the type of error should stay consistentThere 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.
When running
pandas/tests/extension/test_numpy.py
anddata
is an array offloat64
we see:When
data
iscomplex128
we see:The ValueError seems to come from Numpy, and the TypeError seems to come from Python, both coming from
__setitem__
in classNDArrayBackedExtensionArray
inpandas/core/arrays/_mixins.py
.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.
Could we catch the Python TypeError and reraise as a ValueError?
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.
I've amended the PR to attempt this. Please let me know what you think.