Skip to content

Commit

Permalink
Fix empty parameter Dict conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth committed Oct 16, 2024
1 parent f963b72 commit 013dad4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Changelog

## [Unreleased]
### Fixed
- Empty parameter Dict conversion, by @HardNorth

## [5.5.8]
### Removed
Expand Down
2 changes: 1 addition & 1 deletion reportportal_client/core/rp_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ def _create_request(**kwargs) -> dict:
attributes = dict_to_payload(kwargs['attributes'])
request['attributes'] = attributes
parameters = kwargs.get('parameters')
if parameters and isinstance(parameters, dict):
if parameters is not None and isinstance(parameters, dict):
parameters = dict_to_payload(kwargs['parameters'])
request['parameters'] = parameters
return request
Expand Down
2 changes: 1 addition & 1 deletion reportportal_client/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def dict_to_payload(dictionary: Optional[dict]) -> Optional[List[dict]]:
:param dictionary: Dictionary containing tags/attributes
:return list: List of tags/attributes in the required format
"""
if not dictionary:
if dictionary is None:
return dictionary
my_dictionary = dict(dictionary)

Expand Down

0 comments on commit 013dad4

Please sign in to comment.