小编Mou*_*ess的帖子

使用 Deployment Manager 在 BigQuery 中创建“外部表”时,“获取云端硬盘凭据时出现 403 权限被拒绝”

重现步骤:

  • 在 Google 表格中创建工作表
  • 在 Google Cloud Platform 中启用 Deployment Manager 和 Google Drive API
  • view添加具有工作表权限的部署管理器服务帐户
  • 使用部署管理器创建数据集
  • 使用 Deployment Manager 创建表,在 sourceUris 中引用外部表
部分Python模板:
def GenerateConfig(context):
    name: str = context.env['name']
    dataset: str = context.properties['dataset']
    tables: [] = context.properties['tables']
    location: str = context.properties.get('location', 'EU')
    resources = [{
        'name': name,
        'type': 'gcp-types/bigquery-v2:datasets',
        'properties': {
            'datasetReference': {
                'datasetId': dataset,
            },
            'location': location
        },
    }]

    for t in tables:
        resources.append({
            'name': '{}-tbl'.format(t["name"]),
            'type': 'gcp-types/bigquery-v2:tables',
            'properties': {
                'datasetId': dataset,
                'tableReference': {
                    'tableId': t["name"]
                }, …
Run Code Online (Sandbox Code Playgroud)

google-drive-api google-bigquery google-cloud-platform google-deployment-manager

5
推荐指数
1
解决办法
9323
查看次数