Skip to content

Fix type annotations in pandas.core.computation #26295

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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