Skip to content

Commit 409767f

Browse files
committed
Remove dependency on typing_extension
1 parent 7ed158c commit 409767f

File tree

7 files changed

+5
-25
lines changed

7 files changed

+5
-25
lines changed

environment.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,5 +122,4 @@ dependencies:
122122
- pip:
123123
- adbc-driver-postgresql>=0.10.0
124124
- adbc-driver-sqlite>=0.8.0
125-
- typing_extensions; python_version<"3.11"
126125
- tzdata>=2023.3

pandas/_libs/tslibs/dtypes.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from enum import Enum
2-
3-
from pandas._typing import Self
2+
from typing import Self
43

54
OFFSET_TO_PERIOD_FREQSTR: dict[str, str]
65

pandas/_typing.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
tzinfo,
1717
)
1818
from os import PathLike
19-
import sys
2019
from typing import (
2120
TYPE_CHECKING,
2221
Any,
@@ -93,20 +92,10 @@
9392
from typing import TypeGuard # pyright: ignore[reportUnusedImport]
9493

9594
P = ParamSpec("P")
96-
97-
if sys.version_info >= (3, 11):
98-
from typing import Self # pyright: ignore[reportUnusedImport]
99-
from typing import Unpack # pyright: ignore[reportUnusedImport]
100-
else:
101-
from typing_extensions import Self # pyright: ignore[reportUnusedImport]
102-
from typing_extensions import Unpack # pyright: ignore[reportUnusedImport]
103-
10495
else:
10596
ParamSpec: Any = None
106-
Self: Any = None
10797
TypeGuard: Any = None
10898
Concatenate: Any = None
109-
Unpack: Any = None
11099

111100
HashableT = TypeVar("HashableT", bound=Hashable)
112101
HashableT2 = TypeVar("HashableT2", bound=Hashable)

pandas/core/_numba/extensions.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
from contextlib import contextmanager
1414
import operator
15-
from typing import TYPE_CHECKING
15+
from typing import Self
1616

1717
import numba
1818
from numba import types
@@ -41,9 +41,6 @@
4141
from pandas.core.internals import SingleBlockManager
4242
from pandas.core.series import Series
4343

44-
if TYPE_CHECKING:
45-
from pandas._typing import Self
46-
4744

4845
# Helper function to hack around fact that Index casts numpy string dtype to object
4946
#

pandas/core/indexes/frozen.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,14 @@
1010
from __future__ import annotations
1111

1212
from typing import (
13-
TYPE_CHECKING,
1413
NoReturn,
14+
Self,
1515
)
1616

1717
from pandas.core.base import PandasObject
1818

1919
from pandas.io.formats.printing import pprint_thing
2020

21-
if TYPE_CHECKING:
22-
from pandas._typing import Self
23-
2421

2522
class FrozenList(PandasObject, list):
2623
"""

pandas/io/parsers/readers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
Any,
2020
Generic,
2121
Literal,
22+
Self,
2223
TypedDict,
24+
Unpack,
2325
overload,
2426
)
2527
import warnings
@@ -89,9 +91,7 @@
8991
HashableT,
9092
IndexLabel,
9193
ReadCsvBuffer,
92-
Self,
9394
StorageOptions,
94-
Unpack,
9595
UsecolsArgType,
9696
)
9797

requirements-dev.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,4 @@ jupyterlite-core
8585
jupyterlite-pyodide-kernel
8686
adbc-driver-postgresql>=0.10.0
8787
adbc-driver-sqlite>=0.8.0
88-
typing_extensions; python_version<"3.11"
8988
tzdata>=2023.3

0 commit comments

Comments
 (0)