Skip to content

Commit 618f638

Browse files
committed
modified: pandas/core/reshape/pivot.py
- Moved and simplified mypy comment per feedback.
1 parent f7a4fb5 commit 618f638

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

pandas/core/reshape/pivot.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -339,12 +339,8 @@ def __internal_pivot_table(
339339
if values_passed:
340340
# GH#57876 and GH#61292
341341
# Explicitly aggregate ``values``.
342+
# mypy is not aware `grouped[values]` will always be a DataFrameGroupBy
342343
grouped = grouped[values] # type: ignore[assignment]
343-
# TODO: ``grouped`` will have type ``DataFrameGroupBy`` because
344-
# ``values`` is guaranteed to be a ``list[Any]`` per above
345-
# logic. The type hints for ``DataFrameGroupBy`` require an
346-
# overload for mypy to determine this. See stubs in pandas-stubs.
347-
# https://github.com/pandas-dev/pandas-stubs/blob/8434bde95460b996323cc8c0fea7b0a8bb00ea26/pandas-stubs/core/groupby/generic.pyi#L222
348344

349345
agged = grouped.agg(aggfunc, **kwargs)
350346

0 commit comments

Comments
 (0)