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
Show file tree
Hide file tree
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
Expand Up @@ -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
Expand Up @@ -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,
Expand All @@ -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
Expand Down
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,
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/dtypes/dtypes.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -18,6 +17,7 @@ from pandas._libs.tslibs.offsets import (
)
from pandas._typing import (
Ordered,
TimeZones,
npt,
)

Expand Down
6 changes: 2 additions & 4 deletions pandas-stubs/core/frame.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -97,6 +93,7 @@ from pandas._typing import (
Dtype,
FilePath,
FillnaOptions,
FloatFormatType,
FormattersType,
GroupByObjectNonScalar,
HashableT,
Expand Down Expand Up @@ -147,6 +144,7 @@ from pandas._typing import (
TimeAmbiguous,
TimeNonexistent,
TimeUnit,
TimeZones,
ToStataByteorder,
ToTimestampHow,
UpdateJoin,
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/indexes/accessors.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ from typing import (
TypeVar,
)

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

Expand Down
8 changes: 3 additions & 5 deletions pandas-stubs/core/indexes/datetimes.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/indexes/multi.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -23,6 +22,7 @@ from pandas._typing import (
DtypeArg,
HashableT,
MaskType,
SequenceNotStr,
np_ndarray_anyint,
np_ndarray_bool,
)
Expand Down
12 changes: 5 additions & 7 deletions pandas-stubs/core/series.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ from typing import (
overload,
)

from _typing import (
FloatFormatType,
Label,
ReplaceValue,
Suffixes,
TimeZones,
)
from matplotlib.axes import (
Axes as PlotAxes,
SubplotBase,
Expand Down Expand Up @@ -130,6 +123,7 @@ from pandas._typing import (
FilePath,
FillnaOptions,
FloatDtypeArg,
FloatFormatType,
GroupByObjectNonScalar,
HashableT1,
IgnoreRaise,
Expand All @@ -143,6 +137,7 @@ from pandas._typing import (
JoinHow,
JSONSerializable,
JsonSeriesOrient,
Label,
Level,
ListLike,
ListLikeU,
Expand All @@ -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,
Expand Down