Skip to content

Commit 563a37d

Browse files
check_untyped_defs pandas.core.computation.expressions
1 parent 874aa8c commit 563a37d

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

pandas/core/computation/expressions.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
77
"""
88

9+
from typing import Callable, List, Set
910
import warnings
1011

1112
import numpy as np
@@ -22,10 +23,10 @@
2223
import numexpr as ne
2324

2425
_TEST_MODE = None
25-
_TEST_RESULT = None
26+
_TEST_RESULT: List[bool]
2627
_USE_NUMEXPR = _NUMEXPR_INSTALLED
27-
_evaluate = None
28-
_where = None
28+
_evaluate: Callable
29+
_where: Callable
2930

3031
# the set of dtypes that we will allow pass to numexpr
3132
_ALLOWED_DTYPES = {
@@ -78,7 +79,7 @@ def _can_use_numexpr(op, op_str, a, b, dtype_check):
7879
# required min elements (otherwise we are adding overhead)
7980
if np.prod(a.shape) > _MIN_ELEMENTS:
8081
# check for dtype compatibility
81-
dtypes = set()
82+
dtypes: Set[str] = set()
8283
for o in [a, b]:
8384
# Series implements dtypes, check for dimension count as well
8485
if hasattr(o, "dtypes") and o.ndim > 1:
@@ -240,7 +241,7 @@ def where(cond, a, b, use_numexpr=True):
240241
return _where_standard(cond, a, b)
241242

242243

243-
def set_test_mode(v=True):
244+
def set_test_mode(v: bool = True) -> None:
244245
"""
245246
Keeps track of whether numexpr was used. Stores an additional ``True``
246247
for every successful use of evaluate with numexpr since the last

setup.cfg

-3
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,6 @@ check_untyped_defs=False
188188
[mypy-pandas.core.computation.expr]
189189
check_untyped_defs=False
190190

191-
[mypy-pandas.core.computation.expressions]
192-
check_untyped_defs=False
193-
194191
[mypy-pandas.core.computation.pytables]
195192
check_untyped_defs=False
196193

0 commit comments

Comments
 (0)