-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: query uses numexpr even when 'compute.use_numexpr' is False #33006
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: query uses numexpr even when 'compute.use_numexpr' is False #33006
Conversation
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 am not sure how this address the actual issue (which is that numexpr knows nothing about extension types; they shouldn't be passed to it at all).
but the title suggests you think there is an actual but in use_numexpr? can you explain.
If i understand correctly, the issue #32556 is about df.query does not care about the pd.set_option option, not about the extension dtype (which is still open at #25369) |
@quangngd that's an accurate description of the issue. Thanks for taking care of this ! |
@quangngd you need to have a test which fails on master but works here. can you construct one. |
there is one in my issue (might not be usable out of the box though). |
@teto I don't think it's a good idea using a bug as a test as it would be fixed in the future. |
So to my understanding, the test must be able to differentiate the used engine during the import pandas as pd
df = pd.DataFrame(data=[4+1j,5,6], columns=["col_test"])
s = "abs(col_test)"
display(df.eval(s, engine='python').dtype)
display(df.eval(s, engine='numexpr').dtype) output: dtype('float64')
dtype('complex128') But so far I can't think of how to make a test for |
@quangngd I am not sure of the status here. please merge master and address comments. |
@jreback the fix is already there but I cannot think of a sensible test |
@quangngd: What about this?
|
@rhshadrach thankyou, the test indeed fails on master and pass on my branch. Where should be the proper place to place the test? |
|
|
||
if engine is None: | ||
engine = "numexpr" if _NUMEXPR_INSTALLED else "python" | ||
engine = "numexpr" if _USE_NUMEXPR else "python" |
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 think in this case we need to check expr.USE_NUMEXPR
, not USE_NUMEXPR
since the former may change at runtime
closing, this needs a reproducible tests that fails before any patch. (it can certainly be part of the patch, but demonstrate on the issue) |
wait what ? it's not easy to reproduce, you would need to disable one package or monkeypatch one package I suppose. The absence of a test should not prevent fixing an issue/document it/remove the feature. |
w/o a test how do you know it was fixed? |
Is this test not sufficient? |
sure if it fails on master |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff