Skip to content

Commit 64004bc

Browse files
committed
BUG: Fix bug when using eval to call "str" methods
1 parent 8f22ebc commit 64004bc

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

pandas/core/computation/expr.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -632,11 +632,8 @@ def visit_Call_35(self, node, side=None, **kwargs):
632632
if not isinstance(key, ast.keyword):
633633
raise ValueError("keyword error in function call "
634634
"'{func}'".format(func=node.func.id))
635-
636635
if key.arg:
637-
# TODO: bug?
638-
kwargs.append(ast.keyword(
639-
keyword.arg, self.visit(keyword.value))) # noqa
636+
kwargs[key.arg] = self.visit(key.value)()
640637

641638
return self.const_type(res(*new_args, **kwargs), self.env)
642639

0 commit comments

Comments
 (0)