【发布时间】:2018-02-18 23:55:21
【问题描述】:
我已经使用下面的代码来获取列列表,它工作正常。
table_ref = dataset_ref.table(table_name)
table = client.get_table(table_ref)
field_names = [field.name for field in table.schema]
但是当我尝试下面的代码来获取数据类型时,我收到了一个错误 - AttributeError: 'SchemaField' object has no attribute 'type'
field_types = [field.type for field in table.schema]
【问题讨论】: