Skip to content

Commit

Permalink
Change Resource dunder hash to reduce collisions
Browse files Browse the repository at this point in the history
Improves readability from the last commit
  • Loading branch information
dgetu committed May 25, 2021
1 parent 32ce848 commit 2801745
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)


Expand Down

0 comments on commit 2801745

Please sign in to comment.