diff --git a/dags/dag_factory.py b/dags/dag_factory.py index 7991feb..03ae9e7 100644 --- a/dags/dag_factory.py +++ b/dags/dag_factory.py @@ -556,6 +556,8 @@ def build_dag_from_yaml(config_file: str) -> DAG: ) except Exception as e: print(f"[COSMOS_FALLBACK] Error creating DbtTaskGroup for {t_id}: {e}") + if hasattr(dag, 'task_group') and t_id in dag.task_group.children: + del dag.task_group.children[t_id] task_obj = DbtTrinoIcebergOperator( task_id=t_id, select_models=select_m,