"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "4b1970bb4cf4d7657ac1fc4e584600121c22e039"
Unverified Commit 49c8c67f authored by David Heryanto's avatar David Heryanto Committed by GitHub
Browse files

Exclude Databricks from notebook env only if the runtime is below 11.0 (#17988)

* Exclude Databricks from notebook env only if the runtime is below 11.0

* Dummy commit to trigger CI

* Empty commit to trigger CI

* Empty commit to trigger CI

* Empty commit to trigger CI

* Empty commit to trigger CI

* Empty commit to trigger CI

* Empty commit to trigger CI

* Empty commit to trigger CI
parent 6890d196
...@@ -506,7 +506,9 @@ def is_in_notebook(): ...@@ -506,7 +506,9 @@ 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: if "DATABRICKS_RUNTIME_VERSION" in os.environ and os.environ["DATABRICKS_RUNTIME_VERSION"] < "11.0":
# Databricks Runtime 11.0 and above uses IPython kernel by default so it should be compatible with Jupyter notebook
# https://docs.microsoft.com/en-us/azure/databricks/notebooks/ipython-kernel
raise ImportError("databricks") raise ImportError("databricks")
return importlib.util.find_spec("IPython") is not None return importlib.util.find_spec("IPython") is not None
......
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