答案 0 :(得分:0)
要创建CSV字符串,通常需要手动执行此操作。举个例子:
from google.cloud import bigquery
client = bigquery.Client.from_service_account_json(credentials, project=project)
dataset = client.get_dataset(client.dataset(dataset_name))
entries = list(dataset.access_entries)
entry = bigquery.AccessEntry(
role=role,
entity_type=entity_type,
entity_id=entity_id)
entries.append(entry)
dataset.access_entries = entries
dataset = client.update_dataset(dataset, ['access_entries'])
from google.cloud import bigquery
client = bigquery.Client.from_service_account_json(credentials, project=project)
dataset = client.dataset(dataset_name)
dataset.reload()
entries = list(dataset.access_grants)
entry = bigquery.AccessGrant(
role=role,
entity_type=entity_type,
entity_id=entity_id)
entries.append(entry)
dataset.access_grants = entries
dataset.update()
...等...
然后将它们追加在一起,用换行符分隔。显然你在某种循环中做上述事情会更好。
至于将它放入android下载存储,其他人将不得不告诉你如何做到这一点,我不知道如何!
答案 1 :(得分:0)