Skip to content

pandas 2.0 removals in testing and clipboard #933

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 6 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
15 changes: 2 additions & 13 deletions pandas-stubs/_testing/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,7 @@ from pandas import (
Series,
)

def assert_almost_equal(
left,
right,
check_dtype: bool | str = ...,
check_less_precise: bool | int = ...,
**kwargs,
): ...
def assert_almost_equal(left, right, check_dtype: bool | str = ..., **kwargs): ...
def assert_dict_equal(left, right, compare_keys: bool = ...): ...
def assert_index_equal(left: Index, right: Index) -> None: ...
def assert_class_equal(left, right, exact: bool | str = ..., obj=...): ...
Expand Down Expand Up @@ -48,11 +42,7 @@ def assert_numpy_array_equal(
obj: str = ...,
): ...
def assert_extension_array_equal(
left,
right,
check_dtype: bool = ...,
check_less_precise: bool = ...,
check_exact: bool = ...,
left, right, check_dtype: bool = ..., check_exact: bool = ...
) -> None: ...
@overload
def assert_series_equal(
Expand Down Expand Up @@ -103,7 +93,6 @@ def assert_frame_equal(
check_index_type: bool | Literal["equiv"] = ...,
check_column_type: bool | Literal["equiv"] = ...,
check_frame_type: bool = ...,
check_less_precise: int | bool = ...,
check_names: bool = ...,
by_blocks: bool = ...,
check_exact: bool = ...,
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/core/groupby/generic.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ class DataFrameGroupBy(GroupBy[DataFrame], Generic[ByT]):
) -> DataFrame: ...
# error: overload 1 overlaps overload 2 because of different return types
@overload
def aggregate(self, func: Literal["size"]) -> Series: ... # type: ignore[overload-overlap] # pyright: ignore[reportOverlappingOverload]
def aggregate(self, func: Literal["size"]) -> Series: ... # type: ignore[overload-overlap]
@overload
def aggregate(
self,
Expand Down
6 changes: 0 additions & 6 deletions pandas-stubs/io/clipboards.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ def read_clipboard(
encoding: str | None = ...,
encoding_errors: str | None = ...,
dialect: str | csv.Dialect = ...,
# error_bad_lines: bool | None = ..., # Deprecated: 1.3.0
# warn_bad_lines: bool | None = ..., # Deprecated: 1.3.0
on_bad_lines: (
Literal["error", "warn", "skip"] | Callable[[list[str]], list[str] | None]
) = ...,
Expand Down Expand Up @@ -137,8 +135,6 @@ def read_clipboard(
encoding: str | None = ...,
encoding_errors: str | None = ...,
dialect: str | csv.Dialect = ...,
# error_bad_lines: bool | None = ..., # Deprecated: 1.3.0
# warn_bad_lines: bool | None = ..., # Deprecated: 1.3.0
on_bad_lines: (
Literal["error", "warn", "skip"] | Callable[[list[str]], list[str] | None]
) = ...,
Expand Down Expand Up @@ -198,8 +194,6 @@ def read_clipboard(
encoding: str | None = ...,
encoding_errors: str | None = ...,
dialect: str | csv.Dialect = ...,
# error_bad_lines: bool | None = ..., # Deprecated: 1.3.0
# warn_bad_lines: bool | None = ..., # Deprecated: 1.3.0
on_bad_lines: (
Literal["error", "warn", "skip"] | Callable[[list[str]], list[str] | None]
) = ...,
Expand Down
31 changes: 16 additions & 15 deletions tests/test_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,22 +486,23 @@ def test_plot_scatter(close_figures) -> None:
),
Axes,
)
check(
assert_type(
IRIS_DF.plot.scatter(x="SepalLength", y="SepalWidth", subplots=True),
npt.NDArray[np.object_],
),
np.ndarray,
)
check(
assert_type(
IRIS_DF.plot(
x="SepalLength", y="SepalWidth", subplots=True, kind="scatter"
with pytest.warns(UserWarning):
check(
assert_type(
IRIS_DF.plot.scatter(x="SepalLength", y="SepalWidth", subplots=True),
npt.NDArray[np.object_],
),
npt.NDArray[np.object_],
),
np.ndarray,
)
np.ndarray,
)
check(
assert_type(
IRIS_DF.plot(
x="SepalLength", y="SepalWidth", subplots=True, kind="scatter"
),
npt.NDArray[np.object_],
),
np.ndarray,
)


def test_plot_keywords(close_figures):
Expand Down
Loading