File tree Expand file tree Collapse file tree 5 files changed +34
-24
lines changed Expand file tree Collapse file tree 5 files changed +34
-24
lines changed Original file line number Diff line number Diff line change 77import datetime
88from functools import partial
99import operator
10- from typing import Any
10+ from typing import (
11+ TYPE_CHECKING ,
12+ Any ,
13+ )
1114
1215import numpy as np
1316
1922 ops as libops ,
2023)
2124from pandas ._libs .tslibs import BaseOffset
22- from pandas ._typing import (
23- ArrayLike ,
24- Shape ,
25- )
2625
2726from pandas .core .dtypes .cast import (
2827 construct_1d_object_array_from_listlike ,
5453from pandas .core .ops .dispatch import should_extension_dispatch
5554from pandas .core .ops .invalid import invalid_comparison
5655
56+ if TYPE_CHECKING :
57+ from pandas ._typing import (
58+ ArrayLike ,
59+ Shape ,
60+ )
61+
5762# -----------------------------------------------------------------------------
5863# Masking NA values and fallbacks for operations numpy does not support
5964
Original file line number Diff line number Diff line change 55
66from functools import wraps
77import sys
8- from typing import Callable
8+ from typing import (
9+ TYPE_CHECKING ,
10+ Callable ,
11+ )
912
1013from pandas ._libs .lib import item_from_zerodim
1114from pandas ._libs .missing import is_matching_na
12- from pandas ._typing import F
1315
1416from pandas .core .dtypes .generic import (
1517 ABCDataFrame ,
1618 ABCIndex ,
1719 ABCSeries ,
1820)
1921
22+ if TYPE_CHECKING :
23+ from pandas ._typing import F
24+
2025
2126def unpack_zerodim_and_defer (name : str ) -> Callable [[F ], F ]:
2227 """
Original file line number Diff line number Diff line change 33"""
44from __future__ import annotations
55
6- from typing import Any
7-
8- from pandas ._typing import ArrayLike
6+ from typing import (
7+ TYPE_CHECKING ,
8+ Any ,
9+ )
910
1011from pandas .core .dtypes .generic import ABCExtensionArray
1112
13+ if TYPE_CHECKING :
14+ from pandas ._typing import ArrayLike
15+
1216
1317def should_extension_dispatch (left : ArrayLike , right : Any ) -> bool :
1418 """
Original file line number Diff line number Diff line change 2020 lib ,
2121)
2222from 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- )
3223
3324from pandas .core .dtypes .common import (
3425 ensure_int64 ,
4435from pandas .core .construction import extract_array
4536
4637if TYPE_CHECKING :
38+ from pandas ._typing import (
39+ AxisInt ,
40+ IndexKeyFunc ,
41+ Level ,
42+ NaPosition ,
43+ Shape ,
44+ SortKind ,
45+ npt ,
46+ )
47+
4748 from pandas import MultiIndex
4849 from pandas .core .arrays import ExtensionArray
4950 from pandas .core .indexes .base import Index
Original file line number Diff line number Diff line change @@ -295,11 +295,6 @@ exclude = [
295295# TCH to be enabled gradually
296296"pandas/core/arrays/*" = [" TCH" ]
297297"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" ]
303298"pandas/util/*" = [" TCH" ]
304299"pandas/_libs/*" = [" TCH" ]
305300# Keep this one enabled
You can’t perform that action at this time.
0 commit comments