Code: Select all
if task_group:
print(f"[parse_wrkflw] task_group={task_group}")
else:
print(f"[parse_wrkflw] task_group is None")
print(f"[parse_wrkflw] task_id={task_id}")
task = PythonOperator(
task_id=task_id,
python_callable=execute_sql,
op_args=[sql_file],
dag=dag,
task_group=task_group
)
print(f"[parse_wrkflw] task.task_id={task.task_id}")
< /code>
Ich habe: < /p>
INFO - [parse_wrkflw] task_group is None
INFO - [parse_wrkflw] task_id=_if_0_true_while_0_loop_content_call_sql_0_test_file
INFO - [parse_wrkflw] task.task_id=_if_0_true_tasks._if_0_true_while_0_loop_content_call_sql_0_test_file
Code: Select all
{
"wrkflw" : [ {
"typ" : "IF",
"el" : "cond1",
"children" : [ {
"typ" : "WHILE",
"el" : "cond2",
"children" : [ {
"typ" : "CALL SQL",
"el" : "test_file.sql"
} ]
} ]
} ]
}
Code: Select all
with TaskGroup(group_id=f"{if_prefix}_true_tasks", task_group=task_group, dag=dag) as tg_true:
...
Die Idee mit der while logic ist diese:
Code: Select all
{previous tasks}Code: Select all
EmptyOperatorCode: Select all
BranchPythonOperatorCode: Select all
trigger_loop_dagCode: Select all
TriggerDagRunOperatorCode: Select all
EmptyOperatorCode: Select all
trigger_loop_dagCode: Select all
{children tasks of the WHILE}Code: Select all
BranchPythonOperatorCode: Select all
trigger_selfCode: Select all
TriggerDagRunOperatorCode: Select all
EmptyOperatorDies funktioniert im Grunde genommen vollkommen in Ordnung, wenn ich keine implizite Taskgroup über der Weile habe.>
Mobile version