From 2bdd9bb2b71715ce783ac7d8343d819343ec2845 Mon Sep 17 00:00:00 2001 From: pankajastro Date: Tue, 1 Oct 2024 19:20:22 +0530 Subject: [PATCH] Add full_refresh as templated field --- cosmos/operators/airflow_async.py | 5 ++++- docs/getting_started/execution-modes.rst | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cosmos/operators/airflow_async.py b/cosmos/operators/airflow_async.py index 1752abb54..ced0daf53 100644 --- a/cosmos/operators/airflow_async.py +++ b/cosmos/operators/airflow_async.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import Any +from typing import Any, Sequence from airflow.providers.google.cloud.hooks.bigquery import BigQueryHook from airflow.providers.google.cloud.operators.bigquery import BigQueryInsertJobOperator @@ -44,6 +44,9 @@ class DbtSourceAirflowAsyncOperator(DbtSourceLocalOperator): class DbtRunAirflowAsyncOperator(BigQueryInsertJobOperator): # type: ignore + + template_fields: Sequence[str] = ("full_refresh",) + def __init__(self, *args, full_refresh: bool = False, **kwargs): # type: ignore # dbt task param self.profile_config = kwargs.get("profile_config") diff --git a/docs/getting_started/execution-modes.rst b/docs/getting_started/execution-modes.rst index 4b4275147..0c1b2f54d 100644 --- a/docs/getting_started/execution-modes.rst +++ b/docs/getting_started/execution-modes.rst @@ -285,7 +285,7 @@ Example DAG: **Known Issue:** -The ```dag test``` command failed with the following error, likely because the trigger does not fully initialize during the ```dag test```, leading to an uninitialized task instance. +The ``dag test`` command failed with the following error, likely because the trigger does not fully initialize during the ``dag test``, leading to an uninitialized task instance. This causes the BigQuery trigger to attempt accessing parameters of the Task Instance that are not properly initialized. .. code:: bash