sdk-python icon indicating copy to clipboard operation
sdk-python copied to clipboard

[Bug] Pyright typing issue

Open mattbrandman opened this issue 10 months ago • 2 comments

What are you really trying to do?

Ensure that my type checking returns minimal errors when using temporal execute_activity

Describe the bug

Type checking with Pyright strict returns partiallyUnknown error when using Temporal execute_activity I believe because the line here https://github.com/temporalio/sdk-python/blob/49ca10e413ba67e1adfeed3b5577cb4f5b007e54/temporalio/workflow.py#L2185 has an implicit Any on the optional Type

Adding an explicit Any allows Pyright to properly parse the block

Minimal Reproduction

Look at any execute_activity call in the samples repo with Pyright strict enabled in VSCode

Environment/Versions

  • OS and processor: [e.g. M1 Mac, x86 Windows, Linux]
  • Temporal Version: [e.g. 1.14.0?] and/or SDK version
  • Are you using Docker or Kubernetes or building Temporal from source?

Additional context

mattbrandman avatar Mar 25 '25 14:03 mattbrandman

Happy to open the PR for this if it's safe to add the explicit Any there

mattbrandman avatar Mar 25 '25 14:03 mattbrandman

Thanks @mattbrandman. Yes, PR welcome!

dandavison avatar Mar 25 '25 15:03 dandavison