Closed
Description
Missing parameter for the sort argument of the pandas.DataFrame.pivot_table method
Describe the bug The sort
argument of the pandas.DataFrame.pivot_table
method is available, but according to the pandas-stubs it is not:
pandas-stubs/pandas-stubs/core/frame.pyi
Lines 1126 to 1137 in 7dd7b6a
The Pandas documentation says that sort
is an available parameter: Docs of pandas.DataFrame.pivot_table
sort bool, default True
Specifies if the result should be sorted.
New in version 1.3.0.
To Reproduce
1. A minimal runnable pandas
example that is not properly checked by the stubs:
from pandas import DataFrame
data_frame = DataFrame({
'a': [1, 2],
'b': [1, 2],
'c': [1, 2],
'd': [1, 2],
})
data_frame.pivot_table(
values=['a', 'b'],
index=['c', 'd'],
sort=True,
)
3. I am using `pyright`.
4. The error message received from `pyright`:
9 - error: No parameter named "sort" (reportCallIssue)
Please complete the following information:
* OS: Windows
* OS version: 10
* python
version: 3.12.1
* pyright
version: 1.1.391
* pandas-stubs
version: 2.2.3.241126