Skip to content

Commit 25fd4a1

Browse files
author
T. Koskamp
committed
Incorporate review suggestion for issue #63178
BUG: Inconsistent behavior of Groupby with None values with filter
1 parent 7ced97d commit 25fd4a1

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
@@ -636,7 +636,7 @@ def indices(self) -> dict[Hashable, npt.NDArray[np.intp]]:
636636
return self._grouper.indices
637637

638638
@final
639-
def _get_indices(self, name):
639+
def _get_index(self, name):
640640
"""
641641
Safe get multiple indices, translate keys for
642642
datelike to underlying repr.
@@ -686,13 +686,6 @@ def get_converter(s):
686686

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

689-
@final
690-
def _get_index(self, name):
691-
"""
692-
Safe get index, translate keys for datelike to underlying repr.
693-
"""
694-
return self._get_indices(name)
695-
696689
@final
697690
@cache_readonly
698691
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)