Skip to content

Commit 013dad4

Browse files
committed
Fix empty parameter Dict conversion
1 parent f963b72 commit 013dad4

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Changelog
22

33
## [Unreleased]
4+
### Fixed
5+
- Empty parameter Dict conversion, by @HardNorth
46

57
## [5.5.8]
68
### Removed

reportportal_client/core/rp_requests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ def _create_request(**kwargs) -> dict:
295295
attributes = dict_to_payload(kwargs['attributes'])
296296
request['attributes'] = attributes
297297
parameters = kwargs.get('parameters')
298-
if parameters and isinstance(parameters, dict):
298+
if parameters is not None and isinstance(parameters, dict):
299299
parameters = dict_to_payload(kwargs['parameters'])
300300
request['parameters'] = parameters
301301
return request

reportportal_client/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def dict_to_payload(dictionary: Optional[dict]) -> Optional[List[dict]]:
130130
:param dictionary: Dictionary containing tags/attributes
131131
:return list: List of tags/attributes in the required format
132132
"""
133-
if not dictionary:
133+
if dictionary is None:
134134
return dictionary
135135
my_dictionary = dict(dictionary)
136136

0 commit comments

Comments
 (0)