Skip to content

GH1221 Fix typing module exposure in pandas.api #1223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pandas-stubs/api/__init__.pyi
Original file line number Diff line number Diff line change
@@ -3,4 +3,5 @@ from pandas.api import (
indexers as indexers,
interchange as interchange,
types as types,
typing as typing,
)
2 changes: 2 additions & 0 deletions pandas-stubs/api/typing/__init__.pyi
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ from pandas.core.groupby import (
DataFrameGroupBy as DataFrameGroupBy,
SeriesGroupBy as SeriesGroupBy,
)
from pandas.core.indexes.frozen import FrozenList as FrozenList
from pandas.core.resample import (
DatetimeIndexResamplerGroupby as DatetimeIndexResamplerGroupby,
PeriodIndexResamplerGroupby as PeriodIndexResamplerGroupby,
@@ -20,6 +21,7 @@ from pandas.core.window import (
)

from pandas._libs import NaTType as NaTType
from pandas._libs.lib import NoDefault as NoDefault
from pandas._libs.missing import NAType as NAType

from pandas.io.json._json import JsonReader as JsonReader
2 changes: 1 addition & 1 deletion pandas-stubs/core/arrays/datetimes.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from datetime import tzinfo

from _typing import TimeZones
import numpy as np
from pandas.core.arrays.datetimelike import (
DatelikeOps,
@@ -11,6 +10,7 @@ from pandas.core.arrays.datetimelike import (
from pandas._typing import (
TimeAmbiguous,
TimeNonexistent,
TimeZones,
)

from pandas.core.dtypes.dtypes import DatetimeTZDtype as DatetimeTZDtype
2 changes: 1 addition & 1 deletion pandas-stubs/core/dtypes/dtypes.pyi
Original file line number Diff line number Diff line change
@@ -5,7 +5,6 @@ from typing import (
TypeVar,
)

from _typing import TimeZones
import numpy as np
from pandas.core.indexes.base import Index
from pandas.core.series import Series
@@ -18,6 +17,7 @@ from pandas._libs.tslibs.offsets import (
)
from pandas._typing import (
Ordered,
TimeZones,
npt,
)

6 changes: 2 additions & 4 deletions pandas-stubs/core/frame.pyi
Original file line number Diff line number Diff line change
@@ -18,10 +18,6 @@ from typing import (
overload,
)

from _typing import (
FloatFormatType,
TimeZones,
)
from matplotlib.axes import Axes as PlotAxes
import numpy as np
from pandas import (
@@ -97,6 +93,7 @@ from pandas._typing import (
Dtype,
FilePath,
FillnaOptions,
FloatFormatType,
FormattersType,
GroupByObjectNonScalar,
HashableT,
@@ -147,6 +144,7 @@ from pandas._typing import (
TimeAmbiguous,
TimeNonexistent,
TimeUnit,
TimeZones,
ToStataByteorder,
ToTimestampHow,
UpdateJoin,
2 changes: 1 addition & 1 deletion pandas-stubs/core/indexes/accessors.pyi
Original file line number Diff line number Diff line change
@@ -9,7 +9,6 @@ from typing import (
TypeVar,
)

from _typing import TimeZones
import numpy as np
import numpy.typing as npt
from pandas import (
@@ -40,6 +39,7 @@ from pandas._typing import (
TimeNonexistent,
TimestampConvention,
TimeUnit,
TimeZones,
np_ndarray_bool,
)

8 changes: 3 additions & 5 deletions pandas-stubs/core/indexes/datetimes.pyi
Original file line number Diff line number Diff line change
@@ -9,11 +9,6 @@ from datetime import (
)
from typing import overload

from _typing import (
AxesData,
Frequency,
TimeZones,
)
import numpy as np
from pandas import (
DataFrame,
@@ -31,10 +26,13 @@ from pandas.core.series import (
from typing_extensions import Self

from pandas._typing import (
AxesData,
DateAndDatetimeLike,
Dtype,
Frequency,
IntervalClosedType,
TimeUnit,
TimeZones,
)

from pandas.core.dtypes.dtypes import DatetimeTZDtype
2 changes: 1 addition & 1 deletion pandas-stubs/core/indexes/multi.pyi
Original file line number Diff line number Diff line change
@@ -9,7 +9,6 @@ from typing import (
overload,
)

from _typing import SequenceNotStr
import numpy as np
import pandas as pd
from pandas.core.indexes.base import Index
@@ -23,6 +22,7 @@ from pandas._typing import (
DtypeArg,
HashableT,
MaskType,
SequenceNotStr,
np_ndarray_anyint,
np_ndarray_bool,
)
12 changes: 5 additions & 7 deletions pandas-stubs/core/series.pyi
Original file line number Diff line number Diff line change
@@ -24,13 +24,6 @@ from typing import (
overload,
)

from _typing import (
FloatFormatType,
Label,
ReplaceValue,
Suffixes,
TimeZones,
)
from matplotlib.axes import (
Axes as PlotAxes,
SubplotBase,
@@ -130,6 +123,7 @@ from pandas._typing import (
FilePath,
FillnaOptions,
FloatDtypeArg,
FloatFormatType,
GroupByObjectNonScalar,
HashableT1,
IgnoreRaise,
@@ -143,6 +137,7 @@ from pandas._typing import (
JoinHow,
JSONSerializable,
JsonSeriesOrient,
Label,
Level,
ListLike,
ListLikeU,
@@ -154,18 +149,21 @@ from pandas._typing import (
RandomState,
ReindexMethod,
Renamer,
ReplaceValue,
Scalar,
ScalarT,
SequenceNotStr,
SeriesByT,
SortKind,
StrDtypeArg,
StrLike,
Suffixes,
T,
TimeAmbiguous,
TimedeltaDtypeArg,
TimestampDtypeArg,
TimeUnit,
TimeZones,
ToTimestampHow,
UIntDtypeArg,
ValueKeyFunc,