From b7450ebfadefa54c0076e2838273f23448ca838b Mon Sep 17 00:00:00 2001 From: Daniel Getu Date: Tue, 25 May 2021 10:20:45 -0700 Subject: [PATCH] Implement small requested changes --- opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py | 2 +- opentelemetry-sdk/tests/resources/test_resources.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py b/opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py index 5ecdd661899..55173748507 100644 --- a/opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py +++ b/opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py @@ -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" ) diff --git a/opentelemetry-sdk/tests/resources/test_resources.py b/opentelemetry-sdk/tests/resources/test_resources.py index d199a41a8cb..76af6cb2695 100644 --- a/opentelemetry-sdk/tests/resources/test_resources.py +++ b/opentelemetry-sdk/tests/resources/test_resources.py @@ -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" @@ -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.