Skip to content
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
1 change: 1 addition & 0 deletions pandas-stubs/core/frame.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1295,6 +1295,7 @@ class DataFrame(NDFrame, OpsMixin):
dropna: _bool = ...,
margins_name: _str = ...,
observed: _bool = ...,
sort: _bool = ...,
) -> DataFrame: ...
@overload
def stack(
Expand Down
10 changes: 10 additions & 0 deletions tests/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -1087,6 +1087,16 @@ def test_types_pivot_table() -> None:
pd.DataFrame,
)

def test_pivot_table_sort():
df = DataFrame(
{'a': [1, 2],
'b': [3, 4],
'c': [5, 6],
'd': [7, 8]}
)
check(assert_type(df.pivot_table(values='a', index='b', columns='c', sort=True),
Copy link
Collaborator

Choose a reason for hiding this comment

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

You need to use double quotes here.

Be sure to follow the instructions at https://github.com/pandas-dev/pandas-stubs/blob/main/docs/setup.md to set up your environment. And run tests as shown here: https://github.com/pandas-dev/pandas-stubs/blob/main/docs/tests.md

pd.DataFrame), pd.DataFrame)


def test_types_groupby_as_index() -> None:
"""Test type of groupby.size method depending on `as_index`."""
Expand Down
Loading