Skip to content

Bug: typecheck failing in main #3321

Closed
@jomcgi

Description

@jomcgi

Describe your environment

OS: Ubuntu
Python version: Python 3.12
Package version: main

What happened?

CI is failing on typecheck for main.

Steps to Reproduce

  1. Checkout main
  2. Run tox -e typecheck

Expected Result

tox -e typecheck passes for main

Actual Result

/workspaces/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-threading/src/opentelemetry/instrumentation/threading/__init__.py
  /workspaces/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-threading/src/opentelemetry/instrumentation/threading/__init__.py:153:28 - error: Argument of type "Token[Context] | None" cannot be assigned to parameter "token" of type "Token[Context]" in function "detach"
    Type "Token[Context] | None" is not assignable to type "Token[Context]"
      "None" is not assignable to "Token[Context]" (reportArgumentType)
  /workspaces/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-threading/src/opentelemetry/instrumentation/threading/__init__.py:172:32 - error: Argument of type "Token[Context] | None" cannot be assigned to parameter "token" of type "Token[Context]" in function "detach"
    Type "Token[Context] | None" is not assignable to type "Token[Context]"
      "None" is not assignable to "Token[Context]" (reportArgumentType)
2 errors, 0 warnings, 0 informations 

Additional context

Likely related to open-telemetry/opentelemetry-python#4346

Would you like to implement a fix?

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions