@@ -173,7 +173,7 @@ def test_column_json_encoding():
173
173
'"2014-01-05 01:01:01", '
174
174
'"2014-01-05 01:01:01.000001"], '
175
175
'"name": "col 2"}, '
176
- '{"data": [1, 2, 3, NaN, NaN, Infinity , '
176
+ '{"data": [1, 2, 3, null, null, null , '
177
177
'"2014-01-05"], "name": "col 3"}]' == json_columns )
178
178
179
179
@@ -188,7 +188,7 @@ def test_figure_json_encoding():
188
188
js2 = json .dumps (s2 , cls = utils .PlotlyJSONEncoder , sort_keys = True )
189
189
190
190
assert (js1 == '{"type": "scatter3d", "x": [1, 2, 3], '
191
- '"y": [1, 2, 3, NaN, NaN, Infinity , "2014-01-05"], '
191
+ '"y": [1, 2, 3, null, null, null , "2014-01-05"], '
192
192
'"z": [1, "A", "2014-01-05", '
193
193
'"2014-01-05 01:01:01", "2014-01-05 01:01:01.000001"]}' )
194
194
assert (js2 == '{"type": "scatter", "x": [1, 2, 3]}' )
@@ -219,7 +219,7 @@ def test_datetime_json_encoding():
219
219
220
220
def test_pandas_json_encoding ():
221
221
j1 = json .dumps (df ['col 1' ], cls = utils .PlotlyJSONEncoder )
222
- assert (j1 == '[1, 2, 3, "2014-01-05", null, NaN, Infinity ]' )
222
+ assert (j1 == '[1, 2, 3, "2014-01-05", null, null, null ]' )
223
223
224
224
# Test that data wasn't mutated
225
225
assert_series_equal (df ['col 1' ],
@@ -249,7 +249,7 @@ def test_numpy_masked_json_encoding():
249
249
l = [1 , 2 , np .ma .core .masked ]
250
250
j1 = json .dumps (l , cls = utils .PlotlyJSONEncoder )
251
251
print j1
252
- assert (j1 == '[1, 2, NaN ]' )
252
+ assert (j1 == '[1, 2, null ]' )
253
253
assert (set (l ) == set ([1 , 2 , np .ma .core .masked ]))
254
254
255
255
@@ -276,7 +276,7 @@ def test_masked_constants_example():
276
276
jy = json .dumps (renderer .plotly_fig ['data' ][1 ]['y' ],
277
277
cls = utils .PlotlyJSONEncoder )
278
278
assert (jy == '[-398.11793026999999, -398.11792966000002, '
279
- '-398.11786308000001, NaN ]' )
279
+ '-398.11786308000001, null ]' )
280
280
281
281
282
282
def test_numpy_dates ():
0 commit comments