in app/python/process.py [0:0]
def write_processed_data(aggregate):
"""
Write aggregate data to Cloud Storage
"""
logging.info(" write_processed_data: start writing data.")
counter = 0
storage_client = google.cloud.storage.Client()
processed_bucket = storage_client.get_bucket(PROCESSED_DATA_BUCKET)
for rowkey in aggregate.keys():
data_file = f"{rowkey}/data.json"
facet_data = json.dumps(aggregate[rowkey])
processed_bucket.blob(data_file).upload_from_string(facet_data)
counter += 1
logging.info(f" write_processed_data: wrote {counter} files.")