Skip to content

Instantly share code, notes, and snippets.

@ivangeorgiev
Last active November 9, 2020 10:31
Show Gist options
  • Save ivangeorgiev/e2382f520a6c30d374d39bf105bc8275 to your computer and use it in GitHub Desktop.
Save ivangeorgiev/e2382f520a6c30d374d39bf105bc8275 to your computer and use it in GitHub Desktop.
Detect if Python code is running in Datrabricks
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