Skip to content

Commit

Permalink
Fix type annotations in pandas.core.computation (#26295)
Browse files Browse the repository at this point in the history
  • Loading branch information
gwrome authored and WillAyd committed May 8, 2019
1 parent 20fa58d commit 0f220d4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 15 deletions.
9 changes: 0 additions & 9 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,6 @@ ignore_errors=True
[mypy-pandas.core.api]
ignore_errors=True

[mypy-pandas.core.computation.expr]
ignore_errors=True

[mypy-pandas.core.computation.ops]
ignore_errors=True

[mypy-pandas.core.computation.pytables]
ignore_errors=True

[mypy-pandas.core.indexes.base]
ignore_errors=True

Expand Down
3 changes: 2 additions & 1 deletion pandas/core/computation/expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import itertools as it
import operator
import tokenize
from typing import Type

import numpy as np

Expand Down Expand Up @@ -327,7 +328,7 @@ class BaseExprVisitor(ast.NodeVisitor):
parser : str
preparser : callable
"""
const_type = Constant
const_type = Constant # type: Type[Term]
term_type = Term

binary_ops = _cmp_ops_syms + _bool_ops_syms + _arith_ops_syms
Expand Down
4 changes: 0 additions & 4 deletions pandas/core/computation/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,6 @@ def value(self, new_value):
def name(self):
return self._name

@name.setter
def name(self, new_name):
self._name = new_name

@property
def ndim(self):
return self._value.ndim
Expand Down
3 changes: 2 additions & 1 deletion pandas/core/computation/pytables.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ def _resolve_name(self):
except UndefinedVariableError:
return self.name

@property
# read-only property overwriting read/write property
@property # type: ignore
def value(self):
return self._value

Expand Down

0 comments on commit 0f220d4

Please sign in to comment.