Skip to content
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

Merged
merged 3 commits into from
May 15, 2024

Conversation

rinzool
Copy link
Contributor

@rinzool rinzool commented May 15, 2024

Comment on lines 2259 to 2265
check(
assert_type(
df_multi_level_cols2.stack(0, future_stack=False),
Union[pd.DataFrame, "pd.Series[Any]"],
),
pd.DataFrame,
)
Copy link
Collaborator

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?

Copy link
Contributor Author

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 👍

Comment on lines 2259 to 2265
check(
assert_type(
df_multi_level_cols2.stack(0, dropna=True, sort=True),
Union[pd.DataFrame, "pd.Series[Any]"],
),
pd.DataFrame,
)
Copy link
Collaborator

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.

Copy link
Contributor Author

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

Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rinzool

@Dr-Irv Dr-Irv merged commit 8a41508 into pandas-dev:main May 15, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants