使用自定义 Airflow 连接

使用您之前创建的自定义 Airflow 连接运行任务。

深入探索

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

代码示例

Python

# Set a gcp_conn_id to use a connection that you have created.
task_custom = bigquery.BigQueryInsertJobOperator(
    task_id='task_custom_connection',
    gcp_conn_id='my_gcp_connection',
    configuration={
        "query": {
            "query": 'SELECT 1',
            "useLegacySql": False
        }
    }
)

后续步骤

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