我有一个外部表格表,我想通过 Airflow 中的 BigQueryOperator 进行查询。
我更喜欢使用 Cloud Composer 服务帐户。
我通过 Airflow UI 使用以下参数创建了一个新连接:
Conn Id: bigquery_with_gdrive_scope
Conn Type: google_cloud_platform
Project Id: <my project id>
Keyfile path: <none>
Keyfile JSON: <none>
Scopes: https://www.googleapis.com/auth/bigquery,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/drive
在我的 DAG 中,我使用:BigQueryOperator(..., bigquery_conn_id='bigquery_with_gdrive_scope')
日志报告:Access Denied: BigQuery BigQuery: No OAuth token with Google Drive scope was found.
任务属性显示:bigquery_conn_id bigquery_with_gdrive_scope
就好像bigquery_conn_id
参数被忽略了一样。