显式使用默认 Airflow 连接

运行任务,同时将 Composer 显式配置为使用默认 Airflow 连接。

深入探索

如需查看包含此代码示例的详细文档,请参阅以下内容:

代码示例

Python

# Composer creates a 'google_cloud_default' connection by default.
task_explicit = bigquery.BigQueryInsertJobOperator(
    task_id='task_explicit_connection',
    gcp_conn_id='google_cloud_default',
    configuration={
        "query": {
            "query": 'SELECT 1',
            "useLegacySql": False
        }
    }
)

后续步骤

如需搜索和过滤其他 Google Cloud 产品的代码示例,请参阅 Google Cloud 示例浏览器