mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-13 13:10:29 +00:00
fix(core): Fix AWEL branch bug (#1640)
This commit is contained in:
@@ -123,7 +123,7 @@ with DAG("awel_branch_operator") as dag:
|
||||
task = BranchOperator(branches=branch_mapping)
|
||||
even_task = MapOperator(task_name="even_task", map_function=even_func)
|
||||
odd_task = MapOperator(task_name="odd_task", map_function=odd_func)
|
||||
join_task = JoinOperator(combine_function=combine_function)
|
||||
join_task = JoinOperator(combine_function=combine_function, can_skip_in_branch=False)
|
||||
input_task >> task >> even_task >> join_task
|
||||
input_task >> task >> odd_task >> join_task
|
||||
|
||||
@@ -133,6 +133,8 @@ print("=" * 80)
|
||||
print("Second call, input is 6")
|
||||
assert asyncio.run(join_task.call(call_data=6)) == 60
|
||||
```
|
||||
Note: `can_skip_in_branch` is used to control whether current task can be skipped in the branch.
|
||||
Set it to `False` to prevent the task from being skipped.
|
||||
|
||||
And run the following command to execute the code:
|
||||
|
||||
|
Reference in New Issue
Block a user