From 9ab5bcbf3e383df6c0e4b01e78f765b491f853f7 Mon Sep 17 00:00:00 2001 From: wil stuckey Date: Wed, 3 May 2023 16:05:27 -0500 Subject: [PATCH] Partition templates are not using `$` to separate partition designation. (#3757) --- bigquery_etl/query_scheduling/task.py | 6 +++--- dags/bqetl_domain_meta.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bigquery_etl/query_scheduling/task.py b/bigquery_etl/query_scheduling/task.py index c98db1208a..73450ffcc4 100644 --- a/bigquery_etl/query_scheduling/task.py +++ b/bigquery_etl/query_scheduling/task.py @@ -357,15 +357,15 @@ class Task: ): match metadata.bigquery.time_partitioning.type: case PartitionType.YEAR: - partition_template = '{{ dag_run.logical_date.strftime("%Y") }}' + partition_template = '${{ dag_run.logical_date.strftime("%Y") }}' case PartitionType.MONTH: - partition_template = '{{ dag_run.logical_date.strftime("%Y%m") }}' + partition_template = '${{ dag_run.logical_date.strftime("%Y%m") }}' case PartitionType.DAY: # skip for the default case of daily partitioning partition_template = None case PartitionType.HOUR: partition_template = ( - '{{ dag_run.logical_date.strftime("%Y%m%d%H") }}' + '${{ dag_run.logical_date.strftime("%Y%m%d%H") }}' ) case _: raise TaskParseException( diff --git a/dags/bqetl_domain_meta.py b/dags/bqetl_domain_meta.py index 790252c200..c4bc02dfab 100644 --- a/dags/bqetl_domain_meta.py +++ b/dags/bqetl_domain_meta.py @@ -51,6 +51,6 @@ with DAG( owner="wstuckey@mozilla.com", email=["wstuckey@mozilla.com"], date_partition_parameter="submission_date", - table_partition_template='{{ dag_run.logical_date.strftime("%Y%m") }}', + table_partition_template='${{ dag_run.logical_date.strftime("%Y%m") }}', depends_on_past=False, )