6464from json import dumps
6565from os import environ
6666from types import ModuleType
67- from typing import List , MutableMapping , Optional , Sequence , Union , cast
67+ from typing import List , MutableMapping , Optional , cast
6868from urllib import parse
6969
7070from opentelemetry .attributes import BoundedAttributes
@@ -211,9 +211,10 @@ def create(
211211
212212 if not resource .attributes .get (SERVICE_NAME , None ):
213213 default_service_name = "unknown_service"
214- process_executable_name = cast (Optional [str ], resource .attributes .get (
215- PROCESS_EXECUTABLE_NAME , None
216- ))
214+ process_executable_name = cast (
215+ Optional [str ],
216+ resource .attributes .get (PROCESS_EXECUTABLE_NAME , None ),
217+ )
217218 if process_executable_name :
218219 default_service_name += ":" + process_executable_name
219220 resource = resource .merge (
@@ -266,7 +267,7 @@ def merge(self, other: "Resource") -> "Resource":
266267 other .schema_url ,
267268 )
268269 return self
269- return Resource (merged_attributes , schema_url ) # type: ignore
270+ return Resource (merged_attributes , schema_url ) # type: ignore
270271
271272 def __eq__ (self , other : object ) -> bool :
272273 if not isinstance (other , Resource ):
@@ -278,11 +279,13 @@ def __eq__(self, other: object) -> bool:
278279
279280 def __hash__ (self ) -> int :
280281 return hash (
281- f"{ dumps (self ._attributes .copy (), sort_keys = True )} |{ self ._schema_url } " # type: ignore
282+ f"{ dumps (self ._attributes .copy (), sort_keys = True )} |{ self ._schema_url } " # type: ignore
282283 )
283284
284285 def to_json (self , indent : int = 4 ) -> str :
285- attributes : MutableMapping [str , AttributeValue ] = dict (self ._attributes )
286+ attributes : MutableMapping [str , AttributeValue ] = dict (
287+ self ._attributes
288+ )
286289 return dumps (
287290 {
288291 "attributes" : attributes , # type: ignore
0 commit comments