-
Notifications
You must be signed in to change notification settings - Fork 400
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
MNT Deal with pandas 2.0 vs 2.1 #1299
Comments
The issue with not handling this now, is that downstream libraries are getting the |
Sorry.... |
Yes, the warning is propagated and it's making my CI fail in |
Per my comment in Discord, my proposal is to keep |
So when would people stop getting the future warnings coming from pandas? Are you saying we'd fix those warnings somehow in the next release, or the one after? If the one after, it'd mean people would get those warnings for quite a long time from our side. |
## Description The recent `pandas` 2.1 release has simultaneously introduced a new `DataFrame.map()` API, and deprecated the `DataFrame.applymap()` API which we use in `MetricFrame`. Since our builds fail on warnings, this left us with a conundrum. This PR (temporarily) solves this by changing the `DataFrame.applymap()` calls to a nested `DataFrame.apply()` pattern. This is not particularly great, but this should not be being used in performance-critical portions of `MetricFrame` and can suffice until we decide to require `pandas` be at least version 2.1. Also make sure that Python 3.7 is fully excised and add 3.11 to the regular builds and setup. Issue #1299 exists to track the need to tidy all of this up once we drop `pandas` v2.0 support. ## Tests - [ ] no new tests required - [ ] new tests added - [x] existing tests adjusted ## Documentation - [x] no documentation changes needed - [ ] user guide added or updated - [ ] API docs added or updated - [ ] example notebook added or updated
And for extra fun, pandas 2.2 is now out and wreakings its havoc. Some fixes in #1351 |
In
pandas
v2.1, a newDataFrame.map()
API was added, while the previousDataFrame.applymap()
was simultaneously deprecated. Since our builds fail on warnings, this causes issues if the latestpandas
cannot be install (notably for Python 3.8, but also some of our 'otherml_packages' tests).PR #1302 squares this particular circle by rewriting the handful of
DataFrame.applymap()
calls to being nestedDataFrame.apply()
ones. This is not going to be particularly performant, but the DataFrames in question should be relatively small.This issue is to track the nested 'apply' calls, so they can be improved once we drop
pandas
v2.0.Note This has been edited, so some of the discussion below may be obsolete.
The text was updated successfully, but these errors were encountered: