Skip to content

Commit

Permalink
Fixes ci build
Browse files Browse the repository at this point in the history
  • Loading branch information
kshitijrajsharma committed Oct 15, 2023
1 parent 85cefde commit 172e1c0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion backend/field_update
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ class Raw:
t1.osm_id,
CASE
WHEN COUNT(cg.{source_column}) = 0 THEN ARRAY[0]::integer[]
ELSE array_agg(COALESCE(cg.id, 0))
ELSE array_agg(COALESCE(cg.{source_column}, 0))
END AS aa_fids
FROM
t1
Expand Down
4 changes: 2 additions & 2 deletions backend/replication
Original file line number Diff line number Diff line change
Expand Up @@ -534,8 +534,8 @@ def update_country(conn, timestamp, table_name, c_id=None, boundary=None):
with conn.cursor() as cur:
update_query = f"""WITH t1 AS (SELECT osm_id, ST_Centroid(geom) AS geom FROM {table_name} WHERE "timestamp" >= '{timestamp}'), t2 AS (SELECT t1.osm_id,
CASE
WHEN COUNT(cg.id) = 0 THEN ARRAY[0]::integer[]
ELSE array_agg(COALESCE(cg.id, 0))
WHEN COUNT(cg.cid) = 0 THEN ARRAY[0]::integer[]
ELSE array_agg(COALESCE(cg.cid, 0))
END AS aa_fids
FROM t1 LEFT JOIN countries cg ON ST_Intersects(t1.geom, cg.geometry) GROUP BY t1.osm_id) UPDATE {table_name} uw SET country = t2.aa_fids FROM t2 WHERE t2.osm_id = uw.osm_id;"""

Expand Down
2 changes: 1 addition & 1 deletion src/query_builder/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def get_country_id_query(geom_dump):

def check_exisiting_country(geom):
query = f"""select
b.id::int as fid
b.cid::int as fid
from
countries b
where
Expand Down

0 comments on commit 172e1c0

Please sign in to comment.