open-telemetry / opentelemetry-python

OpenTelemetry Python API and SDK
https://opentelemetry.io
Apache License 2.0
1.66k stars 568 forks source link

Running mypy on SDK resources #3995

Open Medinatlawal opened 5 days ago

Medinatlawal commented 5 days ago

Part of https://github.com/open-telemetry/opentelemetry-python/issues/1608

Addressing running mypy on opentelemetry-sdk iteratively so we don't have to make one big change addressing all mypy issues at once.

Medinatlawal commented 3 days ago

There's still about 7 errors left on resource file that I'm stuck on, if anyone can help with some advice on how to address them or know how that address them that'd be great! Alot of the leftover errors have to do with "Type"Any"".

emdneto commented 3 days ago

Pasting errors here:

$ mypy --install-types --non-interactive --namespace-packages --explicit-package-bases opentelemetry-sdk/src/opentelemetry/sdk/resources

opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py:69: error: Module "opentelemetry.attributes" has no attribute "BoundedAttributes"  [attr-defined]
opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py:198: error: Expression has type "Any"  [misc]
opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py:199: error: Expression type contains "Any" (has type "Iterator[Any]")  [misc]
opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py:199: error: Expression type contains "Any" (has type "SupportsNext[Any]")  [misc]
opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py:286: error: Expression type contains "Any" (has type "dict[Any, Any]")  [misc]
opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py:373: error: Expression has type "Any"  [misc]
opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py:374: error: Expression has type "Any"  [misc]