Skip to content

Commit f7c5e23

Browse files
author
T. Koskamp
committed
Incorporate review suggestion for issue #63178
BUG: Inconsistent behavior of Groupby with None values with filter
1 parent 74057eb commit f7c5e23

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

pandas/core/groupby/groupby.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ def indices(self) -> dict[Hashable, npt.NDArray[np.intp]]:
637637
return self._grouper.indices
638638

639639
@final
640-
def _get_indices(self, name):
640+
def _get_index(self, name):
641641
"""
642642
Safe get multiple indices, translate keys for
643643
datelike to underlying repr.
@@ -687,13 +687,6 @@ def get_converter(s):
687687

688688
return self.indices.get(name, [])
689689

690-
@final
691-
def _get_index(self, name):
692-
"""
693-
Safe get index, translate keys for datelike to underlying repr.
694-
"""
695-
return self._get_indices(name)
696-
697690
@final
698691
@cache_readonly
699692
def _selected_obj(self):

pandas/core/groupby/ops.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,8 @@ def indices(self) -> dict[Hashable, npt.NDArray[np.intp]]:
665665
elif has_mi:
666666
# MultiIndex has no efficient way to tell if there are NAs
667667
result = {
668-
tuple(np.nan if isna(comp) else comp for comp in key): value
668+
# error: "Hashable" has no attribute "__iter__" (not iterable)
669+
tuple(np.nan if isna(comp) else comp for comp in key): value # type: ignore[attr-defined]
669670
for key, value in result.items()
670671
}
671672

0 commit comments

Comments
 (0)