Skip to content

Commit 9f72713

Browse files
committed
move types for 'data' in from 'pandas._typing'
1 parent c54642f commit 9f72713

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

pandas/_typing.py

-3
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,5 @@
3232
# Type for index and columns of DataFrame
3333
Axes = Iterable[Union[ABCIndexClass, Iterable[str]]]
3434

35-
# Type for data of DataFrame
36-
Data = TypeVar("Data", ABCDataFrame, dict, np.ndarray)
37-
3835
FrameOrSeries = TypeVar("FrameOrSeries", ABCSeries, ABCDataFrame)
3936
Scalar = Union[str, int, float]

pandas/core/frame.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import itertools
1616
import sys
1717
from textwrap import dedent
18-
from typing import FrozenSet, List, Optional, Set, Tuple, Type, Union
18+
from typing import Any, FrozenSet, Iterable, List, Optional, Set, Tuple, Type, Union
1919
import warnings
2020

2121
import numpy as np
@@ -80,7 +80,7 @@
8080
)
8181
from pandas.core.dtypes.missing import isna, notna
8282

83-
from pandas._typing import Axes, Data, Dtype
83+
from pandas._typing import Axes, Dtype
8484
from pandas.core import algorithms, common as com, nanops, ops
8585
from pandas.core.accessor import CachedAccessor
8686
from pandas.core.arrays import Categorical, ExtensionArray
@@ -391,7 +391,8 @@ def _constructor_expanddim(self):
391391
# Constructors
392392

393393
def __init__(self,
394-
data: Optional[Data] = None,
394+
data: Optional[Union[np.ndarray, dict,
395+
'DataFrame']] = None,
395396
index: Optional[Axes] = None,
396397
columns: Optional[Axes] = None,
397398
dtype: Optional[Dtype] = None,

0 commit comments

Comments
 (0)