Skip to content

Instantly share code, notes, and snippets.

@kaxil
Last active December 25, 2018 20:25
Show Gist options
  • Save kaxil/7504fb7b330b2a317e16389129bc5bac to your computer and use it in GitHub Desktop.
Save kaxil/7504fb7b330b2a317e16389129bc5bac to your computer and use it in GitHub Desktop.
Airflow Default Arguments
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': airflow.utils.dates.days_ago(2),
# All the parameters below are BigQuery specific and will be available to all the tasks
'bigquery_conn_id': 'gcp-bigquery-connection',
'write_disposition': 'WRITE_EMPTY',
'create_disposition': 'CREATE_IF_NEEDED',
'labels': {'client': 'client-1'}
}
with DAG(dag_id='airflow_tutorial_gcp', default_args=default_args, schedule_interval=None) as dag:
query_1 = BigQueryOperator(
task_id='query_1',
sql='select 1'
)
query_2 = BigQueryOperator(
task_id='query_2',
sql='select 1'
)
query_1 >> query_2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment