in backfill/2024-03-23-clients_last_seen/telemetry_derived_clients_last_seen_v2_20240322/backfill_clients_last_seen_v2_in_BQproject_backfill_1.py [0:0]
def get_bigquery_schema(schema_yaml):
bigquery_schema = []
for item in schema_yaml:
if item['type'] == 'RECORD':
fields = []
for field in item['fields']:
fields.append({
'mode': field['mode'],
'type': field['type'],
'name': field['name'],
})
bigquery_schema.append({
'mode': item['mode'],
'type': item['type'],
'name': item['name'],
'fields': fields
})
else:
bigquery_schema.append({
'mode': item['mode'],
'type': item['type'],
'name': item['name'],
})
return bigquery_schema