Skip to content

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

Closed

Description

@wholmgren

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.

Activity

  1. CameronTStark commented on Feb 21, 2020

    @CameronTStark
    Contributor

    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.

  2. wholmgren commented on Feb 21, 2020

    @wholmgren
    MemberAuthor

    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.

  3. added this to the 0.8.0 milestone on Feb 21, 2020
  4. kandersolar commented on Jul 9, 2020

    @kandersolar
    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?

  5. wholmgren commented on Jul 9, 2020

    @wholmgren
    MemberAuthor

    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.

  6. kandersolar commented on Jul 9, 2020

    @kandersolar
    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions