Exclude Databricks from notebook env (#17496)
This commit is contained in:
@@ -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):
|
||||||
|
|||||||
Reference in New Issue
Block a user