pandas
pandas copied to clipboard
Backport #59144 on 2.2.x / 2.3.x (remove ops div class to solve #2137)
Backport #59144
-
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
- [x] closes #58548
- [ ] Tests added and passed if fixing a bug or adding a new feature
- [ ] All code checks passed.
- [ ] Added type annotations to new arguments/methods/functions.
- [ ] Added an entry in the latest
doc/source/whatsnew/vX.X.X.rstfile if fixing a bug or adding a new feature. -- no one found for 2.x
@WillAyd - 2.3.x should only have backports related to PDEP-14, is that right?
If that's your policy, be advised that the current stable release 2.2 is not and minor release updates of it will never fully work with Numpy 2
There's a few things not required for PDEP-14 that have made their way in just to get the test suite green, but mostly it is for PDEP-14.
We actually haven't started backporting anything yet to 2.3 - the first PR to do so an get that branch up to speed is https://github.com/pandas-dev/pandas/pull/59513
I'll take a look at this particular change as part of that
Thanks @WillAyd - I wouldn't push for this PR to be backported to 2.3, but no objection either.
I've actually been wondering about a few of the errors on 2.3 (see https://github.com/pandas-dev/pandas/pull/59513#issuecomment-2305587191) and this appears to address some of them, so I think it will be required (thanks @bnavigator for investigating!)
cc @lithomas1
I think this fixes the failures, so going to merge on red.
thanks @bnavigator
AFAICT most of this has also been used in #59513 by @WillAyd, so now that this one has been merged into 2.2.x, his PR into 2.3.x will probably need adjustments as well. Plus 2.3.x probably needs a forward