From 745d4b366d00b8df6b2f45d8c495106dc8f88de3 Mon Sep 17 00:00:00 2001 From: longxiaofei Date: Wed, 31 Jul 2024 10:20:41 +0800 Subject: [PATCH] fix: disable kernel computation in JupyterConvert --- pygwalker/api/jupyter.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pygwalker/api/jupyter.py b/pygwalker/api/jupyter.py index 41b6cea0..01b41adf 100644 --- a/pygwalker/api/jupyter.py +++ b/pygwalker/api/jupyter.py @@ -57,6 +57,15 @@ def walk( inspect.stack()[1].frame ) + if check_kaggle(): + auto_set_kanaries_api_key_on_kaggle() + + if get_kaggle_run_type() == "batch": + adjust_kaggle_default_font_size() + env = "JupyterPreview" + elif check_convert(): + env = "JupyterConvert" + walker = PygWalker( gid=gid, dataset=dataset, @@ -67,7 +76,7 @@ def walk( appearance=appearance, show_cloud_tool=show_cloud_tool, use_preview=True, - kernel_computation=isinstance(dataset, (Connector, str)) or fallback_value(kernel_computation, use_kernel_calc), + kernel_computation=env != "JupyterConvert" and (isinstance(dataset, (Connector, str)) or fallback_value(kernel_computation, use_kernel_calc)), use_save_tool=True, gw_mode="explore", is_export_dataframe=True, @@ -77,15 +86,6 @@ def walk( **kwargs ) - if check_kaggle(): - auto_set_kanaries_api_key_on_kaggle() - - if get_kaggle_run_type() == "batch": - adjust_kaggle_default_font_size() - env = "JupyterPreview" - elif check_convert(): - env = "JupyterConvert" - env_display_map = { "JupyterWidget": walker.display_on_jupyter_use_widgets, "Jupyter": walker.display_on_jupyter,