Skip to content

Commit acc9421

Browse files
jayvdbjonmmease
authored andcommitted
Replace requests.compat.json with real json (#1561)
requests.compat.json may use simplejson, which is incompatible with plotly.py usage of json. Fixes #1556
1 parent 3f890a5 commit acc9421

File tree

24 files changed

+24
-24
lines changed

24 files changed

+24
-24
lines changed

chart_studio/api/v1/clientresp.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import warnings
55

6-
from requests.compat import json as _json
6+
import json as _json
77

88

99
from _plotly_utils.utils import PlotlyJSONEncoder

chart_studio/api/v2/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import absolute_import
22

33
import requests
4-
from requests.compat import json as _json
4+
import json as _json
55
from requests.exceptions import RequestException
66
from retrying import retry
77

chart_studio/grid_objs/grid_objs.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
except ImportError:
1313
from collections import MutableSequence
1414

15-
from requests.compat import json as _json
15+
import json as _json
1616

1717
from _plotly_utils.optional_imports import get_module
1818
from chart_studio import utils, exceptions

chart_studio/plotly/plotly.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
import six
2828
import six.moves
29-
from requests.compat import json as _json
29+
import json as _json
3030

3131
import _plotly_utils.utils
3232
import _plotly_utils.exceptions

chart_studio/tests/test_plot_ly/test_api/test_v1/test_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import absolute_import
22

33
from requests import Response
4-
from requests.compat import json as _json
4+
import json as _json
55
from requests.exceptions import ConnectionError
66

77
from chart_studio.api.utils import to_native_utf8_string

chart_studio/tests/test_plot_ly/test_api/test_v2/test_grids.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import absolute_import
22

3-
from requests.compat import json as _json
3+
import json as _json
44

55
from chart_studio.api.v2 import grids
66
from chart_studio.tests.test_plot_ly.test_api import PlotlyApiTestCase

chart_studio/tests/test_plot_ly/test_api/test_v2/test_images.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import absolute_import
22

3-
from requests.compat import json as _json
3+
import json as _json
44

55
from chart_studio.api.v2 import images
66
from chart_studio.tests.test_plot_ly.test_api import PlotlyApiTestCase

chart_studio/tests/test_plot_ly/test_api/test_v2/test_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import absolute_import
22

3-
from requests.compat import json as _json
3+
import json as _json
44
from requests.exceptions import ConnectionError
55

66
from plotly import version

chart_studio/tests/test_plot_ly/test_get_requests/test_get_requests.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import requests
1111
import six
1212
from nose.plugins.attrib import attr
13-
from requests.compat import json as _json
13+
import json as _json
1414

1515
from chart_studio.tests.utils import PlotlyTestCase
1616

chart_studio/tests/test_plot_ly/test_plotly/test_plot.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import requests
1111
import six
1212
import sys
13-
from requests.compat import json as _json
13+
import json as _json
1414
import warnings
1515

1616
from nose.plugins.attrib import attr

chart_studio/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import threading
1313
import warnings
1414

15-
from requests.compat import json as _json
15+
import json as _json
1616

1717
from _plotly_utils.exceptions import PlotlyError
1818
from _plotly_utils.optional_imports import get_module

chart_studio/widgets/graph_widget.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from collections import deque
77
import pkgutil
88

9-
from requests.compat import json as _json
9+
import json as _json
1010

1111
# TODO: protected imports?
1212
import ipywidgets as widgets

plotly/graph_reference.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import pkgutil
1010

1111
import six
12-
from requests.compat import json as _json
12+
import json as _json
1313

1414
from plotly import utils
1515

plotly/tests/test_core/test_graph_reference/test_graph_reference.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from unittest import TestCase
99

1010
from nose.plugins.attrib import attr
11-
from requests.compat import json as _json
11+
import json as _json
1212

1313
from plotly import graph_reference as gr
1414
from plotly.api import v2

plotly/tests/test_core/test_offline/test_offline.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from unittest import TestCase
99

1010
from nose.plugins.attrib import attr
11-
from requests.compat import json as _json
11+
import json as _json
1212

1313
import plotly
1414
import json

plotly/tests/test_core/test_utils/test_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from inspect import getargspec
44
from unittest import TestCase
55

6-
from requests.compat import json as _json
6+
import json as _json
77

88
from plotly.utils import (PlotlyJSONEncoder, get_by_path, memoize,
99
node_generator)

plotly/tests/test_optional/test_offline/test_offline.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import re
77
from nose.tools import raises
88
from nose.plugins.attrib import attr
9-
from requests.compat import json as _json
9+
import json as _json
1010

1111
from unittest import TestCase
1212

plotly/tests/test_optional/test_utils/test_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import pytz
1616
from nose.plugins.attrib import attr
1717
from pandas.util.testing import assert_series_equal
18-
from requests.compat import json as _json
18+
import json as _json
1919

2020
from plotly import optional_imports, utils
2121
from plotly.graph_objs import Scatter, Scatter3d, Figure, Data

plotly/tests/test_plot_ly/test_api/test_v1/test_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from unittest import TestCase
44

55
from requests import Response
6-
from requests.compat import json as _json
6+
import json as _json
77
from requests.exceptions import ConnectionError
88

99
from plotly.api.utils import to_native_utf8_string

plotly/tests/test_plot_ly/test_api/test_v2/test_grids.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import absolute_import
22

3-
from requests.compat import json as _json
3+
import json as _json
44

55
from plotly.api.v2 import grids
66
from plotly.tests.test_plot_ly.test_api import PlotlyApiTestCase

plotly/tests/test_plot_ly/test_api/test_v2/test_images.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import absolute_import
22

3-
from requests.compat import json as _json
3+
import json as _json
44

55
from plotly.api.v2 import images
66
from plotly.tests.test_plot_ly.test_api import PlotlyApiTestCase

plotly/tests/test_plot_ly/test_api/test_v2/test_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import absolute_import
22

3-
from requests.compat import json as _json
3+
import json as _json
44
from requests.exceptions import ConnectionError
55

66
from plotly import version

plotly/tests/test_plot_ly/test_get_requests/test_get_requests.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import requests
1111
import six
1212
from nose.plugins.attrib import attr
13-
from requests.compat import json as _json
13+
import json as _json
1414

1515
from plotly.tests.utils import PlotlyTestCase
1616

plotly/tests/test_plot_ly/test_plotly/test_plot.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import requests
1111
import six
1212
import sys
13-
from requests.compat import json as _json
13+
import json as _json
1414
import warnings
1515

1616
from nose.plugins.attrib import attr

0 commit comments

Comments
 (0)