diff --git a/src/resources/jupyter/lang/python/setup.py b/src/resources/jupyter/lang/python/setup.py index 8f948bcaae..17cde9c6c3 100644 --- a/src/resources/jupyter/lang/python/setup.py +++ b/src/resources/jupyter/lang/python/setup.py @@ -49,16 +49,17 @@ options.paging = False except Exception: pass - + try: import altair as alt # By default, dashboards will have container sized # vega visualizations which allows them to flow reasonably - def quarto_dashboard_theme(*args, **kwargs): - return dict(width = 'container', height= 'container') - alt.themes.register('quarto-dashboard-theme', quarto_dashboard_theme) - alt.themes.enable('quarto-dashboard-theme') + if 'quarto-dashboard-theme' not in alt.themes.names(): + def quarto_dashboard_theme(*args, **kwargs): + return dict(width = 'container', height= 'container') + alt.themes.register('quarto-dashboard-theme', quarto_dashboard_theme) + alt.themes.enable('quarto-dashboard-theme') except Exception: pass