Repository: pandas-dev/pandas-stubs (language: python)

Issue:
limit_area argument is currently missing for the frame.pyi
The new `limit_area` argument is missing for the `ffill` overloads for `frame.pyi`. 


This was seen in VSCode (pylance)
```python
df = pd.DataFrame({'a': [1, 2, 3], 'b': [4, 5, 6]})
df2 = df.sort_values('a')  # This infers the type correctly
df3 = df.ffill(limit=10)  # This infers the type correctly
df4 = df.ffill(limit_area='inside')  # This cannot infer the type since the `.pyi` is missing `limit_area`
```
When running error checking for types with standard, the error message is:
`No overloads for "ffill" match the provided arguments
  Argument types: (Literal['inside'])`



 - OS: Windows 10
 - python version: 3.12
 - version of type checker
 - version of installed `pandas-stubs`: This is using the latest version of pylance but I'm not sure how to check the version of pandas-stubs used. However, I don't see the entry in the [current latest commit in master](https://github.com/pandas-dev/pandas-stubs/blob/d2798db3afa01619a2fa18d0e1b82ae63f2a5ccf/pandas-stubs/core/frame.pyi#L1697-L1713)






Discussion / hints:
Thanks for the report.  We need people to work on including changes from versions 2.0, 2.1 and 2.2.  This is one of them.

PR with tests welcome.

Fix patch:
diff --git a/pandas-stubs/core/frame.pyi b/pandas-stubs/core/frame.pyi
index 80a1e8a6..9ba351f6 100644
--- a/pandas-stubs/core/frame.pyi
+++ b/pandas-stubs/core/frame.pyi
@@ -1656,6 +1656,7 @@ class DataFrame(NDFrame, OpsMixin):
         axis: Axis | None = ...,
         inplace: Literal[True],
         limit: int | None = ...,
+        limit_area: Literal["inside", "outside"] | None = ...,
         downcast: dict | None = ...,
     ) -> None: ...
     @overload
@@ -1665,6 +1666,7 @@ class DataFrame(NDFrame, OpsMixin):
         axis: Axis | None = ...,
         inplace: Literal[False] = ...,
         limit: int | None = ...,
+        limit_area: Literal["inside", "outside"] | None = ...,
         downcast: dict | None = ...,
     ) -> DataFrame: ...
     def clip(
@@ -1736,6 +1738,7 @@ class DataFrame(NDFrame, OpsMixin):
         axis: Axis | None = ...,
         inplace: Literal[True],
         limit: int | None = ...,
+        limit_area: Literal["inside", "outside"] | None = ...,
         downcast: dict | None = ...,
     ) -> None: ...
     @overload
@@ -1745,6 +1748,7 @@ class DataFrame(NDFrame, OpsMixin):
         axis: Axis | None = ...,
         inplace: Literal[False] = ...,
         limit: int | None = ...,
+        limit_area: Literal["inside", "outside"] | None = ...,
         downcast: dict | None = ...,
     ) -> DataFrame: ...
     def filter(
diff --git a/pandas-stubs/core/series.pyi b/pandas-stubs/core/series.pyi
index 080c6a82..ce27d44e 100644
--- a/pandas-stubs/core/series.pyi
+++ b/pandas-stubs/core/series.pyi
@@ -1300,6 +1300,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
         axis: AxisIndex | None = ...,
         inplace: Literal[True],
         limit: int | None = ...,
+        limit_area: Literal["inside", "outside"] | None = ...,
         downcast: dict | None = ...,
     ) -> None: ...
     @overload
@@ -1309,6 +1310,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
         axis: AxisIndex | None = ...,
         inplace: Literal[False] = ...,
         limit: int | None = ...,
+        limit_area: Literal["inside", "outside"] | None = ...,
         downcast: dict | None = ...,
     ) -> Series[S1]: ...
     @overload
@@ -1318,6 +1320,7 @@ class Series(IndexOpsMixin[S1], NDFrame):
         axis: AxisIndex | None = ...,
         inplace: Literal[True],
         limit: int | None = ...,
+        limit_area: Literal["inside", "outside"] | None = ...,
         downcast: dict | None = ...,
     ) -> None: ...
     @overload
@@ -1327,18 +1330,9 @@ class Series(IndexOpsMixin[S1], NDFrame):
         axis: AxisIndex | None = ...,
         inplace: Literal[False] = ...,
         limit: int | None = ...,
+        limit_area: Literal["inside", "outside"] | None = ...,
         downcast: dict | None = ...,
     ) -> Series[S1]: ...
-    @overload
-    def bfill(
-        self,
-        *,
-        value: S1 | dict | Series[S1] | DataFrame,
-        axis: AxisIndex = ...,
-        inplace: _bool = ...,
-        limit: int | None = ...,
-        downcast: dict | None = ...,
-    ) -> Series[S1] | None: ...
     def interpolate(
         self,
         method: InterpolateOptions = ...,


Test patch:
diff --git a/tests/test_frame.py b/tests/test_frame.py
index bee41a20..bc148b4b 100644
--- a/tests/test_frame.py
+++ b/tests/test_frame.py
@@ -2328,7 +2328,12 @@ def test_types_ffill() -> None:
     df = pd.DataFrame([[1, 2, 3]])
     check(assert_type(df.ffill(), pd.DataFrame), pd.DataFrame)
     check(assert_type(df.ffill(inplace=False), pd.DataFrame), pd.DataFrame)
+    check(
+        assert_type(df.ffill(inplace=False, limit_area="inside"), pd.DataFrame),
+        pd.DataFrame,
+    )
     assert assert_type(df.ffill(inplace=True), None) is None
+    assert assert_type(df.ffill(inplace=True, limit_area="outside"), None) is None
 
 
 def test_types_bfill() -> None:
@@ -2336,7 +2341,12 @@ def test_types_bfill() -> None:
     df = pd.DataFrame([[1, 2, 3]])
     check(assert_type(df.bfill(), pd.DataFrame), pd.DataFrame)
     check(assert_type(df.bfill(inplace=False), pd.DataFrame), pd.DataFrame)
+    check(
+        assert_type(df.bfill(inplace=False, limit_area="inside"), pd.DataFrame),
+        pd.DataFrame,
+    )
     assert assert_type(df.bfill(inplace=True), None) is None
+    assert assert_type(df.bfill(inplace=True, limit_area="outside"), None) is None
 
 
 def test_types_replace() -> None:
diff --git a/tests/test_series.py b/tests/test_series.py
index 8a7300be..1ea1b717 100644
--- a/tests/test_series.py
+++ b/tests/test_series.py
@@ -1160,7 +1160,13 @@ def test_types_bfill() -> None:
     s1 = pd.Series([1, 2, 3])
     check(assert_type(s1.bfill(), "pd.Series[int]"), pd.Series, np.integer)
     check(assert_type(s1.bfill(inplace=False), "pd.Series[int]"), pd.Series, np.integer)
+    check(
+        assert_type(s1.bfill(inplace=False, limit_area="inside"), "pd.Series[int]"),
+        pd.Series,
+        np.integer,
+    )
     assert assert_type(s1.bfill(inplace=True), None) is None
+    assert assert_type(s1.bfill(inplace=True, limit_area="outside"), None) is None
 
 
 def test_types_ewm() -> None:
@@ -1205,7 +1211,13 @@ def test_types_ffill() -> None:
     s1 = pd.Series([1, 2, 3])
     check(assert_type(s1.ffill(), "pd.Series[int]"), pd.Series, np.integer)
     check(assert_type(s1.ffill(inplace=False), "pd.Series[int]"), pd.Series, np.integer)
+    check(
+        assert_type(s1.ffill(inplace=False, limit_area="inside"), "pd.Series[int]"),
+        pd.Series,
+        np.integer,
+    )
     assert assert_type(s1.ffill(inplace=True), None) is None
+    assert assert_type(s1.ffill(inplace=True, limit_area="outside"), None) is None
 
 
 def test_types_as_type() -> None: