Skip to content

Commit adcb36e

Browse files
authored
TYP: overload tz_to_dtype (#56260)
1 parent 6093074 commit adcb36e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pandas/core/arrays/datetimes.py

+11
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from typing import (
99
TYPE_CHECKING,
1010
cast,
11+
overload,
1112
)
1213
import warnings
1314

@@ -93,6 +94,16 @@
9394
_ITER_CHUNKSIZE = 10_000
9495

9596

97+
@overload
98+
def tz_to_dtype(tz: tzinfo, unit: str = ...) -> DatetimeTZDtype:
99+
...
100+
101+
102+
@overload
103+
def tz_to_dtype(tz: None, unit: str = ...) -> np.dtype[np.datetime64]:
104+
...
105+
106+
96107
def tz_to_dtype(
97108
tz: tzinfo | None, unit: str = "ns"
98109
) -> np.dtype[np.datetime64] | DatetimeTZDtype:

0 commit comments

Comments
 (0)