From 301242402c932584beb510a9f5e61cfd2484bf1a Mon Sep 17 00:00:00 2001 From: Nikolay Vasilev Date: Sat, 9 Nov 2024 12:36:10 +0000 Subject: [PATCH] Removed type ignores --- pandas/core/computation/ops.py | 3 +-- pandas/core/missing.py | 8 +------- pandas/io/common.py | 4 +--- pandas/plotting/_matplotlib/boxplot.py | 5 +---- pandas/plotting/_matplotlib/hist.py | 5 +---- 5 files changed, 5 insertions(+), 20 deletions(-) diff --git a/pandas/core/computation/ops.py b/pandas/core/computation/ops.py index a1a5f77f8539e..9b26de42e119b 100644 --- a/pandas/core/computation/ops.py +++ b/pandas/core/computation/ops.py @@ -76,8 +76,7 @@ class Term: def __new__(cls, name, env, side=None, encoding=None): klass = Constant if not isinstance(name, str) else cls - # error: Argument 2 for "super" not an instance of argument 1 - supr_new = super(Term, klass).__new__ # type: ignore[misc] + supr_new = super(Term, klass).__new__ return supr_new(klass) is_local: bool diff --git a/pandas/core/missing.py b/pandas/core/missing.py index 039d868bccd16..4170f35922198 100644 --- a/pandas/core/missing.py +++ b/pandas/core/missing.py @@ -413,13 +413,7 @@ def func(yvalues: np.ndarray) -> None: **kwargs, ) - # error: Argument 1 to "apply_along_axis" has incompatible type - # "Callable[[ndarray[Any, Any]], None]"; expected "Callable[..., - # Union[_SupportsArray[dtype[]], Sequence[_SupportsArray - # [dtype[]]], Sequence[Sequence[_SupportsArray[dtype[]]]], - # Sequence[Sequence[Sequence[_SupportsArray[dtype[]]]]], - # Sequence[Sequence[Sequence[Sequence[_SupportsArray[dtype[]]]]]]]]" - np.apply_along_axis(func, axis, data) # type: ignore[arg-type] + np.apply_along_axis(func, axis, data) def _index_to_interp_indices(index: Index, method: str) -> np.ndarray: diff --git a/pandas/io/common.py b/pandas/io/common.py index a76f0cf6dd34d..78fcdf8ff14b4 100644 --- a/pandas/io/common.py +++ b/pandas/io/common.py @@ -910,10 +910,8 @@ def get_handle( or not hasattr(handle, "seekable") ): handle = _IOWrapper(handle) - # error: Argument 1 to "TextIOWrapper" has incompatible type - # "_IOWrapper"; expected "IO[bytes]" handle = TextIOWrapper( - handle, # type: ignore[arg-type] + handle, encoding=ioargs.encoding, errors=errors, newline="", diff --git a/pandas/plotting/_matplotlib/boxplot.py b/pandas/plotting/_matplotlib/boxplot.py index 6bb10068bee38..68682344f98ca 100644 --- a/pandas/plotting/_matplotlib/boxplot.py +++ b/pandas/plotting/_matplotlib/boxplot.py @@ -198,10 +198,7 @@ def _make_plot(self, fig: Figure) -> None: else self.data ) - # error: Argument "data" to "_iter_data" of "MPLPlot" has - # incompatible type "object"; expected "DataFrame | - # dict[Hashable, Series | DataFrame]" - for i, (label, y) in enumerate(self._iter_data(data=data)): # type: ignore[arg-type] + for i, (label, y) in enumerate(self._iter_data(data=data)): ax = self._get_ax(i) kwds = self.kwds.copy() diff --git a/pandas/plotting/_matplotlib/hist.py b/pandas/plotting/_matplotlib/hist.py index 97e510982ab93..1a423ad49c294 100644 --- a/pandas/plotting/_matplotlib/hist.py +++ b/pandas/plotting/_matplotlib/hist.py @@ -137,10 +137,7 @@ def _make_plot(self, fig: Figure) -> None: if self.by is not None else self.data ) - - # error: Argument "data" to "_iter_data" of "MPLPlot" has incompatible - # type "object"; expected "DataFrame | dict[Hashable, Series | DataFrame]" - for i, (label, y) in enumerate(self._iter_data(data=data)): # type: ignore[arg-type] + for i, (label, y) in enumerate(self._iter_data(data=data)): ax = self._get_ax(i) kwds = self.kwds.copy()