This page contains code samples for Cloud Composer. To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser.
Composer Dataproc Workflow Instantiate Operator Tutorial (Airflow 1)
Example Airflow DAG that kicks off a Cloud Dataproc Template that runs a Spark Pi Job.
View in documentation
DAG: Clean up metadata DB
Sample DAG that enables users to clean up their Airflow metadata database
View in documentation
DAG: Clean up metadata DB (Airflow 1)
Sample DAG that enables users to clean up their Airflow metadata database
View in documentation
Get Cloud Storage location for DAGs in your environment
Retrieves the Cloud Storage bucket and directory for DAGs in your Composer environment.
View in documentation
Get environment client ID
Get the client ID of a Composer environment's Identity-Aware Proxy.
View in documentation
Use local dependencies
Use local dependencies in an Apache Airflow DAG, running on Cloud Composer.
View in documentation
Using a custom Airflow connection
Run a task using a custom Airflow connection that you have previously created.
View in documentation