Fix bug adapting types passing through plpython
This commit is contained in:
@@ -31,6 +31,11 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$
|
|||||||
|
|
||||||
mapzen_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapzen_isolines($1, $2, $3, $4, $5, $6, $7) as isoline; ", ["text", "text", "text", "geometry(Geometry, 4326)", "text", "integer[]", "text[]"])
|
mapzen_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapzen_isolines($1, $2, $3, $4, $5, $6, $7) as isoline; ", ["text", "text", "text", "geometry(Geometry, 4326)", "text", "integer[]", "text[]"])
|
||||||
result = plpy.execute(mapzen_plan, [username, orgname, type, source, mode, range, options])
|
result = plpy.execute(mapzen_plan, [username, orgname, type, source, mode, range, options])
|
||||||
|
isolines = []
|
||||||
|
for element in result:
|
||||||
|
isoline = element['isoline']
|
||||||
|
isoline = isoline.translate(None, "()").split(',')
|
||||||
|
isolines.append(isoline)
|
||||||
|
|
||||||
return result
|
return isolines
|
||||||
$$ LANGUAGE plpythonu;
|
$$ LANGUAGE plpythonu;
|
||||||
|
|||||||
@@ -32,6 +32,11 @@ RETURNS SETOF cdb_dataservices_server.isoline AS $$
|
|||||||
|
|
||||||
mapzen_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapzen_isolines($1, $2, $3, $4, $5, $6, $7) as isoline; ", ["text", "text", "text", "geometry(Geometry, 4326)", "text", "integer[]", "text[]"])
|
mapzen_plan = plpy.prepare("SELECT cdb_dataservices_server._cdb_mapzen_isolines($1, $2, $3, $4, $5, $6, $7) as isoline; ", ["text", "text", "text", "geometry(Geometry, 4326)", "text", "integer[]", "text[]"])
|
||||||
result = plpy.execute(mapzen_plan, [username, orgname, type, source, mode, range, options])
|
result = plpy.execute(mapzen_plan, [username, orgname, type, source, mode, range, options])
|
||||||
|
isolines = []
|
||||||
|
for element in result:
|
||||||
|
isoline = element['isoline']
|
||||||
|
isoline = isoline.translate(None, "()").split(',') #--TODO what is this for?
|
||||||
|
isolines.append(isoline)
|
||||||
|
|
||||||
return result
|
return isolines
|
||||||
$$ LANGUAGE plpythonu;
|
$$ LANGUAGE plpythonu;
|
||||||
|
|||||||
Reference in New Issue
Block a user