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

# 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
        }
    }
)

What's next

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