Last active
November 9, 2020 10:31
-
-
Save ivangeorgiev/e2382f520a6c30d374d39bf105bc8275 to your computer and use it in GitHub Desktop.
Detect if Python code is running in Datrabricks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def is_databricks(): | |
'''Detect if Python code is running in Databricks''' | |
import os | |
return 'DATABRICKS_RUNTIME_VERSION' in os.environ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment