Unverified Commit 6813439f authored by Sylvain Gugger's avatar Sylvain Gugger Committed by GitHub
Browse files

Exclude Databricks from notebook env (#17496)

parent 3042ea4f
...@@ -460,6 +460,8 @@ def is_in_notebook(): ...@@ -460,6 +460,8 @@ def is_in_notebook():
raise ImportError("console") raise ImportError("console")
if "VSCODE_PID" in os.environ: if "VSCODE_PID" in os.environ:
raise ImportError("vscode") raise ImportError("vscode")
if "DATABRICKS_RUNTIME_VERSION" in os.environ:
raise ImportError("databricks")
return importlib.util.find_spec("IPython") is not None return importlib.util.find_spec("IPython") is not None
except (AttributeError, ImportError, KeyError): except (AttributeError, ImportError, KeyError):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment