Skip to content

Commit fc84a23

Browse files
committed
Fixed incorrect .to_json() serialization of null values inside of an iterable.
1 parent 0fa0b2c commit fc84a23

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

CHANGES.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11

2+
Release 1.7.4
3+
=========================================
4+
5+
* **BUGFIX:** Fixed incorrect ``.to_json()`` serialization of ``null`` values inside of an iterable.
6+
7+
--------------------
8+
9+
210
Release 1.7.3
311
=========================================
412

highcharts_core/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '1.7.3'
1+
__version__ = '1.7.4'

highcharts_core/metaclasses.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,10 @@ def trim_iterable(untrimmed,
230230
if checkers.is_type(item, 'CallbackFunction') and to_json:
231231
continue
232232
elif item is None or item == constants.EnforcedNull:
233-
trimmed.append('null')
233+
if to_json:
234+
trimmed.append(None)
235+
else:
236+
trimmed.append('null')
234237
elif hasattr(item, 'trim_dict'):
235238
updated_context = item.__class__.__name__
236239
untrimmed_item = item._to_untrimmed_dict()

0 commit comments

Comments
 (0)