我使用下面的代码来获取列的列表,它工作正常。
table_ref = dataset_ref.table(table_name)
table = client.get_table(table_ref)
field_names = [field.name for field in table.schema]
但当我尝试下面的代码来获取数据类型时,我收到一个错误 - AttributeError:'SchemaField'对象没有属性'type'
field_types = [field.type for field in table.schema]