temporalio / sdk-python

Temporal Python SDK
MIT License
474 stars 77 forks source link

[Bug] Fix lint warnings for Client.execute_workflow #444

Closed lethe3000 closed 11 months ago

lethe3000 commented 11 months ago

What are you really trying to do?

Execute a workflow using python sdk: client.execute_workflow

Describe the bug

I followed tutorial: Build a data pipeline Workflow with Temporal and Python with code

stories = await client.execute_workflow(
        TemporalCommunityWorkflow.run,
        id="temporal-community-workflow",
        task_queue=TASK_QUEUE_NAME,
    )

but got lint warnings as below:

Unexpected type(s):(() -> Coroutine[Any, Any, list[TemporalCommunityPost]], str, Any)Possible type(s):(MethodAsyncNoParam[SelfType, ReturnType], str, str)(str, str, str)

Minimal Reproduction

Environment/Versions

cretz commented 11 months ago

Assuming the workflow properly doesn't have any parameters, I wonder if Pycharm is the problem here and not Temporal. Can you confirm this same issue happens with other type checkers like MyPy and Pyright/vscode?

lethe3000 commented 11 months ago

Assuming the workflow properly doesn't have any parameters, I wonder if Pycharm is the problem here and not Temporal. Can you confirm this same issue happens with other type checkers like MyPy and Pyright/vscode?

I tested my code with pyright, no issues reported, it should be a Pycharm issue.

cretz commented 11 months ago

:+1: Closing issue. May be worth opening an issue there. We test with MyPy in our CI, but we don't have one for a specific IDE.