File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 26
26
from pandas .core .arrays import Categorical , ExtensionArray
27
27
import pandas .core .common as com
28
28
from pandas .core .frame import DataFrame
29
- from pandas .core .generic import NDFrame
30
29
from pandas .core .groupby .categorical import recode_for_groupby , recode_from_groupby
31
30
from pandas .core .groupby .ops import BaseGrouper
32
31
from pandas .core .index import CategoricalIndex , Index , MultiIndex
@@ -430,15 +429,15 @@ def groups(self) -> dict:
430
429
431
430
432
431
def get_grouper (
433
- obj : NDFrame ,
432
+ obj : FrameOrSeries ,
434
433
key = None ,
435
434
axis : int = 0 ,
436
435
level = None ,
437
436
sort = True ,
438
437
observed = False ,
439
438
mutated = False ,
440
439
validate = True ,
441
- ) -> Tuple [BaseGrouper , List [Hashable ], NDFrame ]:
440
+ ) -> Tuple [BaseGrouper , List [Hashable ], FrameOrSeries ]:
442
441
"""
443
442
Create and return a BaseGrouper, which is an internal
444
443
mapping of how to create the grouper indexers.
@@ -571,7 +570,8 @@ def get_grouper(
571
570
all_in_columns_index = all (
572
571
g in obj .columns or g in obj .index .names for g in keys
573
572
)
574
- else : # Series
573
+ else :
574
+ assert isinstance (obj , Series )
575
575
all_in_columns_index = all (g in obj .index .names for g in keys )
576
576
577
577
if not all_in_columns_index :
You can’t perform that action at this time.
0 commit comments