code: def get_aggregation(self):
          
          agg = A(self.agg_type, **self._params)
          if self._metric:
              agg.metric('metric', self._metric)
          return agg
docs: Return the aggregation object.