Skip to content

Commit 85af43f

Browse files
authored
Avoid sys.exit in the jupyter init scripts (#1702)
## Changes Init scripts apply to all jupyter notebooks on the system, and for non-databricks projects we should not exit the kernel process. Fixes: #1688 ## Tests Manually and existing e2e tests for dbconnect
1 parent 77667a1 commit 85af43f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/databricks-vscode/resources/python/00-databricks-init.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -600,14 +600,15 @@ def make_matplotlib_inline():
600600
def setup():
601601
import os
602602
import sys
603-
print(sys.modules[__name__])
604603

604+
if not load_env_from_leaf(os.getcwd()):
605+
return
606+
607+
print(sys.modules[__name__])
605608
global _sqldf
606609
# Suppress grpc warnings coming from databricks-connect with newer version of grpcio lib
607610
os.environ["GRPC_VERBOSITY"] = "NONE"
608611

609-
if not load_env_from_leaf(os.getcwd()):
610-
sys.exit(1)
611612
cfg = LocalDatabricksNotebookConfig()
612613

613614
# disable build-in progress bar

0 commit comments

Comments
 (0)