1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] How do I get around a typing issue for execute_workflow in PyCharm

Discussão em 'Python' iniciado por Stack, Novembro 24, 2025.

  1. Stack

    Stack Membro Participativo

    I have a test that has code that executes a workflow which PyCharm marks as incorrect (pyright doesn't complain)

    result = await workflow_client.execute_workflow(
    SayHelloWorkflow.run,
    req,
    id="say-hello-test",
    task_queue=task_queue
    )


    It is getting this type error:


    Unexpected type(s): ((request: MyReq, Any) -> Coroutine[Any, Any, MyResp], MyReq, str, str)

    Possible type(s): (MethodAsyncSingleParam[SelfType, ParamType, ReturnType], MyReq, str, str) (str, Any, str, str)
    ​

    SayHelloWorkflow is defined as

    @workflow.defn
    class SayHelloWorkflow:
    @workflow.run
    async def run(
    self, request: MyReq
    ) -> MyResp:

    return await workflow.execute_activity(
    "SayHello",
    request,
    start_to_close_timeout=timedelta(seconds=10),
    )

    Continue reading...

Compartilhe esta Página