File tree 5 files changed +34
-24
lines changed
5 files changed +34
-24
lines changed Original file line number Diff line number Diff line change 7
7
import datetime
8
8
from functools import partial
9
9
import operator
10
- from typing import Any
10
+ from typing import (
11
+ TYPE_CHECKING ,
12
+ Any ,
13
+ )
11
14
12
15
import numpy as np
13
16
19
22
ops as libops ,
20
23
)
21
24
from pandas ._libs .tslibs import BaseOffset
22
- from pandas ._typing import (
23
- ArrayLike ,
24
- Shape ,
25
- )
26
25
27
26
from pandas .core .dtypes .cast import (
28
27
construct_1d_object_array_from_listlike ,
54
53
from pandas .core .ops .dispatch import should_extension_dispatch
55
54
from pandas .core .ops .invalid import invalid_comparison
56
55
56
+ if TYPE_CHECKING :
57
+ from pandas ._typing import (
58
+ ArrayLike ,
59
+ Shape ,
60
+ )
61
+
57
62
# -----------------------------------------------------------------------------
58
63
# Masking NA values and fallbacks for operations numpy does not support
59
64
Original file line number Diff line number Diff line change 5
5
6
6
from functools import wraps
7
7
import sys
8
- from typing import Callable
8
+ from typing import (
9
+ TYPE_CHECKING ,
10
+ Callable ,
11
+ )
9
12
10
13
from pandas ._libs .lib import item_from_zerodim
11
14
from pandas ._libs .missing import is_matching_na
12
- from pandas ._typing import F
13
15
14
16
from pandas .core .dtypes .generic import (
15
17
ABCDataFrame ,
16
18
ABCIndex ,
17
19
ABCSeries ,
18
20
)
19
21
22
+ if TYPE_CHECKING :
23
+ from pandas ._typing import F
24
+
20
25
21
26
def unpack_zerodim_and_defer (name : str ) -> Callable [[F ], F ]:
22
27
"""
Original file line number Diff line number Diff line change 3
3
"""
4
4
from __future__ import annotations
5
5
6
- from typing import Any
7
-
8
- from pandas ._typing import ArrayLike
6
+ from typing import (
7
+ TYPE_CHECKING ,
8
+ Any ,
9
+ )
9
10
10
11
from pandas .core .dtypes .generic import ABCExtensionArray
11
12
13
+ if TYPE_CHECKING :
14
+ from pandas ._typing import ArrayLike
15
+
12
16
13
17
def should_extension_dispatch (left : ArrayLike , right : Any ) -> bool :
14
18
"""
Original file line number Diff line number Diff line change 20
20
lib ,
21
21
)
22
22
from pandas ._libs .hashtable import unique_label_indices
23
- from pandas ._typing import (
24
- AxisInt ,
25
- IndexKeyFunc ,
26
- Level ,
27
- NaPosition ,
28
- Shape ,
29
- SortKind ,
30
- npt ,
31
- )
32
23
33
24
from pandas .core .dtypes .common import (
34
25
ensure_int64 ,
44
35
from pandas .core .construction import extract_array
45
36
46
37
if TYPE_CHECKING :
38
+ from pandas ._typing import (
39
+ AxisInt ,
40
+ IndexKeyFunc ,
41
+ Level ,
42
+ NaPosition ,
43
+ Shape ,
44
+ SortKind ,
45
+ npt ,
46
+ )
47
+
47
48
from pandas import MultiIndex
48
49
from pandas .core .arrays import ExtensionArray
49
50
from pandas .core .indexes .base import Index
Original file line number Diff line number Diff line change @@ -295,11 +295,6 @@ exclude = [
295
295
# TCH to be enabled gradually
296
296
"pandas/core/arrays/*" = [" TCH" ]
297
297
"pandas/core/nanops.py" = [" TCH" ]
298
- "pandas/core/apply.py" = [" TCH" ]
299
- "pandas/core/base.py" = [" TCH" ]
300
- "pandas/core/algorithms.py" = [" TCH" ]
301
- "pandas/core/ops/*" = [" TCH" ]
302
- "pandas/core/sorting.py" = [" TCH" ]
303
298
"pandas/util/*" = [" TCH" ]
304
299
"pandas/_libs/*" = [" TCH" ]
305
300
# Keep this one enabled
You can’t perform that action at this time.
0 commit comments