Skip to content

Commit 68423bc

Browse files
committed
Quote WKT in CSV
1 parent cb4c532 commit 68423bc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/core/src/bag3d/core/assets/bag/download.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from datetime import datetime
22
from typing import Tuple
33
from copy import deepcopy
4+
import csv
45

56
from dagster import (
67
asset,
@@ -327,8 +328,9 @@ def load_bag_layer(
327328
geofilter = context.op_config.get("geofilter")
328329
if geofilter:
329330
with wkt_path.open("w") as f:
330-
f.write("ID,WKT\n")
331-
f.write(f"1,{geofilter}\n")
331+
csvwriter = csv.writer(f, quoting=csv.QUOTE_STRINGS)
332+
csvwriter.writerow(["WKT",])
333+
csvwriter.writerow([geofilter,])
332334
cmd.append(f"-clipsrc {wkt_path}")
333335
cmd.append("-f PostgreSQL PG:'{dsn}'")
334336
cmd.append('{{}}"')

0 commit comments

Comments
 (0)