-
-
Notifications
You must be signed in to change notification settings - Fork 129
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
fix(frame): add arguments for stack method #926
Conversation
tests/test_frame.py
Outdated
check( | ||
assert_type( | ||
df_multi_level_cols2.stack(0, future_stack=False), | ||
Union[pd.DataFrame, "pd.Series[Any]"], | ||
), | ||
pd.DataFrame, | ||
) |
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.
Can you surround this with if PD_LTE_22:
as the future_stack
parameter is being removed in the future, and it will allow the nightly tests that get run upon a merge to succeed?
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.
Sure, I just added the condition 👍
tests/test_frame.py
Outdated
check( | ||
assert_type( | ||
df_multi_level_cols2.stack(0, dropna=True, sort=True), | ||
Union[pd.DataFrame, "pd.Series[Any]"], | ||
), | ||
pd.DataFrame, | ||
) |
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.
Looks like you have to include the if PD_LTE_22
on this test as well, as the dropna
argument will also change behavior in 3.0, so have one if
statement surround both of the new tests you added.
To see this, do poe pytest --nightly
on your current branch, and when you make the fix the problem will go away.
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.
Oh ok nice I didn't notice the --nightly
option to test with pandas 3! It seems to pass now
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 @rinzool
assert_type()
to assert the type of any return value