CityOfLosAngeles / aqueduct

A shared pipeline for building ETLs and batch jobs that we run at the City of LA for Data Science Projects. Built on Apache Airflow & Civis Platform
Apache License 2.0
21 stars 6 forks source link

Malformed JSON in Waze jams and alerts "line" column when written as file. #54

Open rbcarter opened 5 years ago

rbcarter commented 5 years ago

The current result of writing the table values to a file will create malformed JSON in the linestring. For example: "[{'"x'": -118.342949, '"y'": 34.078279}, {'"x'": -118.342962, '"y'": 34.07617}]" There is an alternating single and double quote around the x and y keys.

A proposed solution would be to wrap the x and y keys with double quotes and the array with single quotes. For example: '[{"x": -118.342949, "y": 34.078279}, {"x": -118.342962, "y": 34.07617}]'

This would allow the string to be loaded as a dictionary in python.

bryanblackford commented 5 years ago

Thanks for opening this issue. Could you post a code sample here that demonstrates the behavior you're seeing?