Skip to content

Commit

Permalink
Run pyright on Vertex AI instrumentation
Browse files Browse the repository at this point in the history
  • Loading branch information
aabmass committed Jan 15, 2025
1 parent a716949 commit d2ae60f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
---
"""

from typing import Collection
from typing import Any, Collection

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

def _instrument(self, **kwargs):
def _instrument(self, **kwargs: Any):
"""Enable VertexAI instrumentation."""
tracer_provider = kwargs.get("tracer_provider")
_tracer = get_tracer(
Expand All @@ -70,5 +70,5 @@ def _instrument(self, **kwargs):
)
# TODO: implemented in later PR

def _uninstrument(self, **kwargs) -> None:
def _uninstrument(self, **kwargs: Any) -> None:
"""TODO: implemented in later PR"""
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,13 @@ pythonVersion = "3.8"
reportPrivateUsage = false # Ignore private attributes added by instrumentation packages.
# Add progressively instrumentation packages here.
include = [
"instrumentation/opentelemetry-instrumentation-threading/**/*.py"
"instrumentation/opentelemetry-instrumentation-threading/**/*.py",
"instrumentation-genai/opentelemetry-instrumentation-vertexai/**/*.py",
]
# We should also add type hints to the test suite - It helps on finding bugs.
# We are excluding for now because it's easier, and more important to add to the instrumentation packages.
exclude = [
"instrumentation/opentelemetry-instrumentation-threading/tests/**",
"instrumentation-genai/opentelemetry-instrumentation-vertexai/tests/**/*.py",
"instrumentation-genai/opentelemetry-instrumentation-vertexai/examples/**/*.py",
]
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -994,5 +994,6 @@ deps =
{[testenv]test_deps}
{toxinidir}/opentelemetry-instrumentation
{toxinidir}/util/opentelemetry-util-http
{toxinidir}/instrumentation-genai/opentelemetry-instrumentation-vertexai[instruments]
commands =
pyright

0 comments on commit d2ae60f

Please sign in to comment.