File tree 17 files changed +124
-109
lines changed
17 files changed +124
-109
lines changed Original file line number Diff line number Diff line change 4
4
"""
5
5
from __future__ import annotations
6
6
7
+ from typing import TYPE_CHECKING
8
+
7
9
import numpy as np
8
10
9
11
from pandas ._libs .lib import i8max
14
16
Timestamp ,
15
17
iNaT ,
16
18
)
17
- from pandas ._typing import npt
19
+
20
+ if TYPE_CHECKING :
21
+ from pandas ._typing import npt
18
22
19
23
20
24
def generate_regular_range (
Original file line number Diff line number Diff line change 8
8
)
9
9
from decimal import Decimal
10
10
import re
11
+ from typing import TYPE_CHECKING
11
12
12
13
import numpy as np
13
14
14
15
from pandas ._libs .tslibs import (
15
16
Timedelta ,
16
17
Timestamp ,
17
18
)
18
- from pandas ._typing import (
19
- TYPE_CHECKING ,
20
- DtypeObj ,
21
- type_t ,
22
- )
23
19
from pandas .compat import pa_version_under7p0
24
20
from pandas .util ._decorators import cache_readonly
25
21
33
29
import pyarrow as pa
34
30
35
31
if TYPE_CHECKING :
32
+ from pandas ._typing import (
33
+ DtypeObj ,
34
+ type_t ,
35
+ )
36
+
36
37
from pandas .core .arrays .arrow import ArrowExtensionArray
37
38
38
39
Original file line number Diff line number Diff line change 1
1
from __future__ import annotations
2
2
3
3
import json
4
+ from typing import TYPE_CHECKING
4
5
5
6
import pyarrow
6
7
7
- from pandas ._typing import IntervalClosedType
8
-
9
8
from pandas .core .arrays .interval import VALID_CLOSED
10
9
10
+ if TYPE_CHECKING :
11
+ from pandas ._typing import IntervalClosedType
12
+
11
13
12
14
class ArrowPeriodType (pyarrow .ExtensionType ):
13
15
def __init__ (self , freq ) -> None :
Original file line number Diff line number Diff line change 25
25
import numpy as np
26
26
27
27
from pandas ._libs import lib
28
- from pandas ._typing import (
29
- ArrayLike ,
30
- AstypeArg ,
31
- AxisInt ,
32
- Dtype ,
33
- FillnaOptions ,
34
- PositionalIndexer ,
35
- ScalarIndexer ,
36
- SequenceIndexer ,
37
- Shape ,
38
- SortKind ,
39
- TakeIndexer ,
40
- npt ,
41
- )
42
28
from pandas .compat import set_function_name
43
29
from pandas .compat .numpy import function as nv
44
30
from pandas .errors import AbstractMethodError
90
76
91
77
if TYPE_CHECKING :
92
78
from pandas ._typing import (
79
+ ArrayLike ,
80
+ AstypeArg ,
81
+ AxisInt ,
82
+ Dtype ,
83
+ FillnaOptions ,
93
84
NumpySorter ,
94
85
NumpyValueArrayLike ,
86
+ PositionalIndexer ,
87
+ ScalarIndexer ,
88
+ SequenceIndexer ,
89
+ Shape ,
90
+ SortKind ,
91
+ TakeIndexer ,
92
+ npt ,
95
93
)
96
94
97
95
_extension_array_shared_docs : dict [str , str ] = {}
Original file line number Diff line number Diff line change 12
12
lib ,
13
13
missing as libmissing ,
14
14
)
15
- from pandas ._typing import (
16
- Dtype ,
17
- DtypeObj ,
18
- type_t ,
19
- )
20
15
21
16
from pandas .core .dtypes .common import (
22
17
is_list_like ,
35
30
if TYPE_CHECKING :
36
31
import pyarrow
37
32
38
- from pandas ._typing import npt
33
+ from pandas ._typing import (
34
+ Dtype ,
35
+ DtypeObj ,
36
+ npt ,
37
+ type_t ,
38
+ )
39
39
40
40
41
41
@register_extension_dtype
Original file line number Diff line number Diff line change 25
25
lib ,
26
26
)
27
27
from pandas ._libs .arrays import NDArrayBacked
28
- from pandas ._typing import (
29
- ArrayLike ,
30
- AstypeArg ,
31
- AxisInt ,
32
- Dtype ,
33
- NpDtype ,
34
- Ordered ,
35
- Shape ,
36
- SortKind ,
37
- npt ,
38
- type_t ,
39
- )
40
28
from pandas .compat .numpy import function as nv
41
29
from pandas .util ._validators import validate_bool_kwarg
42
30
109
97
from pandas .io .formats import console
110
98
111
99
if TYPE_CHECKING :
100
+ from pandas ._typing import (
101
+ ArrayLike ,
102
+ AstypeArg ,
103
+ AxisInt ,
104
+ Dtype ,
105
+ NpDtype ,
106
+ Ordered ,
107
+ Shape ,
108
+ SortKind ,
109
+ npt ,
110
+ type_t ,
111
+ )
112
+
112
113
from pandas import (
113
114
DataFrame ,
114
115
Index ,
Original file line number Diff line number Diff line change 42
42
tzconversion ,
43
43
)
44
44
from pandas ._libs .tslibs .dtypes import abbrev_to_npy_unit
45
- from pandas ._typing import (
46
- DateTimeErrorChoices ,
47
- IntervalClosedType ,
48
- TimeAmbiguous ,
49
- TimeNonexistent ,
50
- npt ,
51
- )
52
45
from pandas .errors import PerformanceWarning
53
46
from pandas .util ._exceptions import find_stack_level
54
47
from pandas .util ._validators import validate_inclusive
87
80
)
88
81
89
82
if TYPE_CHECKING :
83
+ from pandas ._typing import (
84
+ DateTimeErrorChoices ,
85
+ IntervalClosedType ,
86
+ TimeAmbiguous ,
87
+ TimeNonexistent ,
88
+ npt ,
89
+ )
90
+
90
91
from pandas import DataFrame
91
92
from pandas .core .arrays import PeriodArray
92
93
Original file line number Diff line number Diff line change 15
15
lib ,
16
16
missing as libmissing ,
17
17
)
18
- from pandas ._typing import (
19
- Dtype ,
20
- DtypeObj ,
21
- npt ,
22
- )
23
18
from pandas .errors import AbstractMethodError
24
19
from pandas .util ._decorators import cache_readonly
25
20
40
35
if TYPE_CHECKING :
41
36
import pyarrow
42
37
38
+ from pandas ._typing import (
39
+ Dtype ,
40
+ DtypeObj ,
41
+ npt ,
42
+ )
43
+
43
44
44
45
T = TypeVar ("T" , bound = "NumericArray" )
45
46
Original file line number Diff line number Diff line change 1
1
from __future__ import annotations
2
2
3
+ from typing import TYPE_CHECKING
4
+
3
5
import numpy as np
4
6
5
7
from pandas ._libs import lib
6
8
from pandas ._libs .tslibs import (
7
9
get_unit_from_dtype ,
8
10
is_supported_unit ,
9
11
)
10
- from pandas ._typing import (
11
- AxisInt ,
12
- Dtype ,
13
- NpDtype ,
14
- Scalar ,
15
- npt ,
16
- )
17
12
from pandas .compat .numpy import function as nv
18
13
19
14
from pandas .core .dtypes .astype import astype_array
35
30
from pandas .core .construction import ensure_wrapped_if_datetimelike
36
31
from pandas .core .strings .object_array import ObjectStringArrayMixin
37
32
33
+ if TYPE_CHECKING :
34
+ from pandas ._typing import (
35
+ AxisInt ,
36
+ Dtype ,
37
+ NpDtype ,
38
+ Scalar ,
39
+ npt ,
40
+ )
41
+
38
42
39
43
class PandasArray (
40
44
OpsMixin ,
Original file line number Diff line number Diff line change 45
45
get_period_field_arr ,
46
46
period_asfreq_arr ,
47
47
)
48
- from pandas ._typing import (
49
- AnyArrayLike ,
50
- Dtype ,
51
- NpDtype ,
52
- npt ,
53
- )
54
48
from pandas .util ._decorators import (
55
49
cache_readonly ,
56
50
doc ,
81
75
82
76
if TYPE_CHECKING :
83
77
from pandas ._typing import (
78
+ AnyArrayLike ,
79
+ Dtype ,
80
+ NpDtype ,
84
81
NumpySorter ,
85
82
NumpyValueArrayLike ,
83
+ npt ,
86
84
)
87
85
88
86
from pandas .core .arrays import (
Original file line number Diff line number Diff line change 28
28
SparseIndex ,
29
29
)
30
30
from pandas ._libs .tslibs import NaT
31
- from pandas ._typing import (
32
- ArrayLike ,
33
- AstypeArg ,
34
- Axis ,
35
- AxisInt ,
36
- Dtype ,
37
- NpDtype ,
38
- PositionalIndexer ,
39
- Scalar ,
40
- ScalarIndexer ,
41
- SequenceIndexer ,
42
- npt ,
43
- )
44
31
from pandas .compat .numpy import function as nv
45
32
from pandas .errors import PerformanceWarning
46
33
from pandas .util ._exceptions import find_stack_level
@@ -117,6 +104,20 @@ class ellipsis(Enum):
117
104
118
105
SparseIndexKind = Literal ["integer" , "block" ]
119
106
107
+ from pandas ._typing import (
108
+ ArrayLike ,
109
+ AstypeArg ,
110
+ Axis ,
111
+ AxisInt ,
112
+ Dtype ,
113
+ NpDtype ,
114
+ PositionalIndexer ,
115
+ Scalar ,
116
+ ScalarIndexer ,
117
+ SequenceIndexer ,
118
+ npt ,
119
+ )
120
+
120
121
from pandas import Series
121
122
122
123
else :
Original file line number Diff line number Diff line change 10
10
11
11
import numpy as np
12
12
13
- from pandas ._typing import (
14
- Dtype ,
15
- DtypeObj ,
16
- type_t ,
17
- )
18
13
from pandas .errors import PerformanceWarning
19
14
from pandas .util ._exceptions import find_stack_level
20
15
36
31
)
37
32
38
33
if TYPE_CHECKING :
34
+ from pandas ._typing import (
35
+ Dtype ,
36
+ DtypeObj ,
37
+ type_t ,
38
+ )
39
+
39
40
from pandas .core .arrays .sparse .array import SparseArray
40
41
41
42
Original file line number Diff line number Diff line change 10
10
Iterable ,
11
11
)
12
12
13
- import numpy as np
14
-
15
13
from pandas ._libs import lib
16
- from pandas ._typing import (
17
- IndexLabel ,
18
- npt ,
19
- )
20
14
21
15
from pandas .core .dtypes .missing import notna
22
16
25
19
from pandas .core .series import Series
26
20
27
21
if TYPE_CHECKING :
22
+ import numpy as np
28
23
import scipy .sparse
29
24
25
+ from pandas ._typing import (
26
+ IndexLabel ,
27
+ npt ,
28
+ )
29
+
30
30
31
31
def _check_is_partition (parts : Iterable , whole : Iterable ):
32
32
whole = set (whole )
You can’t perform that action at this time.
0 commit comments