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

Change cross-pandas-version testing in cudf #15145

Merged
merged 4 commits into from
Mar 13, 2024

Conversation

galipremsagar
Copy link
Contributor

@galipremsagar galipremsagar commented Feb 26, 2024

Description

This PR removes redundant version checks in a lot of pytests.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@galipremsagar galipremsagar added 3 - Ready for Review Ready for review by team Python Affects Python cuDF API. improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Feb 26, 2024
@galipremsagar galipremsagar self-assigned this Feb 26, 2024
@galipremsagar galipremsagar requested a review from a team as a code owner February 26, 2024 20:01
@galipremsagar galipremsagar changed the title Cleanup redundant version checks Change cross-pandas-version testing in cudf Mar 5, 2024
@@ -964,6 +977,10 @@ def test_is_decimal_dtype(obj, expect):
assert types.is_decimal_dtype(obj) == expect


@pytest.mark.skipif(
Copy link
Contributor

Choose a reason for hiding this comment

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

non-blocking: If possible, would be great to prefer using xfail(..., raises=AssertionError) over skipif so these tests still have an opportunity to exercise cudf APIs as a smoketest

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed. If it doesn't pass, then use xfail. Only use skipif if you have to avoid execution entirely, e.g. to avoid a segfault.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think using xfail instead of skipif is a good option. Here's why: Each version of pandas behaves differently and we have enabled strict xfail globally. If we start xfailing, we will end up versioning those xfails's heavily like prior to this PR adding more maintenance burden.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cc: @vyasr

Copy link
Contributor

Choose a reason for hiding this comment

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

This strategy would be good to explain in docs/cudf/source/developer_guide/testing.md.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry for not responding earlier, I'm just catching up on a bunch of notifications today. Yeah, I think skipif is unfortunately probably the better option here (full disclosure I think I also originally proposed this setup) for precisely the reason that Prem mentioned. We've definitely had edge cases before where we would do things like "fail if Y > pandas > X" because the xfail behavior wasn't even necessarily monotonic in versions (i.e. it also wouldn't show up in pandas < X). The current approach avoids that complexity, and also avoids degrading the developer experience if a dev locally happens to have one of the failing versions of pandas installed and thinks they have a problematic test. With the current strategy it's run everything if you're on exactly the right pandas version, otherwise skip all the tests that failed on any prior pandas version within the nominally supported range.

Copy link
Contributor

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

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

Nice to have follow up comment otherwise LGTM

Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

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

Generally looks good. I support @mroeschke's proposal to use more xfail and less skipif.

@galipremsagar galipremsagar added 5 - Ready to Merge Testing and reviews complete, ready to merge and removed 3 - Ready for Review Ready for review by team labels Mar 13, 2024
@galipremsagar
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit fe9642b into rapidsai:branch-24.04 Mar 13, 2024
73 checks passed
wence- added a commit to wence-/cudf that referenced this pull request Mar 13, 2024
This was required by rapidsai#15109, but removed by the changes in rapidsai#15145 and
the merge order was such that they weren't tested against each other.
@wence- wence- mentioned this pull request Mar 13, 2024
3 tasks
rapids-bot bot pushed a commit that referenced this pull request Mar 13, 2024
This was required by #15109, but removed by the changes in #15145 and the merge order was such that they weren't tested against each other.

Authors:
  - Lawrence Mitchell (https://github.com/wence-)

Approvers:
  - Bradley Dice (https://github.com/bdice)
  - GALI PREM SAGAR (https://github.com/galipremsagar)

URL: #15287
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to Merge Testing and reviews complete, ready to merge improvement Improvement / enhancement to an existing function non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants