Skip to content

Commit d744a08

Browse files
committed
DOC: Add missing docstring
1 parent 9ecc28d commit d744a08

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

octue/cloud/events/attributes.py

+6
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,12 @@ def __init__(
173173
self.ephemeral_storage = ephemeral_storage
174174

175175
def to_minimal_dict(self):
176+
"""Convert the attributes to a minimal dictionary containing only the attributes that have a non-`None` value.
177+
Using a minimal dictionary means the smallest possible data structure is used so `None` values don't,
178+
for example, need to be redundantly encoded and transmitted when part of a JSON payload for a Pub/Sub message.
179+
180+
:return dict: the non-`None` attributes
181+
"""
176182
return {
177183
**super().to_minimal_dict(),
178184
**make_minimal_dictionary(

0 commit comments

Comments
 (0)