(self, agg_dict)
return data
Returns an aggregation object from an aggregation dict.

        Args:
            agg_dict (dict): a dictionary containing information
                about the stored aggregation.

        Returns:
            A dict with metadata information as well as the aggregation
            object (instance of AggregationResult) from a saved aggregation
            or an empty dict if not found.
Returns an aggregation object from an aggregation dict.
Returns an aggregation object from an aggregation dict .
def get_aggregation(self, agg_dict):
        """Returns an aggregation object from an aggregation dict.

        Args:
            agg_dict (dict): a dictionary containing information
                about the stored aggregation.

        Returns:
            A dict with metadata information as well as the aggregation
            object (instance of AggregationResult) from a saved aggregation
            or an empty dict if not found.
        """
        aggregation_id = agg_dict.get('id')
        if not aggregation_id:
            return {}

        aggregation = Aggregation.query.get(aggregation_id)
        if not aggregation:
            return {}

        try:
            agg_class = aggregator_manager.AggregatorManager.get_aggregator(
                aggregation.agg_type)
        except KeyError:
            return {}

        if not agg_class:
            return pd.DataFrame()

        parameter_string = aggregation.parameters
        parameters = json.loads(parameter_string)
        index = parameters.pop('index', None)
        aggregator = agg_class(sketch_id=self._sketch_id, index=index)

        _ = parameters.pop('supported_charts', None)
        chart_color = parameters.pop('chart_color', 'N/A')
        chart_title = parameters.pop('chart_title', 'N/A')

        data = {
            'aggregation': aggregator.run(**parameters),
            'name': aggregation.name,
            'description': aggregation.description,
            'agg_type': aggregation.agg_type,
            'parameters': parameters,
            'chart_type': aggregation.chart_type,
            'chart_title': chart_title,
            'chart_color': chart_color,
            'user': aggregation.user,
        }
        return data
def get_aggregation ( self , agg_dict ) : aggregation_id = agg_dict . get ( 'id' ) if not aggregation_id : return { } aggregation = Aggregation . query . get ( aggregation_id ) if not aggregation : return { } try : agg_class = aggregator_manager . AggregatorManager . get_aggregator ( aggregation . agg_type ) except KeyError : return { } if not agg_class : return pd . DataFrame ( ) parameter_string = aggregation . parameters parameters = json . loads ( parameter_string ) index = parameters . pop ( 'index' , None ) aggregator = agg_class ( sketch_id = self . _sketch_id , index = index ) _ = parameters . pop ( 'supported_charts' , None ) chart_color = parameters . pop ( 'chart_color' , 'N/A' ) chart_title = parameters . pop ( 'chart_title' , 'N/A' ) data = { 'aggregation' : aggregator . run ( * * parameters ) , 'name' : aggregation . name , 'description' : aggregation . description , 'agg_type' : aggregation . agg_type , 'parameters' : parameters , 'chart_type' : aggregation . chart_type , 'chart_title' : chart_title , 'chart_color' : chart_color , 'user' : aggregation . user , } return data