Using a custom Airflow connection

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

Explore further

For detailed documentation that includes this code sample, see the following:

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.