I need to have a Python equivalence of this BigQuery bq show --format=prettyjson myproject:mydataset.mytable.
Is there a way to do it with the BigQuery API in Python ?
I tried this in Python:
view_ref = self._client.dataset(dataset.dataset_id).table(table.table_id)
table_obj = self._client.get_table(view_ref)
dict_schema = []
for schema_field in table_obj.schema:
dict_schema.append({
'name': schema_field.name,
'mode': schema_field.mode,
'type': schema_field.field_type
})
It almost works; I just don't have the nested schema field/
Thanks for replies and have a nice day.