Skip to content

Commit

Permalink
fix(change-default-db-user-to-user-column): default user was being us…
Browse files Browse the repository at this point in the history
…ed for db query instead read it from table itself
  • Loading branch information
kshitijrajsharma committed Aug 8, 2024
1 parent b7ada5a commit 56dab15
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/query_builder/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ def raw_currentdata_extraction_query(

# query_table = []
if params.include_user_metadata:
select_condition = f"""osm_id, tableoid::regclass AS osm_type, version,tags,changeset, uid, user, timestamp,{'ST_Centroid(geom) as geom' if params.centroid else 'geom'}"""
select_condition = f"""osm_id, tableoid::regclass AS osm_type, version,tags,changeset, uid, "user", timestamp,{'ST_Centroid(geom) as geom' if params.centroid else 'geom'}"""
else:
select_condition = f"""osm_id, tableoid::regclass AS osm_type, version,tags,changeset,timestamp,{'ST_Centroid(geom) as geom' if params.centroid else 'geom'}""" # this is default attribute that we will deliver to user if user defines his own attribute column then those will be appended with osm_id only

Expand Down Expand Up @@ -909,8 +909,8 @@ def postgres2duckdb_query(
create_select_duck_db = """osm_id, osm_type , version, changeset, timestamp, cast(tags::json AS map(varchar, varchar)) AS tags, cast(ST_GeomFromWKB(geom) as GEOMETRY) AS geom"""

if enable_users_detail:
select_query = """osm_id, osm_type, uid, user, version, changeset, timestamp, tags, ST_AsBinary(geom) as geom"""
create_select_duck_db = """osm_id, osm_type, uid, user, version, changeset, timestamp, cast(tags::json AS map(varchar, varchar)) AS tags, cast(ST_GeomFromWKB(geom) as GEOMETRY) AS geom"""
select_query = """osm_id, osm_type, uid, "user", version, changeset, timestamp, tags, ST_AsBinary(geom) as geom"""
create_select_duck_db = """osm_id, osm_type, uid, "user", version, changeset, timestamp, cast(tags::json AS map(varchar, varchar)) AS tags, cast(ST_GeomFromWKB(geom) as GEOMETRY) AS geom"""

row_filter_condition = (
f"""(country @> ARRAY [{cid}])"""
Expand Down

0 comments on commit 56dab15

Please sign in to comment.