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

Object of type "None" is not subscriptable

Open tekumara opened this issue 7 months ago • 2 comments

Describe your environment

sdk 1.32.1

What happened?

errors in vscode/pyright with

Object of type "None" is not subscriptablePylance[reportOptionalSubscript](https://github.com/microsoft/pyright/blob/main/docs/configuration.md#reportOptionalSubscript)

Image

Steps to Reproduce

print(span.attributes["name"])

Expected Result

No type error because span.attributes can never be None.

Actual Result

Object of type "None" is not subscriptablePylance[reportOptionalSubscript](https://github.com/microsoft/pyright/blob/main/docs/configuration.md#reportOptionalSubscript)

Additional context

No response

Would you like to implement a fix?

None

tekumara avatar May 07 '25 11:05 tekumara