fix(dag_factory): safely clean task_group child on fallback
This commit is contained in:
@@ -556,6 +556,8 @@ def build_dag_from_yaml(config_file: str) -> DAG:
|
|||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"[COSMOS_FALLBACK] Error creating DbtTaskGroup for {t_id}: {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_obj = DbtTrinoIcebergOperator(
|
||||||
task_id=t_id,
|
task_id=t_id,
|
||||||
select_models=select_m,
|
select_models=select_m,
|
||||||
|
|||||||
Reference in New Issue
Block a user