Skip to content

Fix pandas DeprecationWarning for is_period_dtype in anoph/frq_base.py #1366

Open

Description

@HeeraThakurrr

Running poetry run pytest tests/anoph/test_snp_frq.py with pandas 2.2.3 (Python 3.12, macOS) emits a DeprecationWarning from malariagen_data/anoph/frq_base.py at lines 73 and 118:
is_period_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, pd.PeriodDtype) instead

pandas deprecated this function in 2.2.0. The tests pass, but the call will break when pandas removes it.

Proposed fix: replace both calls with isinstance(dtype, pd.PeriodDtype). I’ve made this change locally and the tests pass with the warning gone. Happy to open a PR if that works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions