Skip to content

Commit b84d838

Browse files
committed
docu and small changes
1 parent 36a3e6c commit b84d838

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

mapswipe_workers/mapswipe_workers/generate_stats/project_stats.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def add_metadata_to_csv(filename: str):
3131

3232

3333
def normalize_project_type_specifics(path):
34+
"""Explode nested json column project_type_specifics and drop empty columns."""
3435
df = pd.read_csv(path)
3536

3637
if "project_type_specifics" in df.columns.tolist() and not is_numeric_dtype(
@@ -146,12 +147,12 @@ def get_tasks(filename: str, project_id: str) -> pd.DataFrame:
146147

147148
sql_query = sql.SQL(
148149
"""
149-
COPY (
150-
SELECT project_id, group_id, task_id, ST_AsText(geom) as geom,
151-
project_type_specifics
152-
FROM tasks
153-
WHERE project_id = {}
154-
) TO STDOUT WITH CSV HEADER
150+
COPY (
151+
SELECT project_id, group_id, task_id, ST_AsText(geom) as geom,
152+
project_type_specifics
153+
FROM tasks
154+
WHERE project_id = {}
155+
) TO STDOUT WITH CSV HEADER
155156
"""
156157
).format(sql.Literal(project_id))
157158
write_sql_to_gzipped_csv(filename, sql_query)

0 commit comments

Comments
 (0)