Skip to content

Commit

Permalink
Implement small requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dgetu committed May 25, 2021
1 parent 7a0c286 commit b7450eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def merge(self, other: "Resource") -> "Resource":
elif self.schema_url == other.schema_url:
schema_url = other.schema_url
else:
schema_url = "merge-conflict"
schema_url = ""
logger.error(
"Failed to merge resources: The Schema URL of the old and updating resources are not empty and are different"
)
Expand Down
3 changes: 2 additions & 1 deletion opentelemetry-sdk/tests/resources/test_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def test_create(self):
resource = resources.Resource.create(attributes)
self.assertIsInstance(resource, resources.Resource)
self.assertEqual(resource.attributes, expected_attributes)
self.assertEqual(resource.schema_url, "")

schema_url = "https://opentelemetry.io/schemas/1.3.0"

Expand Down Expand Up @@ -146,7 +147,7 @@ def test_resource_merge(self):
left = resources.Resource.create({}, schema_urls[0])
right = resources.Resource.create({}, schema_urls[1])
with self.assertLogs(level=ERROR):
left.merge(right)
self.assertEqual(left.merge(right).schema_url, "")

def test_resource_merge_empty_string(self):
"""Verify Resource.merge behavior with the empty string.
Expand Down

0 comments on commit b7450eb

Please sign in to comment.