Skip to content

Commit

Permalink
Update sandbox dag with retool
Browse files Browse the repository at this point in the history
  • Loading branch information
chowbao committed Dec 19, 2024
1 parent afc5bb1 commit b76195e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions dags/sandbox_update_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
BQ_DATASET = Variable.get("public_dataset")
SANDBOX_PROJECT = Variable.get("bq_project")
SANDBOX_DATASET = Variable.get("sandbox_dataset")
INTERNAL_DATASET = Variable.get("bq_dataset")

batch_run_date = "{{ batch_run_date_as_datetime_string(dag, data_interval_start) }}"

Expand All @@ -59,8 +60,6 @@
)

for table_id in TABLES_ID:
if table_id == "diagnostic_events":
continue
query_path = get_query_filepath("update_table")
query = file_to_string(query_path)
sql_params = {
Expand All @@ -71,6 +70,11 @@
"target_dataset": SANDBOX_DATASET,
"batch_run_date": batch_run_date,
}

if table_id == "retool_entity_data":
sql_params["project_id"] = SANDBOX_PROJECT
sql_params["dataset_id"] = INTERNAL_DATASET

query = query.format(**sql_params)
tables_update_task = BigQueryInsertJobOperator(
task_id=f"update_{table_id}",
Expand Down

0 comments on commit b76195e

Please sign in to comment.