Skip to content

CI/TYP: bump mypy and pyright #47806

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 4 commits into from
Aug 1, 2022
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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ repos:
types: [python]
stages: [manual]
additional_dependencies: &pyright_dependencies
- [email protected].262
- [email protected].264
- id: pyright_reportGeneralTypeIssues
# note: assumes python env is setup and activated
name: pyright reportGeneralTypeIssues
Expand Down
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v1.5.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ If installed, we now require:
+=================+=================+==========+=========+
| numpy | 1.19.5 | X | X |
+-----------------+-----------------+----------+---------+
| mypy (dev) | 0.960 | | X |
| mypy (dev) | 0.971 | | X |
+-----------------+-----------------+----------+---------+
| beautifulsoup4 | 4.9.3 | | X |
+-----------------+-----------------+----------+---------+
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ dependencies:
- flake8-bugbear=21.3.2 # used by flake8, find likely bugs
- flake8-comprehensions=3.7.0 # used by flake8, linting of unnecessary comprehensions
- isort>=5.2.1 # check that imports are in the right order
- mypy=0.960
- mypy=0.971
- pre-commit>=2.15.0
- pycodestyle # used by flake8
- pyupgrade
Expand Down
4 changes: 3 additions & 1 deletion pandas/core/computation/expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,9 @@ def __init__(

@disallow(_unsupported_nodes | _python_not_supported | frozenset(["Not"]))
class PythonExprVisitor(BaseExprVisitor):
def __init__(self, env, engine, parser, preparser=lambda x: x) -> None:
def __init__(
self, env, engine, parser, preparser=lambda source, f=None: source
) -> None:
super().__init__(env, engine, parser, preparser=preparser)


Expand Down
3 changes: 2 additions & 1 deletion pandas/core/computation/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from typing import (
Callable,
Iterable,
Literal,
)

import numpy as np
Expand Down Expand Up @@ -552,7 +553,7 @@ class UnaryOp(Op):
* If no function associated with the passed operator token is found.
"""

def __init__(self, op: str, operand) -> None:
def __init__(self, op: Literal["+", "-", "~", "not"], operand) -> None:
super().__init__(op, (operand,))
self.operand = operand

Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ flake8==4.0.1
flake8-bugbear==21.3.2
flake8-comprehensions==3.7.0
isort>=5.2.1
mypy==0.960
mypy==0.971
pre-commit>=2.15.0
pycodestyle
pyupgrade
Expand Down