Skip to content
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
6 changes: 4 additions & 2 deletions pandas/core/dtypes/dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion pandas/plotting/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down