From 100ad36e4e7604dbb7b93819749bfa2e6d632d53 Mon Sep 17 00:00:00 2001 From: Devraj Anand Date: Fri, 23 Oct 2026 01:02:41 +0530 Subject: [PATCH] fix: replace deprecated is_period_dtype with isinstance(..., pd.PeriodDtype) --- malariagen_data/anoph/frq_base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/malariagen_data/anoph/frq_base.py b/malariagen_data/anoph/frq_base.py index 2d8fc3963..5262f5bed 100644 --- a/malariagen_data/anoph/frq_base.py +++ b/malariagen_data/anoph/frq_base.py @@ -70,7 +70,7 @@ def _prep_samples_for_cohort_grouping( # Validate the specified period_by column contains pandas Periods (or nulls). s_period_by = df_samples[period_by] - if not pd.api.types.is_period_dtype(s_period_by.dtype): + if not isinstance(s_period_by.dtype, pd.PeriodDtype): non_null = s_period_by.dropna() if len(non_null) > 0 and not non_null.map(type).eq(pd.Period).all(): raise TypeError( @@ -115,7 +115,7 @@ def _build_cohorts_from_sample_grouping( # Add cohort helper variables. # Vectorized extraction of period start/end times. period = df_cohorts["period"] - if pd.api.types.is_period_dtype(period.dtype): + if isinstance(period.dtype, pd.PeriodDtype): df_cohorts["period_start"] = period.dt.start_time df_cohorts["period_end"] = period.dt.end_time else: