Skip to content
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

Run pyright on Vertex AI instrumentation #3184

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading