Skip to content

Commit e8eedf2

Browse files
committed
Fixed for-export MapData serialization to HighchartsMeta.trim_dict()
1 parent 620c468 commit e8eedf2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

highcharts_core/metaclasses.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,18 @@ def trim_dict(untrimmed: dict,
323323
trimmed_value = str(value)
324324
if trimmed_value and trimmed_value != 'None':
325325
as_dict[key] = trimmed_value
326+
# MapData -> dict --> object
327+
elif checkers.is_type(value, 'MapData') and to_json and for_export:
328+
untrimmed_value = value._to_untrimmed_dict()
329+
updated_context = value.__class__.__name__
330+
topology = untrimmed_value.get('topology', None)
331+
if topology:
332+
trimmed_value = topology.to_dict()
333+
else:
334+
trimmed_value = None
335+
336+
if trimmed_value:
337+
as_dict[key] = trimmed_value
326338
# HighchartsMeta -> dict --> object
327339
elif value and hasattr(value, '_to_untrimmed_dict'):
328340
untrimmed_value = value._to_untrimmed_dict()

0 commit comments

Comments
 (0)