We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 202e3c4 commit 55bb9afCopy full SHA for 55bb9af
pandas/core/computation/pytables.py
@@ -13,6 +13,7 @@
13
Any,
14
ClassVar,
15
Self,
16
+ cast,
17
)
18
19
import numpy as np
@@ -44,7 +45,10 @@
44
45
46
47
if TYPE_CHECKING:
- from pandas._typing import npt
48
+ from pandas._typing import (
49
+ TimeUnit,
50
+ npt,
51
+ )
52
53
54
class PyTablesScope(_scope.Scope):
@@ -230,7 +234,7 @@ def stringify(value):
230
234
# test_append_with_timedelta gets here
231
235
unit = "ns"
232
236
if "[" in kind:
233
- unit = kind[-3:-1]
237
+ unit = cast("TimeUnit", kind[-3:-1])
238
if isinstance(conv_val, str):
239
conv_val = Timedelta(conv_val)
240
elif lib.is_integer(conv_val) or lib.is_float(conv_val):
0 commit comments