Skip to content

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, pd.col Complex Complex Numbers labels Jul 1, 2024
@mroeschke mroeschke added this to the 3.0 milestone Jul 1, 2024
@mroeschke mroeschke merged commit 3782dd1 into pandas-dev:main Jul 1, 2024
@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 <[email protected]>

* Update pandas/tests/computation/test_eval.py

Co-authored-by: Matthew Roeschke <[email protected]>

---------

Co-authored-by: Laurent Mutricy <[email protected]>
Co-authored-by: Matthew Roeschke <[email protected]>
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 <[email protected]>

* Update pandas/tests/computation/test_eval.py

Co-authored-by: Matthew Roeschke <[email protected]>

---------

Co-authored-by: Laurent Mutricy <[email protected]>
Co-authored-by: Matthew Roeschke <[email protected]>
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 <[email protected]>

* Update pandas/tests/computation/test_eval.py

Co-authored-by: Matthew Roeschke <[email protected]>

---------

Co-authored-by: Laurent Mutricy <[email protected]>
Co-authored-by: Matthew Roeschke <[email protected]>
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 <[email protected]>
Co-authored-by: Matthew Roeschke <[email protected]>
Co-authored-by: Thomas Li <[email protected]>
@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, pd.col

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants