From c799f4d73bcc0ac6a406d5f7ac9e3d2d454c7b24 Mon Sep 17 00:00:00 2001 From: Andy Eschbacher Date: Mon, 27 Jun 2016 10:09:13 -0400 Subject: [PATCH] fix formatting of query --- src/py/crankshaft/crankshaft/segmentation/segmentation.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/py/crankshaft/crankshaft/segmentation/segmentation.py b/src/py/crankshaft/crankshaft/segmentation/segmentation.py index 5f11e04..c43ca82 100644 --- a/src/py/crankshaft/crankshaft/segmentation/segmentation.py +++ b/src/py/crankshaft/crankshaft/segmentation/segmentation.py @@ -146,9 +146,6 @@ def predict_segment(model, features, target_query): results.append(prediction) - cartodb_ids = plpy.execute(''' - SELECT array_agg(cartodb_id ORDER BY cartodb_id) As cartodb_ids - FROM ({0}) As a - '''.format(target_query))[0]['cartodb_ids'] + cartodb_ids = plpy.execute('''SELECT array_agg(cartodb_id ORDER BY cartodb_id) As cartodb_ids FROM ({0}) As a'''.format(target_query))[0]['cartodb_ids'] return cartodb_ids, np.concatenate(results)