Skip to content

Commit 0e817b7

Browse files
committed
Properly handle missing attributes in query/eval strings
1 parent 4018550 commit 0e817b7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pandas/core/computation/expr.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -635,8 +635,9 @@ def visit_Attribute(self, node, **kwargs):
635635
# something like datetime.datetime where scope is overridden
636636
if isinstance(value, ast.Name) and value.id == attr:
637637
return resolved
638+
raise
638639

639-
raise ValueError(f"Invalid Attribute context {ctx.__name__}")
640+
raise ValueError(f"Invalid Attribute context {ctx.__class__.__name__}")
640641

641642
def visit_Call(self, node, side=None, **kwargs):
642643

0 commit comments

Comments
 (0)