dapr / python-sdk

Dapr SDK for Python
Apache License 2.0
230 stars 128 forks source link

change call_child_workflow to pass correct wf name to durabletask worker #616

Closed bkc closed 1 year ago

bkc commented 1 year ago

Description

durabletask.worker uses orchestrator.__name__ here

but when dapr_workflow_context wraps the real workflow function in wf, the correct orchestrator name is lost.

This bug results in the following exception:

durabletask.task.TaskFailedError: Sub-orchestration task #1 failed: A 'wf' orchestrator was not registered.

when called as

raw_download_result = yield ctx.call_child_workflow(
            workflow=files_com_wf.files_com_download_file_wf,
            input=path,
            instance_id=None,
        )

This proposed fix is not pretty, but it works.

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #615

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

There aren't any existing tests or even any examples that use call_child_workflow, I'm sorry I do not have time to write tests or documentation at this time.