-
Notifications
You must be signed in to change notification settings - Fork 594
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
Re-export public symbols in opentelemetry.context
#3332
Conversation
b07a1c3
to
9b9aee3
Compare
@srikanthccv This should also be straightforward - it was one of the typing-related issues I encountered along with the changes in #3285. |
There is already |
@srikanthccv this seems to be pretty widely used in the wild, I'm on board with this PR. |
Avoids issues with typing where `mypy` complains because `Context` is not re-exported when using the following import: ```python from opentelemetry.context import Context ``` It's possible to work around this with the following, but it seems as though this is not intended: ```python from opentelemetry.context.context import Context ```
Context
opentelemetry.context
Thanks @aabmass. I've updated this to (re-)export all public symbols as requested. The only one I left out was |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks for the PR! @srikanthccv does it look OK to you?
I am fine with this. These transitive imports scare me because you never know how people are using them, and it was an overlooked aspect from our side. Not until metrics SDK we started using private internals and |
Description
Avoids issues with typing where
mypy
complains becauseContext
is not re-exported when using the following import:It's possible to work around this with the following, but it seems as though this is not intended:
Type of change
Does This PR Require a Contrib Repo Change?
Checklist: