Using a custom Airflow connection

Run a task using a custom Airflow connection that you have previously created.

Documentation pages that include this code sample

To view the code sample used in context, see the following documentation:

Code sample

Python

task_custom = bigquery_operator.BigQueryOperator(
    task_id='task_custom_connection',
    sql='SELECT 1', use_legacy_sql=False,
    # Set a connection ID to use a connection that you have created.
    bigquery_conn_id='my_gcp_connection')

What's next

To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser