From b79c6ba975d6828cc14f03a11809486d53884e41 Mon Sep 17 00:00:00 2001 From: Jon Mease Date: Mon, 27 Jul 2020 05:42:11 -0400 Subject: [PATCH] Delay import of plotly until transform method to avoid possibility of circular import --- repos/kaleido/py/kaleido/scopes/plotly.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repos/kaleido/py/kaleido/scopes/plotly.py b/repos/kaleido/py/kaleido/scopes/plotly.py index 3896fad8..79d36e94 100644 --- a/repos/kaleido/py/kaleido/scopes/plotly.py +++ b/repos/kaleido/py/kaleido/scopes/plotly.py @@ -1,7 +1,6 @@ from __future__ import absolute_import from kaleido.scopes.base import BaseScope from _plotly_utils.utils import PlotlyJSONEncoder -from plotly.graph_objects import Figure import base64 @@ -66,6 +65,7 @@ def transform(self, figure, format=None, width=None, height=None, scale=None): :return: image bytes """ # TODO: validate args + from plotly.graph_objects import Figure if isinstance(figure, Figure): figure = figure.to_dict()