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.
BUG/TST: run and fix all arithmetic tests with+without numexpr #40463
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
BUG/TST: run and fix all arithmetic tests with+without numexpr #40463
Changes from 3 commits
a4dea4a
24d087e
6851089
d6f23ba
5122675
82a7247
340232a
e294267
0804e63
d97ab38
dcf38cf
036cf62
06d76e0
6ff3be0
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.
Basically with a string argument, numexpr will fail with a "wrong" error message. Alternatively,
_can_use_numexpr
in expressions.py could also be updated to check for this and avoid using the numexpr path (currently that only checks object with dtypes, not for scalars)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.
lets make an effort to keep numexpr-specific lgoic in _can_use_numexpre/expressions
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 would you be OK with leaving the check here as is, short term? I have a next PR that moves this check inside a
can_use_numexpr
function insideexpressions.py
(#41122), so that will clean this up.But I would like to merge this PR before #41122 since this one is adding a lot of test coverage for with/without numexpr.
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.
yeah ok for now, but let's for sure move later
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.
this additional check could maybe be moved into
should_extension_dispatch
(although it is not necessarily related to "is extension array", but rather to "don't take the numexpr path")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.
yah, IIRC should_extension_dispatch is only used here, so might as well refactor/rename/move/whatever is most convenient.
There is a comment below about why Timedelta is included; can you update it for the others
i think check
rvalues is NaT
rather than isinstance checkThere 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.
Changed to
right is NaT
and updated the comment.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.
can we get rid of some of the setup/teardown in test_expressions with 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.
Potentially something similar could be used there as well, yes. But this PR is focusing on the
tests/arithmetic/
tests, there is #40497 as general issue to modernizetest_expressions.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.
is the reverse excluded as well?
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.
The reverse (float32 + int64) is not tested, as the
first.dtype
is always int64/float64/uint64(but yeah, the reverse order would also result in float32 instead of float64 when numexpr is used)