-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TST: Replace tm.all_index_generator with indices fixture #32886
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: Replace tm.all_index_generator with indices fixture #32886
Conversation
Originally I wanted to implement
But then I realised that all places where |
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.
Added some comments to aid the review
@@ -240,17 +243,9 @@ def test_to_xarray_index_types(self, index): | |||
tm.assert_series_equal(result.to_series(), s, check_index_type=False) | |||
|
|||
@td.skip_if_no("xarray", min_version="0.7.0") | |||
def test_to_xarray(self): | |||
def test_to_xarray_multiindex(self): |
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.
Potentially this could benefit from using the MultiIndex cases from indices
. I didn't want to include it in this PR though
and isinstance(obj, pd.DataFrame) | ||
): | ||
# TODO: Seems to be bugged | ||
pytest.xfail("This doesn't raise") |
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.
Wasn't sure what to do here. Is this ok or should this be fixed? I added an xfail
for now, but can create a follow-up issue
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 split this to a separate test for now (and just xfail the entire test; we can come back later and fix), but rather not add this code. also create an issue (and reference it here).
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.
looks good generally, comment, ping ping on green.
and isinstance(obj, pd.DataFrame) | ||
): | ||
# TODO: Seems to be bugged | ||
pytest.xfail("This doesn't raise") |
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 split this to a separate test for now (and just xfail the entire test; we can come back later and fix), but rather not add this code. also create an issue (and reference it here).
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.
comment on a test
@@ -261,3 +256,15 @@ def test_to_xarray(self): | |||
tm.assert_almost_equal(list(result.coords.keys()), ["one", "two"]) | |||
assert isinstance(result, DataArray) | |||
tm.assert_series_equal(result.to_series(), s) | |||
|
|||
@td.skip_if_no("xarray", min_version="0.7.0") |
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.
cc @jbrockmendel your test moving PR for xrray might need rebasing after this
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 i think we always have a > 0.7.0 xarary?
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.
I can check that as a follow-up. There are more spots where this condition is used
@jreback CI is green |
thanks @SaturnFromTitan |
Inspired by #30999
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff