Skip to content

Instantly share code, notes, and snippets.

View mniehoff's full-sized avatar

Matthias Niehoff mniehoff

View GitHub Profile
@mniehoff
mniehoff / databricks_python_library_job_executor.py
Created November 25, 2021 15:57
Example Script to run code that is in python package. Can be used to run Python Packages as Python job on databricks. Use this script as "python_file" and pass the job_module and the job_args as "parameter" like this: [ "--job-module=package.subpackage.module", "--job-method=run_job" ]
import importlib
import argparse
def get_installed_packages():
import pkg_resources
installed_packages = pkg_resources.working_set
return sorted(["%s==%s" % (i.key, i.version) for i in installed_packages])