I have this variable:
pubsub_message = "{cyclesPloughedPerBatch1: 0, cyclesPloughedPerBatch2: 0, cyclesPloughedPerBatch3: 0, currentFrameLevel: 1, alarms1: 0, device_timestamp: 2024-05-10T09:00:01.686268Z, location_datetime: 2024-05-10T09:00:01.686268Z}"
which comes from a GCP Pub/Sub.
I want to ingest this data in GCP BigQuery.
Currently I’m facing an issue with transforming the above variable from string to python dictionary or json format and using it in load_table_from_json()
function.
I tried using the json
library for serialization, but to no avail.
Any help would be greatly appreciated!