Skip to content

Commit 0f220d4

Browse files
gwromeWillAyd
authored andcommitted
Fix type annotations in pandas.core.computation (#26295)
1 parent 20fa58d commit 0f220d4

File tree

4 files changed

+4
-15
lines changed

4 files changed

+4
-15
lines changed

mypy.ini

-9
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,6 @@ ignore_errors=True
88
[mypy-pandas.core.api]
99
ignore_errors=True
1010

11-
[mypy-pandas.core.computation.expr]
12-
ignore_errors=True
13-
14-
[mypy-pandas.core.computation.ops]
15-
ignore_errors=True
16-
17-
[mypy-pandas.core.computation.pytables]
18-
ignore_errors=True
19-
2011
[mypy-pandas.core.indexes.base]
2112
ignore_errors=True
2213

pandas/core/computation/expr.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import itertools as it
88
import operator
99
import tokenize
10+
from typing import Type
1011

1112
import numpy as np
1213

@@ -327,7 +328,7 @@ class BaseExprVisitor(ast.NodeVisitor):
327328
parser : str
328329
preparser : callable
329330
"""
330-
const_type = Constant
331+
const_type = Constant # type: Type[Term]
331332
term_type = Term
332333

333334
binary_ops = _cmp_ops_syms + _bool_ops_syms + _arith_ops_syms

pandas/core/computation/ops.py

-4
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,6 @@ def value(self, new_value):
149149
def name(self):
150150
return self._name
151151

152-
@name.setter
153-
def name(self, new_name):
154-
self._name = new_name
155-
156152
@property
157153
def ndim(self):
158154
return self._value.ndim

pandas/core/computation/pytables.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ def _resolve_name(self):
5656
except UndefinedVariableError:
5757
return self.name
5858

59-
@property
59+
# read-only property overwriting read/write property
60+
@property # type: ignore
6061
def value(self):
6162
return self._value
6263

0 commit comments

Comments
 (0)