From 565e4d10dfe1a08fcc80a09d1fcfeb65933c317f Mon Sep 17 00:00:00 2001 From: DingZQ Date: Sun, 20 Apr 2025 09:57:56 +0800 Subject: [PATCH] Refine --- api/s41_pipe_risk_probability.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/api/s41_pipe_risk_probability.py b/api/s41_pipe_risk_probability.py index 3c60239..cbb5f4c 100644 --- a/api/s41_pipe_risk_probability.py +++ b/api/s41_pipe_risk_probability.py @@ -69,13 +69,11 @@ def get_pipe_risk_probability_geometries(name: str) -> dict[str, Any]: with conn[name].cursor(row_factory=dict_row) as cur: cur.execute(f"select {key_pipeId}, ST_AsGeoJSON(geometry) AS {key_geometry} from gis_pipe") - columns = [desc[0] for desc in cur.description] - columns.remove(key_pipeId) - columns.remove(key_geometry) - print("Columns") - print(columns) for record in cur: + for col in record: + print(col) + id = record[key_pipeId] geom = json.loads(record[key_geometry])