From 2801745f217728ea8522fd25ed9480b942c7fd4c Mon Sep 17 00:00:00 2001 From: Daniel Getu Date: Tue, 25 May 2021 11:18:59 -0700 Subject: [PATCH] Change Resource dunder hash to reduce collisions Improves readability from the last commit --- opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py b/opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py index 4b52f5535a1..bf504e9f7fe 100644 --- a/opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py +++ b/opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py @@ -234,8 +234,8 @@ def __eq__(self, other: object) -> bool: ) def __hash__(self): - return hash(dumps(self._attributes, sort_keys=True)) + 31 * hash( - self._schema_url + return hash( + dumps(self._attributes, sort_keys=True) + "|" + self._schema_url )