diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e4ab74091d6b6..dbddba57ef21c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -93,7 +93,7 @@ repos: types: [python] stages: [manual] additional_dependencies: &pyright_dependencies - - pyright@1.1.262 + - pyright@1.1.264 - id: pyright_reportGeneralTypeIssues # note: assumes python env is setup and activated name: pyright reportGeneralTypeIssues diff --git a/doc/source/whatsnew/v1.5.0.rst b/doc/source/whatsnew/v1.5.0.rst index d138ebb9c02a3..3d608f9e42cdf 100644 --- a/doc/source/whatsnew/v1.5.0.rst +++ b/doc/source/whatsnew/v1.5.0.rst @@ -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 | +-----------------+-----------------+----------+---------+ diff --git a/environment.yml b/environment.yml index fd0822b13984e..ec2e0a3860432 100644 --- a/environment.yml +++ b/environment.yml @@ -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 diff --git a/pandas/core/computation/expr.py b/pandas/core/computation/expr.py index 90824ce8d856f..ff3f259f49955 100644 --- a/pandas/core/computation/expr.py +++ b/pandas/core/computation/expr.py @@ -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) diff --git a/pandas/core/computation/ops.py b/pandas/core/computation/ops.py index db5f28e2ae6c1..e331fc89f69b7 100644 --- a/pandas/core/computation/ops.py +++ b/pandas/core/computation/ops.py @@ -10,6 +10,7 @@ from typing import ( Callable, Iterable, + Literal, ) import numpy as np @@ -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 diff --git a/requirements-dev.txt b/requirements-dev.txt index e1e98ef8ffe23..5a9647456cb0b 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -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