Skip to content

Commit d2ae60f

Browse files
committed
Run pyright on Vertex AI instrumentation
1 parent a716949 commit d2ae60f

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

Diff for: instrumentation-genai/opentelemetry-instrumentation-vertexai/src/opentelemetry/instrumentation/vertexai/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
---
4040
"""
4141

42-
from typing import Collection
42+
from typing import Any, Collection
4343

4444
from opentelemetry._events import get_event_logger
4545
from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
@@ -52,7 +52,7 @@ class VertexAIInstrumentor(BaseInstrumentor):
5252
def instrumentation_dependencies(self) -> Collection[str]:
5353
return _instruments
5454

55-
def _instrument(self, **kwargs):
55+
def _instrument(self, **kwargs: Any):
5656
"""Enable VertexAI instrumentation."""
5757
tracer_provider = kwargs.get("tracer_provider")
5858
_tracer = get_tracer(
@@ -70,5 +70,5 @@ def _instrument(self, **kwargs):
7070
)
7171
# TODO: implemented in later PR
7272

73-
def _uninstrument(self, **kwargs) -> None:
73+
def _uninstrument(self, **kwargs: Any) -> None:
7474
"""TODO: implemented in later PR"""

Diff for: instrumentation-genai/opentelemetry-instrumentation-vertexai/src/opentelemetry/instrumentation/vertexai/py.typed

Whitespace-only changes.

Diff for: pyproject.toml

+4-1
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,13 @@ pythonVersion = "3.8"
4848
reportPrivateUsage = false # Ignore private attributes added by instrumentation packages.
4949
# Add progressively instrumentation packages here.
5050
include = [
51-
"instrumentation/opentelemetry-instrumentation-threading/**/*.py"
51+
"instrumentation/opentelemetry-instrumentation-threading/**/*.py",
52+
"instrumentation-genai/opentelemetry-instrumentation-vertexai/**/*.py",
5253
]
5354
# We should also add type hints to the test suite - It helps on finding bugs.
5455
# We are excluding for now because it's easier, and more important to add to the instrumentation packages.
5556
exclude = [
5657
"instrumentation/opentelemetry-instrumentation-threading/tests/**",
58+
"instrumentation-genai/opentelemetry-instrumentation-vertexai/tests/**/*.py",
59+
"instrumentation-genai/opentelemetry-instrumentation-vertexai/examples/**/*.py",
5760
]

Diff for: tox.ini

+1
Original file line numberDiff line numberDiff line change
@@ -994,5 +994,6 @@ deps =
994994
{[testenv]test_deps}
995995
{toxinidir}/opentelemetry-instrumentation
996996
{toxinidir}/util/opentelemetry-util-http
997+
{toxinidir}/instrumentation-genai/opentelemetry-instrumentation-vertexai[instruments]
997998
commands =
998999
pyright

0 commit comments

Comments
 (0)