Skip to content

Commit 32f70ec

Browse files
authored
Delay import of plotly until transform method to avoid possibility of circular import (#25)
1 parent babe53e commit 32f70ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

repos/kaleido/py/kaleido/scopes/plotly.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import absolute_import
22
from kaleido.scopes.base import BaseScope
33
from _plotly_utils.utils import PlotlyJSONEncoder
4-
from plotly.graph_objects import Figure
54
import base64
65

76

@@ -66,6 +65,7 @@ def transform(self, figure, format=None, width=None, height=None, scale=None):
6665
:return: image bytes
6766
"""
6867
# TODO: validate args
68+
from plotly.graph_objects import Figure
6969
if isinstance(figure, Figure):
7070
figure = figure.to_dict()
7171

0 commit comments

Comments
 (0)