Skip to content

Bug: typecheck failing in main #3321

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jomcgi opened this issue Mar 3, 2025 · 0 comments · Fixed by #3322
Closed

Bug: typecheck failing in main #3321

jomcgi opened this issue Mar 3, 2025 · 0 comments · Fixed by #3322
Labels
bug Something isn't working

Comments

@jomcgi
Copy link
Contributor

jomcgi commented Mar 3, 2025

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

@jomcgi jomcgi added the bug Something isn't working label Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant