diff --git a/pandas-stubs/core/series.pyi b/pandas-stubs/core/series.pyi index 46a8ce14..d38b54da 100644 --- a/pandas-stubs/core/series.pyi +++ b/pandas-stubs/core/series.pyi @@ -90,6 +90,7 @@ from pandas._libs.interval import ( from pandas._libs.lib import NoDefault from pandas._libs.missing import NAType from pandas._libs.tslibs import BaseOffset +from pandas._libs.tslibs.nattype import NaTType from pandas._typing import ( S1, AggFuncTypeBase, @@ -318,7 +319,15 @@ class Series(IndexOpsMixin[S1], NDFrame): @overload def __new__( cls, - data: Scalar | _ListLike | dict[HashableT1, Any] | BaseGroupBy | None = ..., + data: ( + Scalar + | _ListLike + | dict[HashableT1, Any] + | BaseGroupBy + | NaTType + | NAType + | None + ) = ..., index: Axes | None = ..., *, dtype: Dtype = ..., diff --git a/tests/test_series.py b/tests/test_series.py index c67092fb..8bbe0f8d 100644 --- a/tests/test_series.py +++ b/tests/test_series.py @@ -81,6 +81,8 @@ def test_types_init() -> None: pd.Series(1) pd.Series((1, 2, 3)) pd.Series(np.array([1, 2, 3])) + pd.Series(pd.NaT) + pd.Series(pd.NA) pd.Series(data=[1, 2, 3, 4], name="series") pd.Series(data=[1, 2, 3, 4], dtype=np.int8) pd.Series(data={"row1": [1, 2], "row2": [3, 4]})