update order of query gen

This commit is contained in:
Andy Eschbacher 2016-12-06 12:49:27 -05:00
parent cc0a683a26
commit bb5de09d6d

View File

@ -46,9 +46,9 @@ class AnalysisDataProvider:
def get_nonspatial_kmeans(self, params):
"""fetch data for non-spatial kmeans"""
agg_cols = ', '.join(['array_agg({0}) As arr_col{1}'.format(idx+1, val)
agg_cols = ', '.join(['array_agg({0}) As arr_col{1}'.format(val, idx+1)
for idx, val in enumerate(params['colnames'])])
print agg_cols
query = '''
SELECT {cols}, array_agg({id_col}) As rowid
FROM ({subquery}) As a