Skip to content

CLN: xarray tests #32943

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

Merged
merged 4 commits into from
Mar 24, 2020
Merged

CLN: xarray tests #32943

merged 4 commits into from
Mar 24, 2020

Conversation

ShaharNaveh
Copy link
Member

  • closes #xxxx
  • tests added / passed
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

MomIsBestFriend added 2 commits March 23, 2020 20:47
`DeprecationWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.`
def test_to_xarray_index_types(self, indices):
if isinstance(indices, pd.MultiIndex):
pytest.skip("MultiIndex is tested separately")

from xarray import DataArray

s = Series(range(len(indices)), index=indices)
s = Series(range(len(indices)), index=indices, dtype="float64")
Copy link
Member

Choose a reason for hiding this comment

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

why is this change needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

To suppress the Deprecation warning

DeprecationWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.

Copy link
Member

Choose a reason for hiding this comment

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

Is this the only place this occurs? I assume we are getting an empty container through from indices

I'd be surprised if this is the only case, so not sure doing as a one-off here

Copy link
Member Author

Choose a reason for hiding this comment

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

Is this the only place this occurs? I assume we are getting an empty container through from indices

I'd be surprised if this is the only case, so not sure doing as a one-off here

@WillAyd This is the only case in this file that raises the deprecation warning.

Copy link
Member Author

Choose a reason for hiding this comment

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

I can revert this change, not a deal breaker for me

@jbrockmendel
Copy link
Member

LGTM

def test_to_xarray_index_types(self, indices):
if isinstance(indices, pd.MultiIndex):
pytest.skip("MultiIndex is tested separately")

from xarray import DataArray

s = Series(range(len(indices)), index=indices)
s = Series(range(len(indices)), index=indices, dtype="float64")
Copy link
Member

Choose a reason for hiding this comment

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

Is this the only place this occurs? I assume we are getting an empty container through from indices

I'd be surprised if this is the only case, so not sure doing as a one-off here

Copy link
Member

@simonjayhawkins simonjayhawkins left a comment

Choose a reason for hiding this comment

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

Thanks @MomIsBestFriend lgtm ex @WillAyd comment.

@simonjayhawkins simonjayhawkins added Clean Testing pandas testing functions or related to the test suite labels Mar 24, 2020
@simonjayhawkins simonjayhawkins added this to the 1.1 milestone Mar 24, 2020
@simonjayhawkins simonjayhawkins merged commit 2c2ba45 into pandas-dev:master Mar 24, 2020
@simonjayhawkins
Copy link
Member

Thanks @MomIsBestFriend

@ShaharNaveh ShaharNaveh deleted the TST-xarray branch March 25, 2020 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants