Skip to content

TST: Remove some xfails in groupby tests #52065

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

Merged
merged 1 commit into from
Mar 20, 2023

Conversation

rhshadrach
Copy link
Member

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • 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.rst file if fixing a bug or adding a new feature.

@rhshadrach rhshadrach added Testing pandas testing functions or related to the test suite Groupby Clean labels Mar 18, 2023

if groupby_func == "ngroup":
if groupby_func in ("cumcount", "corrwith", "ngroup"):
Copy link
Member

Choose a reason for hiding this comment

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

ive had these corrwith xfails on my radar for a bit. if we remove the xfail, should we also say "no" to #32293?

Copy link
Member Author

@rhshadrach rhshadrach Mar 18, 2023

Choose a reason for hiding this comment

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

I don't think so; replacing xfail with the attribute check means that this test will still start failing if they are ever added, but without the perf impact of using an xfail. And it is better behaved - the xfail can pass even if corrwith is added (if it doesn't happen to pass the rest of this test).

@phofl phofl added this to the 2.1 milestone Mar 19, 2023
@jbrockmendel jbrockmendel merged commit 72f06ef into pandas-dev:main Mar 20, 2023
@jbrockmendel
Copy link
Member

thanks @rhshadrach

if groupby_func in ("cumcount",):
msg = "DataFrame has no such method"
request.node.add_marker(pytest.mark.xfail(reason=msg))
# first and last are entirely different between frame and groupby
Copy link
Member

Choose a reason for hiding this comment

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

For these cases where nothing is tested, I would prefer using pytest.skip(reason) just so it's clear that nothing is supposed to be tested

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense - I'll do a follow up.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks (totally minor)

@rhshadrach rhshadrach deleted the groupby_xfails branch April 2, 2023 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Groupby Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants