Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Canvas sandbox dependencies #350

Merged
merged 16 commits into from
May 2, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
move macros into dag definition
sydneynotthecity committed May 1, 2024
commit 302ca32e80a9f8adbdc638a9deafe52b9c3ff02d
12 changes: 5 additions & 7 deletions dags/sandbox_update_dag.py
Original file line number Diff line number Diff line change
@@ -30,20 +30,18 @@
schedule_interval="0 1 * * *",
params={"alias": "sandbox_dataset"},
user_defined_filters={"fromjson": lambda s: loads(s)},
render_template_as_native_obj=True,
catchup=True,
user_defined_macros={
"subtract_data_interval": macros.subtract_data_interval,
"batch_run_date_as_datetime_string": macros.batch_run_date_as_datetime_string,
},
) as dag:
TABLES_ID = Variable.get("table_ids", deserialize_json=True)
PROJECT = Variable.get("bq_project")
BQ_DATASET = Variable.get("bq_dataset")
SANDBOX_DATASET = Variable.get("sandbox_dataset")

user_defined_macros = (
{
"subtract_data_interval": macros.subtract_data_interval,
"batch_run_date_as_datetime_string": macros.batch_run_date_as_datetime_string,
},
)

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

start_tables_task = EmptyOperator(task_id="start_tables_task")