Skip to content

Commit 96be866

Browse files
GH992 Fix pd.DataFrame.pct_change fill_method typing (#993)
* Adding new optional workflow * Update new workflow * Update new workflow * GH992 Fix pd.DataFrame.pct_change fill_method typing * Update pandas-stubs/core/frame.pyi Co-authored-by: Irv Lustig <[email protected]> * PR Feedback --------- Co-authored-by: Irv Lustig <[email protected]>
1 parent 532fc66 commit 96be866

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

pandas-stubs/core/frame.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -1874,7 +1874,7 @@ class DataFrame(NDFrame, OpsMixin):
18741874
def pct_change(
18751875
self,
18761876
periods: int = ...,
1877-
fill_method: _str = ...,
1877+
fill_method: None = ...,
18781878
limit: int | None = ...,
18791879
freq=...,
18801880
**kwargs,

tests/test_frame.py

+5
Original file line numberDiff line numberDiff line change
@@ -2108,6 +2108,11 @@ def test_groupby_series_methods() -> None:
21082108
gb.nth(0).loc[1]
21092109

21102110

2111+
def test_dataframe_pct_change() -> None:
2112+
df = pd.DataFrame({"x": [1, 2, 2, 3, 3], "y": [10, 20, 30, 40, 50]})
2113+
df.pct_change(fill_method=None)
2114+
2115+
21112116
def test_indexslice_setitem():
21122117
df = pd.DataFrame(
21132118
{"x": [1, 2, 2, 3], "y": [1, 2, 3, 4], "z": [10, 20, 30, 40]}

0 commit comments

Comments
 (0)