Skip to content
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

remove ops div class to solve #21374 #59144

Merged
merged 10 commits into from
Jul 1, 2024

Conversation

mutricyl
Copy link
Contributor

@mutricyl mutricyl commented Jun 28, 2024

core.computation.div.ops.Div class that was introduced to manage unexpected upcast from float32 to float64 looks to be responsible of the imaginary part of complexes being dropped. It seams that numpy and numexpr have evolved since #12388 and this fix is no more needed.
This PR removes core.computation.div.ops.Div class and extends tests to cover for both floats and complex.

@mroeschke mroeschke added expressions pd.eval, query Complex Complex Numbers labels Jul 1, 2024
mutricyl and others added 2 commits July 1, 2024 20:22
Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
@mroeschke mroeschke added this to the 3.0 milestone Jul 1, 2024
@mroeschke mroeschke merged commit 3782dd1 into pandas-dev:main Jul 1, 2024
45 checks passed
@mroeschke
Copy link
Member

Thanks @mutricyl

bnavigator added a commit to bnavigator/pandas that referenced this pull request Aug 17, 2024
bnavigator added a commit to bnavigator/pandas that referenced this pull request Aug 17, 2024
…olve pandas-dev#2137)

* remove core.computation.ops.Div resolves pandas-dev#21374 pandas-dev#58748

* need to preserve order

* updating tests

* (update whatsnew -- no whatsnew for 2.2.x and 2.3 yet)

* solve mypy issue

* fixing pytests

* better than cast

* adding specific test

(* Update pandas/tests/frame/test_query_eval.py // Not backported, fails on 2.2)

Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>

* Update pandas/tests/computation/test_eval.py

Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>

---------

Co-authored-by: Laurent Mutricy <laurent.mutricy@ekium.eu>
Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
bnavigator added a commit to bnavigator/pandas that referenced this pull request Aug 17, 2024
…olve pandas-dev#2137)

* remove core.computation.ops.Div resolves pandas-dev#21374 pandas-dev#58748

* need to preserve order

* updating tests

* (update whatsnew -- no whatsnew for 2.2.x and 2.3 yet)

* solve mypy issue

* fixing pytests

* better than cast

* adding specific test

(* Update pandas/tests/frame/test_query_eval.py // Not backported, fails on 2.2)

Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>

* Update pandas/tests/computation/test_eval.py

Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>

---------

Co-authored-by: Laurent Mutricy <laurent.mutricy@ekium.eu>
Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
WillAyd added a commit to WillAyd/pandas that referenced this pull request Aug 27, 2024
* remove core.computation.ops.Div resolves pandas-dev#21374 pandas-dev#58748

* need to preserve order

* updating tests

* update whatsnew

* solve mypy issue

* fixing pytests

* better than cast

* adding specific test

* Update pandas/tests/frame/test_query_eval.py

Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>

* Update pandas/tests/computation/test_eval.py

Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>

---------

Co-authored-by: Laurent Mutricy <laurent.mutricy@ekium.eu>
Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
lithomas1 added a commit that referenced this pull request Sep 18, 2024
#59535)

* remove core.computation.ops.Div resolves #21374 #58748

* need to preserve order

* updating tests

* (update whatsnew -- no whatsnew for 2.2.x and 2.3 yet)

* solve mypy issue

* fixing pytests

* better than cast

* adding specific test

(* Update pandas/tests/frame/test_query_eval.py // Not backported, fails on 2.2)



* Update pandas/tests/computation/test_eval.py



---------

Co-authored-by: Laurent Mutricy <laurent.mutricy@ekium.eu>
Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
Co-authored-by: Thomas Li <47963215+lithomas1@users.noreply.github.com>
@lithomas1 lithomas1 mentioned this pull request Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complex Complex Numbers expressions pd.eval, query
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pd.eval() discards imaginary part in division "/"
2 participants