Skip to content

Commit 5fd4160

Browse files
committed
fix(typing): Bump stubs, doc new ignore include_groups
1 parent c52bf66 commit 5fd4160

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

narwhals/_pandas_like/group_by.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,12 +340,23 @@ def _select_results(
340340
)
341341

342342
def _apply_aggs(self, exprs: Iterable[PandasLikeExpr]) -> pd.DataFrame:
343+
"""Stub issue for `include_groups` [pandas-dev/pandas-stubs#1270].
344+
345+
- [User guide] mentions `include_groups` 4 times without deprecation.
346+
- [`DataFrameGroupBy.apply`] doc says the default value of `True` is deprecated since `2.2.0`.
347+
- `False` is explicitly the only *non-deprecated* option, but entirely omitted since [pandas-dev/pandas-stubs#1268].
348+
349+
[pandas-dev/pandas-stubs#1270]: https://github.com/pandas-dev/pandas-stubs/issues/1270
350+
[User guide]: https://pandas.pydata.org/pandas-docs/stable/user_guide/groupby.html
351+
[`DataFrameGroupBy.apply`]: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.core.groupby.DataFrameGroupBy.apply.html
352+
[pandas-dev/pandas-stubs#1268]: https://github.com/pandas-dev/pandas-stubs/pull/1268
353+
"""
343354
warn_complex_group_by()
344355
impl = self.compliant._implementation
345356
func = self._apply_exprs_function(exprs)
346357
apply = self._grouped.apply
347358
if impl.is_pandas() and impl._backend_version() >= (2, 2):
348-
return apply(func, include_groups=False)
359+
return apply(func, include_groups=False) # type: ignore[call-overload]
349360
else: # pragma: no cover
350361
return apply(func)
351362

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ typing = [ # keep some of these pinned and bump periodically so there's fewer s
6565
"duckdb==1.3.0",
6666
"hypothesis",
6767
"pytest",
68-
"pandas-stubs==2.2.3.250308",
68+
"pandas-stubs==2.3.0.250703",
6969
"typing_extensions",
7070
"mypy~=1.15.0",
7171
"pyright",

0 commit comments

Comments
 (0)