(
        self, reducer: typing.Union[dict, list, set, tuple, BaseConversion]
    )
return self_clone
Takes the conversion which defines the desired output of
        aggregation
Takes the conversion which defines the desired output of
        aggregation
Takes the conversion which defines the desired output of aggregation
def aggregate(
        self, reducer: typing.Union[dict, list, set, tuple, BaseConversion]
    ) -> "GroupBy":
        """Takes the conversion which defines the desired output of
        aggregation"""
        self_clone = self.clone()
        self_clone.agg_result = self_clone.ensure_conversion(reducer)
        self_clone.contents = self_clone.contents & ~self.ContentTypes.REDUCER
        if isinstance(self_clone.agg_result, NaiveConversion):
            raise AssertionError("unexpected reducer type", type(reducer))
        return self_clone
def aggregate ( self , reducer : typing . Union [ dict , list , set , tuple , BaseConversion ] ) -> "GroupBy" : self_clone = self . clone ( ) self_clone . agg_result = self_clone . ensure_conversion ( reducer ) self_clone . contents = self_clone . contents & ~ self . ContentTypes . REDUCER if isinstance ( self_clone . agg_result , NaiveConversion ) : raise AssertionError ( "unexpected reducer type" , type ( reducer ) ) return self_clone