Skip to content

armgit / burr

Public Imported from GitHub
0

Build applications that make decisions (chatbots, agents, simulations, etc...). Monitor, trace, persist, and execute on your own infrastructure.

make Jupyter the base case; otherwise it would catch all other env

ziltofdc7e009ce07
diff --git a/burr/integrations/notebook.py b/burr/integrations/notebook.py
index 671c3fd4..597d5abe 100644
--- a/burr/integrations/notebook.py
+++ b/burr/integrations/notebook.py
@@ -17,9 +17,6 @@ class NotebookEnvironment(enum.Enum):
def identify_notebook_environment(ipython: InteractiveShellApp) -> NotebookEnvironment:
- if "IPKernelApp" in ipython.config:
- return NotebookEnvironment.JUPYTER
-
if os.environ.get("VSCODE_PID"):
return NotebookEnvironment.VSCODE
@@ -46,6 +43,10 @@ def identify_notebook_environment(ipython: InteractiveShellApp) -> NotebookEnvir
except ModuleNotFoundError:
pass
+ # this is the base case. IPKernelApp should always be available
+ if "IPKernelApp" in ipython.config:
+ return NotebookEnvironment.JUPYTER
+
raise RuntimeError(
f"Unknown notebook environment. Known environments: {list(NotebookEnvironment)}"
)