Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
8 changes: 4 additions & 4 deletions pandas-stubs/core/generic.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ class NDFrame(indexing.IndexingMixin):
*,
axis: Axis = ...,
index: Hashable | Sequence[Hashable] | Index[Any] = ...,
columns: Hashable | Sequence[Hashable] | Index[Any],
columns: Hashable | Iterable[Hashable],
level: Level | None = ...,
inplace: Literal[True],
errors: IgnoreRaise = ...,
Expand All @@ -301,7 +301,7 @@ class NDFrame(indexing.IndexingMixin):
*,
axis: Axis = ...,
index: Hashable | Sequence[Hashable] | Index[Any],
columns: Hashable | Sequence[Hashable] | Index[Any] = ...,
columns: Hashable | Iterable[Hashable] = ...,
level: Level | None = ...,
inplace: Literal[True],
errors: IgnoreRaise = ...,
Expand All @@ -325,7 +325,7 @@ class NDFrame(indexing.IndexingMixin):
*,
axis: Axis = ...,
index: Hashable | Sequence[Hashable] | Index[Any] = ...,
columns: Hashable | Sequence[Hashable] | Index[Any],
columns: Hashable | Iterable[Hashable],
level: Level | None = ...,
inplace: Literal[False] = ...,
errors: IgnoreRaise = ...,
Expand All @@ -337,7 +337,7 @@ class NDFrame(indexing.IndexingMixin):
*,
axis: Axis = ...,
index: Hashable | Sequence[Hashable] | Index[Any],
columns: Hashable | Sequence[Hashable] | Index[Any] = ...,
columns: Hashable | Iterable[Hashable] = ...,
level: Level | None = ...,
inplace: Literal[False] = ...,
errors: IgnoreRaise = ...,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,9 @@ def test_types_drop() -> None:
df = pd.DataFrame(data={"col1": [1, 2], "col2": [3, 4]})
check(assert_type(df.drop("col1", axis=1), pd.DataFrame), pd.DataFrame)
check(assert_type(df.drop(columns=["col1"]), pd.DataFrame), pd.DataFrame)
check(assert_type(df.drop(columns=iter(["col1"])), pd.DataFrame), pd.DataFrame)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iter might be the easiest way to make an iterable

check(assert_type(df.drop([0]), pd.DataFrame), pd.DataFrame)
check(assert_type(df.drop(index=[0]), pd.DataFrame), pd.DataFrame)
check(assert_type(df.drop(columns=["col1"]), pd.DataFrame), pd.DataFrame)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed since it duplicates L346 above

check(assert_type(df.drop(index=1), pd.DataFrame), pd.DataFrame)
check(assert_type(df.drop(labels=0), pd.DataFrame), pd.DataFrame)
assert assert_type(df.drop([0, 0], inplace=True), None) is None
Expand Down