from __future__ import absolute_import, unicode_literals
from corehq.apps.aggregate_ucrs.ingestion import populate_aggregate_table_data


def populate_aggregate_table_data_task(aggregate_table_adapter):
    return populate_aggregate_table_data(aggregate_table_adapter)

@@ -50,16 +50,47 @@
 iterals%0A
+%0Afrom celery.task import task%0A%0A
 from cor
@@ -164,74 +164,406 @@
 ata%0A
-%0A%0Adef populate_aggregate_table_data_task(aggregate_table_adapter):
+from corehq.apps.aggregate_ucrs.models import AggregateTableDefinition%0Afrom corehq.apps.aggregate_ucrs.sql.adapter import AggregateIndicatorSqlAdapter%0Afrom corehq.apps.userreports.const import UCR_CELERY_QUEUE%0A%0A%0A@task(queue=UCR_CELERY_QUEUE, ignore_result=True)%0Adef populate_aggregate_table_data_task(aggregate_table_id):%0A    definition = AggregateTableDefinition.objects.get(id=aggregate_table_id)
 %0A   
@@ -600,25 +600,25 @@
 le_data(
-a
+A
 ggregate
 _table_a
@@ -613,20 +613,37 @@
 gate
-_table_adapter
+IndicatorSqlAdapter(definition)
 )%0A

make rebuild actually work as a task