From ac641ddbe82e8d549058926bfa47d3a6bb6a1489 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20W=C3=B6rtwein?= Date: Sat, 2 Oct 2021 10:16:59 -0400 Subject: [PATCH 1/2] TYP: enable reportPropertyTypeMismatch --- pandas/core/generic.py | 2 +- pyproject.toml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 7ff48a262c4d6..8220a213489c9 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -340,7 +340,7 @@ def attrs(self) -> dict[Hashable, Any]: return self._attrs @attrs.setter - def attrs(self, value: Mapping[Hashable, Any]) -> None: + def attrs(self, value: dict[Hashable, Any]) -> None: self._attrs = dict(value) @final diff --git a/pyproject.toml b/pyproject.toml index ae68e54ce1346..f329784d050e0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -166,7 +166,6 @@ reportOptionalOperand = false reportOptionalSubscript = false reportPrivateImportUsage = false reportPrivateUsage = false -reportPropertyTypeMismatch = false reportUnboundVariable = false reportUnknownArgumentType = false reportUnknownLambdaType = false From a68c93f0e0df56a25fb414cc974bbfe9e5a42177 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20W=C3=B6rtwein?= Date: Fri, 29 Oct 2021 12:20:37 -0400 Subject: [PATCH 2/2] keep Mapping --- pandas/core/generic.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 8220a213489c9..44cddd7bea81c 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -1,3 +1,4 @@ +# pyright: reportPropertyTypeMismatch=false from __future__ import annotations import collections @@ -340,7 +341,7 @@ def attrs(self) -> dict[Hashable, Any]: return self._attrs @attrs.setter - def attrs(self, value: dict[Hashable, Any]) -> None: + def attrs(self, value: Mapping[Hashable, Any]) -> None: self._attrs = dict(value) @final