-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
TST/CLN: deduplicate troublesome rank values #38894
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
Conversation
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 ok for now. i think if we keep adding more shared fixtures (good thing), this file might bloat, so maybe have to do something later.
pandas/conftest.py
Outdated
@@ -591,6 +593,91 @@ def narrow_series(request): | |||
return _narrow_series[request.param].copy() | |||
|
|||
|
|||
_dtype_nuisance_arr_map = { |
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.
can you add a comment here about where this is used
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.
Done
pandas/conftest.py
Outdated
"object": [NegInfinity(), "1", "A", "BA", "Ba", "C", Infinity()], | ||
} | ||
|
||
_dtype_na_map = { |
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.
can you put this inside the fixture, this is generally a special case
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.
Done
pandas/conftest.py
Outdated
@@ -591,6 +593,91 @@ def narrow_series(request): | |||
return _narrow_series[request.param].copy() | |||
|
|||
|
|||
_dtype_nuisance_arr_map = { |
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.
put rank in the name
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.
Done
iranks = iseries.rank() | ||
tm.assert_series_equal(iranks, exp) | ||
def test_rank_inf(self, nuisance_rank_series_and_expected): | ||
series, expected = nuisance_rank_series_and_expected |
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.
actually an alternative here is simply to use frame_or_series
fixture and leave the fixture in tests/frame/methods (e.g. this is what we do for things for both series & frame), i think in this case it makes more sense.
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.
yah i think this makes a lot more sense than a relatively-complicated fixture in conftest
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 that is much nicer, good pattern to know
perfect, ping on green |
green |
thanks |
* WIP * TST/CLN: deduplicate troublesome rank values * Remove unneeded imports * Address comments * Use frame_or_series instead
xref #38681 (comment)