Skip to content

Commit f8d5a16

Browse files
authored
TYP: Remove unused mypy ignores (#61330)
* Remove unused mypy ignores * Remove another ignore
1 parent e5898b8 commit f8d5a16

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

Diff for: pandas/core/arrays/masked.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ def tolist(self) -> list:
515515
if self.ndim > 1:
516516
return [x.tolist() for x in self]
517517
dtype = None if self._hasna else self._data.dtype
518-
return self.to_numpy(dtype=dtype, na_value=libmissing.NA).tolist() # type: ignore[return-value]
518+
return self.to_numpy(dtype=dtype, na_value=libmissing.NA).tolist()
519519

520520
@overload
521521
def astype(self, dtype: npt.DTypeLike, copy: bool = ...) -> np.ndarray: ...

Diff for: pandas/core/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ def tolist(self) -> list:
875875
>>> idx.to_list()
876876
[1, 2, 3]
877877
"""
878-
return self._values.tolist() # type: ignore[return-value]
878+
return self._values.tolist()
879879

880880
to_list = tolist
881881

Diff for: pandas/core/groupby/generic.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2142,7 +2142,7 @@ def _wrap_applied_output_series(
21422142

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

21482148
if not self.as_index:

Diff for: pandas/io/formats/format.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1495,7 +1495,7 @@ def _format_strings(self) -> list[str]:
14951495
fmt_values = values._format_native_types(
14961496
na_rep=self.nat_rep, date_format=self.date_format
14971497
)
1498-
return fmt_values.tolist() # type: ignore[return-value]
1498+
return fmt_values.tolist()
14991499

15001500

15011501
class _ExtensionArrayFormatter(_GenericArrayFormatter):

Diff for: pandas/plotting/_matplotlib/style.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def _random_color(column: int) -> list[float]:
273273
"""Get a random color represented as a list of length 3"""
274274
# GH17525 use common._random_state to avoid resetting the seed
275275
rs = com.random_state(column)
276-
return rs.rand(3).tolist() # type: ignore[return-value]
276+
return rs.rand(3).tolist()
277277

278278

279279
def _is_single_string_color(color: Color) -> bool:

0 commit comments

Comments
 (0)