-
Notifications
You must be signed in to change notification settings - Fork 97
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
TST polars support for deduplicate #785
Conversation
@TheooJ you have to create a specific issue for the meta-issue you're addressing.
Otherwise, the meta-issue will be automatically closed when we merge a single PR that refers to it. |
Thanks, done. |
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 this PR. Good job using utils from test_polars
! In addition to checking errors, we also want to check the results. In that sense, check that identical Pandas and Polars series inputs return the same output.
If the function you are testing already works fine with Polars, you don't need to catch a potential error. However, if this function doesn't work with Polars yet, we need to:
- Add it to a list of functions that don't support Polars yet (create one in
test_polars.py
) - Use
pytest.mark.xfail
if the function you are testing belongs to the list. This will skip the test by displaying a soft fail (meaning: we acknowledge that this is failing, but this needs to be fixed). Example in scikit-learn. Note that scikit-learn uses a more complex scheme for xfailing tests by using_xfail_checks
tags in estimators. We can keep it simple for now and use a list, without using tags.
I've compared pandas and polars outputs in the same test function. If polars is missing, the test will be skipped. If the function applied to polars either returns an error or if the pandas and polars outputs don't match, the test will xfail. Let me know what you think |
As discussed, I've removed the xfail completely if the polars test is successful. If the test was failing, I would add
|
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.
Hey @TheooJ, thank you for this PR! LGTM
Let's apply suggestions from #769
Closing issue #789
Checking if
deduplicate
works with polars input intest_deduplicate.py
I propose to catch any exceptions, let me know if you want to be more specific