Skip to content

Commit

Permalink
Add altair_saver deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
jonmmease committed Oct 30, 2023
1 parent f63f85a commit 7edf7f5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions altair/utils/mimebundle.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from .deprecation import AltairDeprecationWarning
from .html import spec_to_html
from ._importers import import_vl_convert
import struct
import warnings


def spec_to_mimebundle(
Expand Down Expand Up @@ -164,6 +166,12 @@ def _spec_to_mimebundle_with_engine(spec, format, mode, **kwargs):
# but raise exception for the sake of future development
raise ValueError("Unexpected format {fmt!r}".format(fmt=format))
elif normalized_engine == "altairsaver":
warnings.warn(
"The altair_saver export engine is deprecated and will be removed in a future version.\n"
"Please migrate to the vl-convert engine",
AltairDeprecationWarning,
stacklevel=1
)
import altair_saver

return altair_saver.render(spec, format, mode=mode, **kwargs)
Expand Down

0 comments on commit 7edf7f5

Please sign in to comment.