Skip to content

Commit 4025929

Browse files
authored
Merge pull request pandas-dev#9 from pyfra/new_err_mypy
New err mypy
2 parents 500f006 + 2190f91 commit 4025929

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

pandas/core/dtypes/dtypes.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -2130,9 +2130,11 @@ def _get_common_dtype(self, dtypes: list[DtypeObj]) -> DtypeObj | None:
21302130
PerformanceWarning,
21312131
stacklevel=find_stack_level(),
21322132
)
2133-
21342133
np_dtypes = (x.subtype if isinstance(x, SparseDtype) else x for x in dtypes)
2135-
return SparseDtype(np_find_common_type(*np_dtypes), fill_value=fill_value)
2134+
# error: Argument 1 to "np_find_common_type" has incompatible type
2135+
# "*Generator[Any | dtype[Any] | ExtensionDtype, None, None]";
2136+
# expected "dtype[Any]" [arg-type]
2137+
return SparseDtype(np_find_common_type(*np_dtypes), fill_value=fill_value) # type: ignore [arg-type]
21362138

21372139

21382140
@register_extension_dtype

pandas/plotting/_core.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,9 @@ def __call__(self, *args, **kwargs):
10381038
label_name = label_kw or y
10391039
data.name = label_name
10401040
else:
1041-
match = is_list_like(label_kw) and len(label_kw) == len(y)
1041+
# error: Argument 1 to "len" has incompatible type "Any | bool";
1042+
# expected "Sized" [arg-type]
1043+
match = is_list_like(label_kw) and len(label_kw) == len(y) # type: ignore[arg-type]
10421044
if label_kw and not match:
10431045
raise ValueError(
10441046
"label should be list-like and same length as y"

0 commit comments

Comments
 (0)