Skip to content

Commit fe9ce7b

Browse files
committed
Disallow .__call__() as workaround for non-named functions
1 parent 1193331 commit fe9ce7b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/core/computation/expr.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ def visit_Attribute(self, node, **kwargs):
640640

641641
def visit_Call(self, node, side=None, **kwargs):
642642

643-
if isinstance(node.func, ast.Attribute):
643+
if isinstance(node.func, ast.Attribute) and node.func.attr != "__call__":
644644
res = self.visit_Attribute(node.func)
645645
elif not isinstance(node.func, ast.Name):
646646
raise TypeError("Only named functions are supported")

0 commit comments

Comments
 (0)