From 3c75b7f6912e62d468fa9f3f0f0a40123db19711 Mon Sep 17 00:00:00 2001 From: pyfra Date: Sat, 9 Nov 2024 14:37:26 +0000 Subject: [PATCH 1/2] added type ignore to _core.py --- pandas/plotting/_core.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandas/plotting/_core.py b/pandas/plotting/_core.py index b60392368d944..7a2796281cf5b 100644 --- a/pandas/plotting/_core.py +++ b/pandas/plotting/_core.py @@ -1038,7 +1038,9 @@ def __call__(self, *args, **kwargs): label_name = label_kw or y data.name = label_name else: - match = is_list_like(label_kw) and len(label_kw) == len(y) + # error: Argument 1 to "len" has incompatible type "Any | bool"; + # expected "Sized" [arg-type] + match = is_list_like(label_kw) and len(label_kw) == len(y) # type: ignore[arg-type] if label_kw and not match: raise ValueError( "label should be list-like and same length as y" From 2190f91ea03ab91027a1f8c9e65417483fbf53b6 Mon Sep 17 00:00:00 2001 From: pyfra Date: Sat, 9 Nov 2024 15:21:00 +0000 Subject: [PATCH 2/2] added type ignore in _get_common_dtype in dtypes.py --- pandas/core/dtypes/dtypes.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pandas/core/dtypes/dtypes.py b/pandas/core/dtypes/dtypes.py index 004a1aab5436e..ac46580a8cf30 100644 --- a/pandas/core/dtypes/dtypes.py +++ b/pandas/core/dtypes/dtypes.py @@ -2130,9 +2130,11 @@ def _get_common_dtype(self, dtypes: list[DtypeObj]) -> DtypeObj | None: PerformanceWarning, stacklevel=find_stack_level(), ) - np_dtypes = (x.subtype if isinstance(x, SparseDtype) else x for x in dtypes) - return SparseDtype(np_find_common_type(*np_dtypes), fill_value=fill_value) + # error: Argument 1 to "np_find_common_type" has incompatible type + # "*Generator[Any | dtype[Any] | ExtensionDtype, None, None]"; + # expected "dtype[Any]" [arg-type] + return SparseDtype(np_find_common_type(*np_dtypes), fill_value=fill_value) # type: ignore [arg-type] @register_extension_dtype