Skip to content

Commit

Permalink
Use always empty for None schema url value (#2764)
Browse files Browse the repository at this point in the history
* Use always None for empty schema url value

Fixes #2750

* Revert "Use always None for empty schema url value"

This reverts commit 8ef29db.

* Use empty string as default value for schema_url
  • Loading branch information
ocelotl authored Jun 24, 2022
1 parent 71d2ab4 commit 25771ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ def __init__(
):
self._name = name
self._version = version
if schema_url is None:
schema_url = ""
self._schema_url = schema_url

def __repr__(self):
Expand Down Expand Up @@ -90,6 +92,8 @@ def __init__(
) -> None:
self._name = name
self._version = version
if schema_url is None:
schema_url = ""
self._schema_url = schema_url

def __repr__(self) -> str:
Expand Down
4 changes: 2 additions & 2 deletions opentelemetry-sdk/tests/trace/test_trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def test_invalid_instrumentation_info(self):
)
span1 = tracer1.start_span("foo")
self.assertTrue(span1.is_recording())
self.assertEqual(tracer1.instrumentation_info.schema_url, None)
self.assertEqual(tracer1.instrumentation_info.schema_url, "")
self.assertEqual(tracer1.instrumentation_info.version, "")
self.assertEqual(tracer1.instrumentation_info.name, "")

Expand All @@ -280,7 +280,7 @@ def test_invalid_instrumentation_info(self):
)
span2 = tracer2.start_span("bar")
self.assertTrue(span2.is_recording())
self.assertEqual(tracer2.instrumentation_info.schema_url, None)
self.assertEqual(tracer2.instrumentation_info.schema_url, "")
self.assertEqual(tracer2.instrumentation_info.version, "")
self.assertEqual(tracer2.instrumentation_info.name, "")

Expand Down

0 comments on commit 25771ec

Please sign in to comment.