def custom_data(self, filters, domain):
        data = {}
        for config in self.sources['data_source']:
            if 'date_filter_field' in config:
                filters.update({config['date_filter_field']: self.config['date_span']})
            report_data = ICDSData(domain, filters, config['id']).data()
            for column in config['columns']:
                column_agg_func = column['agg_fun']
                column_name = column['column_name']
                column_data = 0
                if column_agg_func == 'sum':
                    column_data = sum([x[column_name] for x in report_data])
                elif column_agg_func == 'count':
                    column_data = len(report_data)

                data.update({
                    column_name: data.get(column_name, 0) + column_data
                })
        return data
dataset/ETHPy150Open dimagi/commcare-hq/custom/icds_reports/sqldata.py/ICDSMixin.custom_data/original