Skip to content

Commit 6ea4eed

Browse files
check_untyped_defs pandas.core.computation.expr (part)
1 parent 298c472 commit 6ea4eed

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

pandas/core/computation/expr.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import itertools as it
88
import operator
99
import tokenize
10-
from typing import Type
10+
from typing import Callable, Set, Tuple, Type, TypeVar
1111

1212
import numpy as np
1313

@@ -302,7 +302,7 @@ def f(self, *args, **kwargs):
302302
return f
303303

304304

305-
def disallow(nodes):
305+
def disallow(nodes: Set) -> Callable:
306306
"""Decorator to disallow certain nodes from parsing. Raises a
307307
NotImplementedError instead.
308308
@@ -311,7 +311,9 @@ def disallow(nodes):
311311
disallowed : callable
312312
"""
313313

314-
def disallowed(cls):
314+
_T = TypeVar("_T", bound="BaseExprVisitor")
315+
316+
def disallowed(cls: Type[_T]) -> Type[_T]:
315317
cls.unsupported_nodes = ()
316318
for node in nodes:
317319
new_method = _node_not_implemented(node, cls)
@@ -417,6 +419,8 @@ class BaseExprVisitor(ast.NodeVisitor):
417419
ast.NotIn: ast.NotIn,
418420
}
419421

422+
unsupported_nodes: Tuple[str, ...]
423+
420424
def __init__(self, env, engine, parser, preparser=_preparse):
421425
self.env = env
422426
self.engine = engine
@@ -712,7 +716,7 @@ def visit_Call(self, node, side=None, **kwargs):
712716
"arguments".format(name=res.name)
713717
)
714718

715-
return res(*new_args, **kwargs)
719+
return res(*new_args)
716720

717721
else:
718722

0 commit comments

Comments
 (0)