Skip to content

Commit d91ffa6

Browse files
simonjayhawkinsWillAyd
authored andcommitted
TYPING: change to FrameOrSeries Alias in pandas._typing (#28173)
1 parent 080d57e commit d91ffa6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pandas/_typing.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
from pandas.core.arrays.base import ExtensionArray # noqa: F401
1212
from pandas.core.dtypes.dtypes import ExtensionDtype # noqa: F401
1313
from pandas.core.indexes.base import Index # noqa: F401
14-
from pandas.core.frame import DataFrame # noqa: F401
1514
from pandas.core.series import Series # noqa: F401
1615
from pandas.core.sparse.series import SparseSeries # noqa: F401
16+
from pandas.core.generic import NDFrame # noqa: F401
1717

1818

1919
AnyArrayLike = TypeVar(
@@ -24,7 +24,10 @@
2424
Dtype = Union[str, np.dtype, "ExtensionDtype"]
2525
FilePathOrBuffer = Union[str, Path, IO[AnyStr]]
2626

27-
FrameOrSeries = TypeVar("FrameOrSeries", "Series", "DataFrame")
27+
FrameOrSeries = TypeVar("FrameOrSeries", bound="NDFrame")
2828
Scalar = Union[str, int, float]
2929
Axis = Union[str, int]
3030
Ordered = Optional[bool]
31+
32+
# to maintain type information across generic functions and parametrization
33+
_T = TypeVar("_T")

0 commit comments

Comments
 (0)