Skip to content

Ensure optional dependencies are optional #2508

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
Mar 27, 2024

Conversation

pquentin
Copy link
Member

orjson is an optional dependency, but I was checking its absence with ModuleNotFoundError, a child exception of ImportError. While import orjson will indeed raise ModuleNotFoundError, from .serializer import OrjsonSerializer raises ImportError instead because the module (.serializer) was found.

OpenTelemetry is already tested in separate integration tests, but checking it explicitly in lint seemed useful as it's only one more line.

Copy link

A documentation preview will be available soon.

Request a new doc build by commenting
  • Rebuild this PR: run docs-build
  • Rebuild this PR and all Elastic docs: run docs-build rebuild

run docs-build is much faster than run docs-build rebuild. A rebuild should only be needed in rare situations.

If your PR continues to fail for an unknown reason, the doc build pipeline may be broken. Elastic employees can check the pipeline status here.

@ezimuel
Copy link
Contributor

ezimuel commented Mar 27, 2024

LGTM!

@pquentin pquentin merged commit 0e6c4cd into elastic:main Mar 27, 2024
12 checks passed
@pquentin pquentin deleted the lint-optional-dependencies branch March 27, 2024 10:59
github-actions bot pushed a commit that referenced this pull request Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants