From 7edf7f51fa469ab5d9dc60fd3ff89413c8394111 Mon Sep 17 00:00:00 2001 From: Jon Mease Date: Mon, 30 Oct 2023 07:49:20 -0400 Subject: [PATCH] Add altair_saver deprecation warning --- altair/utils/mimebundle.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/altair/utils/mimebundle.py b/altair/utils/mimebundle.py index f35ecee7e..1aa14cb3c 100644 --- a/altair/utils/mimebundle.py +++ b/altair/utils/mimebundle.py @@ -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( @@ -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)