Pandas version checks
Reproducible Example
import pandas as pd
import numpy as np
from pandas.api.types import infer_dtype
print("interval skipna=True :", infer_dtype([pd.Interval(0, 1), None], skipna=True))
print("interval skipna=False:", infer_dtype([pd.Interval(0, 1), None], skipna=False))
print("period skipna=True :", infer_dtype([pd.Period("2020Q1"), np.nan], skipna=True))
print("period skipna=False :", infer_dtype([pd.Period("2020Q1"), np.nan], skipna=False))
Issue Description
pandas.api.types.infer_dtype accepts a skipna argument, but for Period and Interval inputs it is currently not applied:
- Interval inference does not pass
skipna into its validation helper.
- Period inference contains a
FIXME noting that skipna is not actually used.
As a result, skipna=False has no effect for these dtypes.
The wiring itself is straightforward, but I’d like to discuss and confirm the desired behavior once skipna is honored (e.g. whether the result should become mixed, remain period/interval, or something different? ) before proceeding with an implementation.
Expected Behavior
skipna should actually be honored for Period and Interval inference. Once we wire it through, I’d expect skipna=False to have a real effect when missing values are present (i.e., it shouldn’t behave the same as skipna=True).
Installed Versions
Details
INSTALLED VERSIONS
commit : d9cdd2e
python : 3.12.12.final.0
python-bits : 64
OS : Linux
OS-release : 6.6.105+
Version : #1 SMP Thu Oct 2 10:42:05 UTC 2025
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : en_US.UTF-8
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 2.2.2
numpy : 2.0.2
pytz : 2025.2
dateutil : 2.9.0.post0
setuptools : 75.2.0
pip : 24.1.2
Cython : 3.0.12
pytest : 8.4.2
hypothesis : None
sphinx : 8.2.3
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 6.0.2
html5lib : 1.1
pymysql : None
psycopg2 : 2.9.11
jinja2 : 3.1.6
IPython : 7.34.0
pandas_datareader : 0.10.0
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.13.5
bottleneck : 1.4.2
dataframe-api-compat : None
fastparquet : None
fsspec : 2025.3.0
gcsfs : 2025.3.0
matplotlib : 3.10.0
numba : 0.60.0
numexpr : 2.14.1
odfpy : None
openpyxl : 3.1.5
pandas_gbq : 0.30.0
pyarrow : 18.1.0
pyreadstat : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : 1.16.3
sqlalchemy : 2.0.46
tables : 3.10.2
tabulate : 0.9.0
xarray : 2025.12.0
xlrd : 2.0.2
zstandard : 0.25.0
tzdata : 2025.3
qtpy : None
pyqt5 : None
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
pandas.api.types.infer_dtypeaccepts askipnaargument, but forPeriodandIntervalinputs it is currently not applied:skipnainto its validation helper.FIXMEnoting thatskipnais not actually used.As a result,
skipna=Falsehas no effect for these dtypes.The wiring itself is straightforward, but I’d like to discuss and confirm the desired behavior once
skipnais honored (e.g. whether the result should becomemixed, remainperiod/interval, or something different? ) before proceeding with an implementation.Expected Behavior
skipnashould actually be honored forPeriodandIntervalinference. Once we wire it through, I’d expectskipna=Falseto have a real effect when missing values are present (i.e., it shouldn’t behave the same asskipna=True).Installed Versions
Details
INSTALLED VERSIONS
commit : d9cdd2e
python : 3.12.12.final.0
python-bits : 64
OS : Linux
OS-release : 6.6.105+
Version : #1 SMP Thu Oct 2 10:42:05 UTC 2025
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : en_US.UTF-8
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 2.2.2
numpy : 2.0.2
pytz : 2025.2
dateutil : 2.9.0.post0
setuptools : 75.2.0
pip : 24.1.2
Cython : 3.0.12
pytest : 8.4.2
hypothesis : None
sphinx : 8.2.3
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 6.0.2
html5lib : 1.1
pymysql : None
psycopg2 : 2.9.11
jinja2 : 3.1.6
IPython : 7.34.0
pandas_datareader : 0.10.0
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.13.5
bottleneck : 1.4.2
dataframe-api-compat : None
fastparquet : None
fsspec : 2025.3.0
gcsfs : 2025.3.0
matplotlib : 3.10.0
numba : 0.60.0
numexpr : 2.14.1
odfpy : None
openpyxl : 3.1.5
pandas_gbq : 0.30.0
pyarrow : 18.1.0
pyreadstat : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : 1.16.3
sqlalchemy : 2.0.46
tables : 3.10.2
tabulate : 0.9.0
xarray : 2025.12.0
xlrd : 2.0.2
zstandard : 0.25.0
tzdata : 2025.3
qtpy : None
pyqt5 : None