Skip to content

Commit

Permalink
Merge pull request pandas-dev#1 from nvasilev/update_mypy
Browse files Browse the repository at this point in the history
Removed type ignores
  • Loading branch information
dl-lim authored Nov 9, 2024
2 parents 3bd4425 + 3012424 commit ab4b1e0
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 20 deletions.
3 changes: 1 addition & 2 deletions pandas/core/computation/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 1 addition & 7 deletions pandas/core/missing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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[<nothing>]], Sequence[_SupportsArray
# [dtype[<nothing>]]], Sequence[Sequence[_SupportsArray[dtype[<nothing>]]]],
# Sequence[Sequence[Sequence[_SupportsArray[dtype[<nothing>]]]]],
# Sequence[Sequence[Sequence[Sequence[_SupportsArray[dtype[<nothing>]]]]]]]]"
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:
Expand Down
4 changes: 1 addition & 3 deletions pandas/io/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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="",
Expand Down
5 changes: 1 addition & 4 deletions pandas/plotting/_matplotlib/boxplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
5 changes: 1 addition & 4 deletions pandas/plotting/_matplotlib/hist.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit ab4b1e0

Please sign in to comment.