-
Notifications
You must be signed in to change notification settings - Fork 912
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
fast_slow_proxy: Don't import assert_eq at top-level #16063
Conversation
The |
This way, importing it won't require pytest. - Closes rapidsai#16062
I have moved |
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.
This is a better solution, I think. The one change worth noting is that cudf.testing.assert_eq is now a public API. (It’s not in the private _utils.py.) Do we need to add it to the API docs?
I have added (and formatted/extended the docstring). |
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 @wence-!
/merge |
We moved If so, we may still want to consider using a different module so that (this isn't important enough to me to be worth blocking this PR though) |
I did not recall that history, thanks for the reminder. I am slightly in favor of having a function like |
The question is what APIs other libraries need. There are already APIs for comparing DataFrame and Series objects (like |
rapidsai/cudf#16063 has updated the import location of `assert_eq` to the public `cudf.testing.assert_eq`, this change updates imports accordingly.
rapidsai/cudf#16063 has updated the import location of `assert_eq` to the public `cudf.testing.assert_eq`, this change updates imports accordingly.
rapidsai/cudf#16063 has updated the import location of `assert_eq` to the public `cudf.testing.assert_eq`, this change updates imports accordingly.
rapidsai/cudf#16063 has updated the import location of `assert_eq` to the public `cudf.testing.assert_eq`, this change updates imports accordingly.
Turns out this wasn't enough of a deterrence: |
If we want other libraries to adopt a certain pattern (like not using assert_eq), we should first adopt that pattern in cudf’s own tests. Many other libraries learn how to write tests by reading cudf’s tests, so we might as well make this a public utility. |
rapidsai/cudf#16063 has updated the import location of `assert_eq` to the public `cudf.testing.assert_eq`, this change updates imports accordingly. Authors: - Peter Andreas Entschev (https://github.com/pentschev) Approvers: - Mads R. B. Kristensen (https://github.com/madsbk) URL: #1050
rapidsai/cudf#16063 has updated the import location of `assert_eq` to the public `cudf.testing.assert_eq`, this change updates imports accordingly. Authors: - Peter Andreas Entschev (https://github.com/pentschev) Approvers: - Mads R. B. Kristensen (https://github.com/madsbk) URL: #1353
rapidsai/cudf#16063 has updated the import location of `assert_eq` to the public `cudf.testing.assert_eq`, this change updates imports accordingly. Authors: - Peter Andreas Entschev (https://github.com/pentschev) Approvers: - Mads R. B. Kristensen (https://github.com/madsbk) URL: #239
There's nothing wrong with having utilities that are only usable within cudf's tests and not elsewhere. That's not happening here in large part because the utility is actually part of the cudf package. If we instead implemented in conftest or a utils module within the tests directory itself, both of which are fairly common patterns, then that would fit the expectations of external users looking at cudf's tests for guidance. |
An upstream change in cudf uncovered a bug in `_GeoSeriesUtility._from_data` where `False` was being passed to `cudf.Series(index=)` which is an invalid value. The only valid `index` values are an actual `cudf.Index` or `None`, so setting to `None` as a more appropriate default value Also updates the location of `assert_eq` which moved in rapidsai/cudf#16063 Authors: - Matthew Roeschke (https://github.com/mroeschke) Approvers: - Paul Taylor (https://github.com/trxcllnt) - Mark Harris (https://github.com/harrism) - Bradley Dice (https://github.com/bdice) URL: #1400
Description
The testing._utils module imports pytest, which is not advertised as a default run dependency of cudf, so we must avoid importing it in the proxy wrappers at top-level.
Since what we need in the proxy wrappers for pandas debugging is the
assert_eq
function (which does not need pytest), move it totesting.testing
(where it more naturally fits with the other assertion functions anyway). This removes the need for pytest when running the fast-slow-proxy wrappers.Checklist