Skip to content

Type check against opentelemetry-api #92

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

Merged
merged 1 commit into from
Oct 15, 2024
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
2 changes: 1 addition & 1 deletion elasticsearch_serverless/_otel.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def helpers_span(self, span_name: str) -> Generator[OpenTelemetrySpan, None, Non

@contextlib.contextmanager
def use_span(self, span: OpenTelemetrySpan) -> Generator[None, None, None]:
if not self.enabled or self.tracer is None:
if not self.enabled or self.tracer is None or span.otel_span is None:
yield
return

Expand Down
6 changes: 4 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,16 @@ def format(session):

@nox.session()
def lint(session):
session.install("flake8", "black~=24.0", "mypy", "isort", "types-requests")
session.install(
"flake8", "black~=24.0", "mypy", "isort", "types-requests", "opentelemetry-api"
)

session.run("isort", "--check", "--profile=black", *SOURCE_FILES)
session.run("black", "--check", *SOURCE_FILES)
session.run("flake8", *SOURCE_FILES)
session.run("python", "utils/license-headers.py", "check", *SOURCE_FILES)

session.install(".[async,requests,orjson,pyarrow]", env=INSTALL_ENV)
session.install(".[dev]", env=INSTALL_ENV)

# Run mypy on the package and then the type examples separately for
# the two different mypy use-cases, ourselves and our users.
Expand Down
Loading