@@ -625,7 +625,7 @@ def get_iterator(self, data: NDFrameT) -> Iterator[tuple[Hashable, NDFrameT]]:
625625 splitter = self ._get_splitter (data )
626626 # TODO: Would be more efficient to skip unobserved for transforms
627627 keys = self .result_index
628- yield from zip (keys , splitter )
628+ yield from zip (keys , splitter , strict = True )
629629
630630 @final
631631 def _get_splitter (self , data : NDFrame ) -> DataSplitter :
@@ -766,7 +766,7 @@ def result_index_and_ids(self) -> tuple[Index, npt.NDArray[np.intp]]:
766766 ]
767767 sorts = [ping ._sort for ping in self .groupings ]
768768 # When passed a categorical grouping, keep all categories
769- for k , (ping , level ) in enumerate (zip (self .groupings , levels )):
769+ for k , (ping , level ) in enumerate (zip (self .groupings , levels , strict = True )):
770770 if ping ._passed_categorical :
771771 levels [k ] = level .set_categories (ping ._orig_cats )
772772
@@ -997,7 +997,7 @@ def apply_groupwise(
997997 result_values = []
998998
999999 # This calls DataSplitter.__iter__
1000- zipped = zip (group_keys , splitter )
1000+ zipped = zip (group_keys , splitter , strict = True )
10011001
10021002 for key , group in zipped :
10031003 # Pinning name is needed for
@@ -1095,7 +1095,7 @@ def groups(self):
10951095 # GH 3881
10961096 result = {
10971097 key : value
1098- for key , value in zip (self .binlabels , self .bins )
1098+ for key , value in zip (self .binlabels , self .bins , strict = True )
10991099 if key is not NaT
11001100 }
11011101 return result
@@ -1126,7 +1126,7 @@ def get_iterator(self, data: NDFrame):
11261126 slicer = lambda start , edge : data .iloc [start :edge ]
11271127
11281128 start : np .int64 | int = 0
1129- for edge , label in zip (self .bins , self .binlabels ):
1129+ for edge , label in zip (self .bins , self .binlabels , strict = True ):
11301130 if label is not NaT :
11311131 yield label , slicer (start , edge )
11321132 start = edge
@@ -1139,7 +1139,7 @@ def indices(self):
11391139 indices = collections .defaultdict (list )
11401140
11411141 i : np .int64 | int = 0
1142- for label , bin in zip (self .binlabels , self .bins ):
1142+ for label , bin in zip (self .binlabels , self .bins , strict = True ):
11431143 if i < bin :
11441144 if label is not NaT :
11451145 indices [label ] = list (range (i , bin ))
@@ -1229,7 +1229,7 @@ def __iter__(self) -> Iterator:
12291229
12301230 starts , ends = lib .generate_slices (self ._slabels , self .ngroups )
12311231 sdata = self ._sorted_data
1232- for start , end in zip (starts , ends ):
1232+ for start , end in zip (starts , ends , strict = True ):
12331233 yield self ._chop (sdata , slice (start , end ))
12341234
12351235 @cache_readonly
0 commit comments