Skip to content

Commit 4b99525

Browse files
authored
CLN: values_from_object in computation.pytables (#32557)
1 parent 03b1f19 commit 4b99525

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pandas/core/computation/pytables.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from pandas.core.computation.common import _ensure_decoded
1818
from pandas.core.computation.expr import BaseExprVisitor
1919
from pandas.core.computation.ops import UndefinedVariableError, is_term
20+
from pandas.core.construction import extract_array
2021

2122
from pandas.io.formats.printing import pprint_thing, pprint_thing_encoded
2223

@@ -202,7 +203,7 @@ def stringify(value):
202203
v = Timedelta(v, unit="s").value
203204
return TermValue(int(v), v, kind)
204205
elif meta == "category":
205-
metadata = com.values_from_object(self.metadata)
206+
metadata = extract_array(self.metadata, extract_numpy=True)
206207
result = metadata.searchsorted(v, side="left")
207208

208209
# result returns 0 if v is first element or if v is not in metadata

0 commit comments

Comments
 (0)