Skip to content

Commit 55bb9af

Browse files
committed
mypy fixup
1 parent 202e3c4 commit 55bb9af

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pandas/core/computation/pytables.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
Any,
1414
ClassVar,
1515
Self,
16+
cast,
1617
)
1718

1819
import numpy as np
@@ -44,7 +45,10 @@
4445
)
4546

4647
if TYPE_CHECKING:
47-
from pandas._typing import npt
48+
from pandas._typing import (
49+
TimeUnit,
50+
npt,
51+
)
4852

4953

5054
class PyTablesScope(_scope.Scope):
@@ -230,7 +234,7 @@ def stringify(value):
230234
# test_append_with_timedelta gets here
231235
unit = "ns"
232236
if "[" in kind:
233-
unit = kind[-3:-1]
237+
unit = cast("TimeUnit", kind[-3:-1])
234238
if isinstance(conv_val, str):
235239
conv_val = Timedelta(conv_val)
236240
elif lib.is_integer(conv_val) or lib.is_float(conv_val):

0 commit comments

Comments
 (0)