Skip to content

switch from pandas.util.testing to pandas.testing #901

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

Closed
wholmgren opened this issue Feb 21, 2020 · 5 comments · Fixed by #1003
Closed

switch from pandas.util.testing to pandas.testing #901

wholmgren opened this issue Feb 21, 2020 · 5 comments · Fixed by #1003

Comments

@wholmgren
Copy link
Member

pandas.util.testing is deprecated and we're supposed to switch to the functions in the public API at pandas.testing instead.

I'm not sure what the pandas version compatibility is for this. If there's a problem, we could use try/except statements to handle earlier versions of pandas. Or we could just do nothing until the min pandas we support is high enough.

@CameronTStark
Copy link
Contributor

CameronTStark commented Feb 21, 2020

I didn't find a time horizon when pandas.util.testing would disappear. That module is currently executing from pandas._testing import * so changes to pandas._testing will affect us eventually but we should be safe for now. My guess is this won't affect us appreciably until a 1.1.0 release at the earliest.

At this point I'm +1 for waiting and aiming this for our v0.8.0 milestone where we can bump pandas-min to this level.

@wholmgren
Copy link
Member Author

wholmgren commented Feb 21, 2020

Looks like pandas.testing was added in pandas 0.20. pandas-dev/pandas#16003

I think we're talking about going up to pandas 0.22 in pvlib 0.8, so let's make this a pvlib 0.8 milestone.

@wholmgren wholmgren added this to the 0.8.0 milestone Feb 21, 2020
@kandersolar
Copy link
Member

I think this will only take effect in pandas 2.0, according to their versioning policy: https://pandas.pydata.org/docs/whatsnew/v1.0.0.html#new-deprecation-policy

That doesn't mean we have to wait until then to make the switch. @wholmgren are you imagining a straightforward find and replace for this, or maybe something like importing the pandas functions in conftest and then doing from conftest import assert_series_equal and such in the test files?

@wholmgren
Copy link
Member Author

That doesn't mean we have to wait until then to make the switch.

If we're bumping the minimum pandas in 0.8 then can we just go ahead and do the switch now?

@wholmgren are you imagining a straightforward find and replace for this, or maybe something like importing the pandas functions in conftest and then doing from conftest import assert_series_equal and such in the test files?

I was imagining a find/replace. I don't see any advantage to adding it to conftest but let me know if I'm missing something.

@kandersolar
Copy link
Member

If we're bumping the minimum pandas in 0.8 then can we just go ahead and do the switch now?

Sure.

I was imagining a find/replace. I don't see any advantage to adding it to conftest but let me know if I'm missing something.

Only advantage I see is that if pandas changes it again, we would only update one file instead of many. Seems unlikely. Find/replace is fine with me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants