23
23
import uuid
24
24
from platform import machine , processor , system
25
25
from types import MappingProxyType
26
- from typing import Optional , Any , List , Dict , Callable , Tuple , Union , TypeVar , Generic
26
+ from typing import Optional , Any , List , Dict , Callable , Tuple , Union , TypeVar , Generic , Iterable
27
27
28
28
from reportportal_client .core .rp_file import RPFile
29
29
@@ -144,15 +144,15 @@ def dict_to_payload(dictionary: Optional[dict]) -> Optional[List[dict]]:
144
144
return result
145
145
146
146
147
- def gen_attributes (rp_attributes : List [str ]) -> List [Dict [str , str ]]:
147
+ def gen_attributes (rp_attributes : Iterable [str ]) -> List [Dict [str , str ]]:
148
148
"""Generate list of attributes for the API request.
149
149
150
150
Example of input list:
151
151
['tag_name:tag_value1', 'tag_value2']
152
152
Output of the function for the given input list:
153
153
[{'key': 'tag_name', 'value': 'tag_value1'}, {'value': 'tag_value2'}]
154
154
155
- :param rp_attributes: List of attributes(tags)
155
+ :param rp_attributes: Iterable of attributes(tags)
156
156
:return: Correctly created list of dictionaries
157
157
to be passed to RP
158
158
"""
@@ -168,8 +168,7 @@ def gen_attributes(rp_attributes: List[str]) -> List[Dict[str, str]]:
168
168
if all (attr_dict .values ()):
169
169
attrs .append (attr_dict )
170
170
continue
171
- logger .debug ('Failed to process "{0}" attribute, attribute value'
172
- ' should not be empty.' .format (rp_attr ))
171
+ logger .debug (f'Failed to process "{ rp_attr } " attribute, attribute value should not be empty.' )
173
172
return attrs
174
173
175
174
0 commit comments