Skip to content

Commit 7d5425f

Browse files
jbrockmendeljreback
authored andcommitted
PERF: lazify type-check import (#28342)
1 parent df3d9b2 commit 7d5425f

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

pandas/io/formats/format.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import codecs
77
from contextlib import contextmanager
8+
from datetime import tzinfo
89
import decimal
910
from functools import partial
1011
from io import StringIO
@@ -27,8 +28,6 @@
2728
)
2829
from unicodedata import east_asian_width
2930

30-
from dateutil.tz.tz import tzutc
31-
from dateutil.zoneinfo import tzfile
3231
import numpy as np
3332

3433
from pandas._config.config import get_option, set_option
@@ -1552,9 +1551,7 @@ def _is_dates_only(
15521551

15531552

15541553
def _format_datetime64(
1555-
x: Union[NaTType, Timestamp],
1556-
tz: Optional[Union[tzfile, tzutc]] = None,
1557-
nat_rep: str = "NaT",
1554+
x: Union[NaTType, Timestamp], tz: Optional[tzinfo] = None, nat_rep: str = "NaT"
15581555
) -> str:
15591556
if x is None or (is_scalar(x) and isna(x)):
15601557
return nat_rep

0 commit comments

Comments
 (0)