Skip to content

Commit

Permalink
TYP: overload tz_to_dtype (#56260)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrockmendel authored Nov 30, 2023
1 parent 6093074 commit adcb36e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pandas/core/arrays/datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from typing import (
TYPE_CHECKING,
cast,
overload,
)
import warnings

Expand Down Expand Up @@ -93,6 +94,16 @@
_ITER_CHUNKSIZE = 10_000


@overload
def tz_to_dtype(tz: tzinfo, unit: str = ...) -> DatetimeTZDtype:
...


@overload
def tz_to_dtype(tz: None, unit: str = ...) -> np.dtype[np.datetime64]:
...


def tz_to_dtype(
tz: tzinfo | None, unit: str = "ns"
) -> np.dtype[np.datetime64] | DatetimeTZDtype:
Expand Down

0 comments on commit adcb36e

Please sign in to comment.