Typing function parameters for activities etc. causes failure
Goldziher opened this issue Β· comments
π Describe the bug
When a function parameter for an activity or another such like function is typed using generic types, the function framework fails.
@blueprint.activity_trigger(input_name="params")
async def handle_file_download(
params: tuple[str, str, FileData],
) -> FileBlob | None:
....
To "fix" this, we have to use Any
or a primitive type:
@blueprint.activity_trigger(input_name="params")
async def handle_file_download(
params: Any,
) -> FileBlob | None:
....
Note, this issue is there for a while, see for example: https://learn.microsoft.com/en-gb/answers/questions/1444893/azure-durable-function-activity-finalout-failed-fu
Also note that this is using Python 3.11+, according to the link above this issue doesn't exist in lower versions of python.
π€ Expected behavior
We should be able to use typing properly for all function parameters
β Steps to reproduce
Create an activity and type its parameters as mentioned above.
Duplicate of #468?
Yup, seems so. Closing.