Skip to content

TYP: Remove unused mypy ignores #61330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 21, 2025
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
2 changes: 1 addition & 1 deletion pandas/core/arrays/masked.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ def tolist(self) -> list:
if self.ndim > 1:
return [x.tolist() for x in self]
dtype = None if self._hasna else self._data.dtype
return self.to_numpy(dtype=dtype, na_value=libmissing.NA).tolist() # type: ignore[return-value]
return self.to_numpy(dtype=dtype, na_value=libmissing.NA).tolist()

@overload
def astype(self, dtype: npt.DTypeLike, copy: bool = ...) -> np.ndarray: ...
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ def tolist(self) -> list:
>>> idx.to_list()
[1, 2, 3]
"""
return self._values.tolist() # type: ignore[return-value]
return self._values.tolist()

to_list = tolist

Expand Down
2 changes: 1 addition & 1 deletion pandas/core/groupby/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2142,7 +2142,7 @@ def _wrap_applied_output_series(

if stacked_values.dtype == object:
# We'll have the DataFrame constructor do inference
stacked_values = stacked_values.tolist() # type: ignore[assignment]
stacked_values = stacked_values.tolist()
result = self.obj._constructor(stacked_values, index=index, columns=columns)

if not self.as_index:
Expand Down
2 changes: 1 addition & 1 deletion pandas/io/formats/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -1495,7 +1495,7 @@ def _format_strings(self) -> list[str]:
fmt_values = values._format_native_types(
na_rep=self.nat_rep, date_format=self.date_format
)
return fmt_values.tolist() # type: ignore[return-value]
return fmt_values.tolist()


class _ExtensionArrayFormatter(_GenericArrayFormatter):
Expand Down
2 changes: 1 addition & 1 deletion pandas/plotting/_matplotlib/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def _random_color(column: int) -> list[float]:
"""Get a random color represented as a list of length 3"""
# GH17525 use common._random_state to avoid resetting the seed
rs = com.random_state(column)
return rs.rand(3).tolist() # type: ignore[return-value]
return rs.rand(3).tolist()


def _is_single_string_color(color: Color) -> bool:
Expand Down
Loading