-
Notifications
You must be signed in to change notification settings - Fork 91
Added support for pandas 2 #4216
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
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4216 +/- ##
=======================================
- Coverage 99.7% 99.7% -0.0%
=======================================
Files 349 349
Lines 38410 38413 +3
=======================================
+ Hits 38291 38293 +2
- Misses 119 120 +1
|
3d42016
to
c60d2ea
Compare
7854455
to
2786806
Compare
@christopherbunn Woodwork and Featuretools now support pandas 2.0 |
3ad7710
to
6a4f6e9
Compare
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.
Few points to consider:
# Only need to handle nullable types on pandas < 2. Kept for backwards compatibility with pandas 1.x. | ||
if pd.__version__[0] == "1": | ||
X, y = cls._handle_nullable_types(cls, X, y) |
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.
Added this in so that we can retain pandas 1.x compatibility. If we need to remove it in the future , we should also remove this line too.
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.
Also it's not covered since we only run the codecov parts on the latest dependencies (which is pandas 2.0) and this section only runs on the min deps CI.
>>> y = pd.Series([True, False, False, False, True]) | ||
>>> target_distribution(y) | ||
>>> print(target_distribution(y).to_string()) |
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.
This + the one on line 187 is needed since the name of the resulting series is different between pandas versions.
marks=pytest.mark.xfail( | ||
condition=pd.__version__[0] == "1", | ||
strict=True, | ||
raises=AssertionError, | ||
reason="pandas 1.x does not recognize np.Nan in Float64 subtracted_floats.", | ||
), |
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.
Only necessary to maintain backwards compatibility
if index_type == "integer_index": | ||
assert pd.api.types.is_integer_dtype(y[y_t_new.index].index) | ||
assert pd.api.types.is_integer_dtype(output_inverse_y.index) |
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.
Open to removing this since we already assume the index are ints.
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.
Thanks for doing this! We need to make sure there isn't any accidentally deleted code and figure out what the minimum version should be before this can go in.
evalml/pipelines/components/transformers/preprocessing/decomposer.py
Outdated
Show resolved
Hide resolved
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.
My bad, most of the code regressions are due to some bad merge work with your PR @eccabay 😅
evalml/pipelines/components/transformers/preprocessing/decomposer.py
Outdated
Show resolved
Hide resolved
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.
LGTM but +1 on @eccabay 's comments re checking for version
bd6ccba
to
6b42b5f
Compare
* Squashed changes * Ignored index * Disabled column checking * Reverted deleted code * Updated pyproject.toml * Replaced version check code
* Squashed changes * Ignored index * Disabled column checking * Reverted deleted code * Updated pyproject.toml * Replaced version check code
* Squashed changes * Ignored index * Disabled column checking * Reverted deleted code * Updated pyproject.toml * Replaced version check code
Resolves #4252