Fix bug adapting types passing through plpython

This commit is contained in:
Rafa de la Torre
2016-07-06 19:58:04 +02:00
parent bcc6bc35d3
commit 9b7a2d491f
2 changed files with 12 additions and 2 deletions

View File

@@ -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[]"])
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;

View File

@@ -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[]"])
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;