-
Notifications
You must be signed in to change notification settings - Fork 650
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
typing issue with start_as_current_span #3836
Comments
@PietroPasotti thanks for reporting, any idea on how to fix that? |
Sorry but no, I looked a bit into it but I'm not familiar enough with ParamSpec to be useful. Will take another look if I have time next week. |
@PietroPasotti do you get the error when you run pyright against docs/examples/auto-instrumentation/client.py on latest main? I'm getting a different error, but not one for
|
@PietroPasotti does this happen for you with 3.11. I am seeing a similar issue with 3.9 and older microsoft/Qcodes#5899 I believe the 3.9 issue is caused by typing.ParamSpec not existing on 3.9 which results in the type effectivly just being a string that would never type check with 3.9. Normally I would suggest that opentelemetry should depend on typing_extensions and use the backported version for older python versions but I am not sure if that is against some policy? For 3.11 I guess it could be an issue specific to an older patch version. Which exact version are you running? I think there may have been some fixes to paramspec in the patch versions. Note also that the version of pyright that you are using is fairly old. Latest version is 1.1.358. Could you try with a newer one? |
tried with pyright 1.1.358, the error is different but on the same line.
on |
Modifying the source to import ParamSpec from typing_extensions fixes it. |
@PietroPasotti Which exact version of python 3.11 are you using. Looks like there were bugfixes to Paramspec in 3.11.1 and 3.11.3 https://docs.python.org/release/3.11.9/whatsnew/changelog.html#python-3-11-9 |
3.11.8 |
I suspect #3633 broke type checkers' ability to inspect the signature of
start_as_current_span
.Describe your environment
python 3.11
opentelemetry-exporter-otlp-proto-http==1.24.0
pyright==1.1.331
Steps to reproduce
run pyright on code using
tracer.start_as_current_span(name)
ortracer.start_as_current_span(name=name)
What is the expected behavior?
nothing :)
What is the actual behavior?
error: No parameter named "name" (reportGeneralTypeIssues)
or
error: Expected 0 positional arguments (reportGeneralTypeIssues)
Additional context
Probably introduced by #3633
The text was updated successfully, but these errors were encountered: