Skip to content

Commit ad9dbd9

Browse files
committed
fix if/else for when engine not specified
1 parent 249cc9f commit ad9dbd9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

plotly/io/_kaleido.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,10 @@ def to_image(
9797
# -------------
9898
if engine is not None:
9999
warnings.warn(
100-
f"DeprecationWarning: The 'engine' argument is deprecated. Kaleido will be the only supported engine after {ENGINE_SUPPORT_TIMELINE}.",
100+
f"The 'engine' argument is deprecated. Kaleido will be the only supported engine after {ENGINE_SUPPORT_TIMELINE}.",
101101
DeprecationWarning,
102102
)
103+
else:
103104
engine = "auto"
104105

105106
if engine == "auto":
@@ -180,7 +181,8 @@ def to_image(
180181
else:
181182
# Kaleido v0
182183
warnings.warn(
183-
f"Support for Kaleido versions less than 1.0.0 is deprecated and will be removed after {ENGINE_SUPPORT_TIMELINE}. Please upgrade Kaleido to version 1.0.0 or greater (`pip install --upgrade kaleido`).",
184+
f"Support for Kaleido versions less than 1.0.0 is deprecated and will be removed after {ENGINE_SUPPORT_TIMELINE}. "
185+
+ "Please upgrade Kaleido to version 1.0.0 or greater (`pip install --upgrade kaleido`).",
184186
DeprecationWarning,
185187
)
186188
img_bytes = scope.transform(
@@ -385,7 +387,8 @@ def full_figure_for_development(fig, warn=True, as_dict=False):
385387
else:
386388
# Kaleido v0
387389
warnings.warn(
388-
f"Support for Kaleido versions less than 1.0.0 is deprecated and will be removed after {ENGINE_SUPPORT_TIMELINE}. Please upgrade Kaleido to version 1.0.0 or greater (`pip install --upgrade kaleido`).",
390+
f"Support for Kaleido versions less than 1.0.0 is deprecated and will be removed after {ENGINE_SUPPORT_TIMELINE}. "
391+
+ "Please upgrade Kaleido to version 1.0.0 or greater (`pip install --upgrade kaleido`).",
389392
DeprecationWarning,
390393
)
391394
fig = json.loads(scope.transform(fig, format="json").decode("utf-8"))

0 commit comments

Comments
 (0)