Prevent error when attempting to use None context.#541
Merged
Conversation
d5548e3 to
20e281e
Compare
apiarian-datadog
approved these changes
Nov 21, 2024
|
|
||
| def test_set_dd_trace_py_root_none_context(self): | ||
| set_dd_trace_py_root(TraceContextSource.EVENT, True) | ||
| self.mock_activate.assert_not_called() |
Contributor
There was a problem hiding this comment.
nit: this seems a to be a bit spookily-long-distance
Contributor
Author
There was a problem hiding this comment.
Sorry, I don't understand. The most important thing about this test is that it just doesn't raise an exception, which is what would happen before.
Contributor
There was a problem hiding this comment.
ah, i see! could we add a check that confirms that it is in fact none? or something?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
When the dd trace context is None, don't continue trying to use it.
Motivation
Self monitoring hit this error:
Testing Guidelines
Additional Notes
I suspect there are more places in here that need to be addressed.
Types of Changes
Check all that apply