Skip to content

Commit 4ac4904

Browse files
committed
make sure to remove quotation marks from osm changeset attribute values to avoid problemns in postgres
1 parent 90ca097 commit 4ac4904

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

mapswipe_workers/mapswipe_workers/utils/api_calls.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,11 @@ def remove_noise_and_add_user_info(json: dict) -> dict:
125125

126126
for feature in json["features"]:
127127
changeset = changeset_results[feature["properties"]["changesetId"]]
128-
feature["properties"]["username"] = changeset["username"]
128+
# we need to replace " as this will cause problems when importing to postgres
129+
feature["properties"]["username"] = changeset["username"].replace('"', "")
129130
feature["properties"]["userid"] = changeset["userid"]
130-
feature["properties"]["comment"] = changeset["comment"]
131-
feature["properties"]["created_by"] = changeset["created_by"]
131+
feature["properties"]["comment"] = changeset["comment"].replace('"', "")
132+
feature["properties"]["created_by"] = changeset["created_by"].replace('"', "")
132133

133134
logger.info("finished filtering and adding extra info")
134135
if any(x > 0 for x in missing_rows.values()):

0 commit comments

Comments
 (0)