File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed
examples/gcloud-example/dags/bigquery_github Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 22from datetime import timedelta , datetime
33
44from airflow import DAG
5+ from airflow .models import Variable
56from airflow .contrib .operators .bigquery_operator import BigQueryOperator
67from airflow .contrib .operators .bigquery_check_operator import BigQueryCheckOperator
78
9+
10+ # Config variables
11+ dag_config = Variable .get ("bigquery_github_trends_variables" , deserialize_json = True )
12+ BQ_CONN_ID = dag_config ["bq_conn_id" ]
13+ BQ_PROJECT = dag_config ["bq_project" ]
14+ BQ_DATASET = dag_config ["bq_dataset" ]
15+
816default_args = {
917 'owner' : 'airflow' ,
1018 'depends_on_past' : True ,
2836 schedule_interval = schedule_interval
2937 )
3038
31- # Config variables
32- BQ_CONN_ID = "my_gcp_conn"
33- BQ_PROJECT = "my-bq-project"
34- BQ_DATASET = "my-bq-dataset"
35-
3639## Task 1: check that the github archive data has a dated table created for that date
3740# To test this task, run this command:
3841# docker-compose -f docker-compose-gcloud.yml run --rm webserver airflow test bigquery_github_trends bq_check_githubarchive_day 2018-12-01
Original file line number Diff line number Diff line change 1+ {
2+ "bigquery_github_trends_variables" : {
3+ "bq_conn_id" : " my_gcp_conn" ,
4+ "bq_project" : " my_bq_project" ,
5+ "bq_dataset" : " my_bq_dataset"
6+ }
7+ }
You can’t perform that action at this time.
0 commit comments