Update tutorials/workflow/python/fan-out-fan-in/fan_out_fan_in/fanoutfanin_workflow.py

Co-authored-by: Dzvezdana Arsovska <arsovska93@gmail.com>
Signed-off-by: Marc Duiker <marcduiker@users.noreply.github.com>
This commit is contained in:
Marc Duiker 2025-05-14 12:59:28 +02:00 committed by GitHub
parent 376a7ca850
commit 2f105b2c6b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 2 deletions

View File

@ -16,8 +16,7 @@ def fanoutfanin_workflow(ctx: wf.DaprWorkflowContext, words: List[str]):
ctx.call_activity(get_word_length, input=word) for word in words
]
all_word_lengths = yield wf.when_all(tasks)
sorted_word_lengths = sorted(all_word_lengths, key=lambda x: x.length)
shortest_word = sorted_word_lengths[0]
shortest_word = min(all_word_lengths, key=lambda x: x.length)
return shortest_word.word
@wf_runtime.activity(name='get_word_length')