Skip to main content

fish-databricks-jobs

fish-databricks-jobs is cli and python sdk to manage Jobs for Databricks. e.g assign permissions to multiple jobs. User can filter jobs by job name or tags.

The functionality of current databricks-cli(v0.17.4) is limited on the jobs api. e.g it can not assign job permission.

With fish-databricks-jobs, you can assign job permission, e.g:

to assign group mygroup with permission can_manage to job by filter 843966944901662(job_id)

$ fish-databricks-jobs permission-assign mygroup --type group --level can_manage --filter 843966944901662

Installation

Python Version >= 3.7

$ pip install --upgrade fish-databricks-jobs
$ fish-databricks-jobs --version
Version: 0.6.8

Usage

permission-assign

$ fish-databricks-jobs permission-assign -h

 Usage: fish-databricks-jobs permission-assign [OPTIONS] NAME

 Assign permission to user

╭─ Arguments ─────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ *    name      TEXT  User name, group name or serive principal id. Who will receive the permisssion. [default: None]    │
│                      [required]                                                                                         │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│    --type     -t      [user|principal|group]                Permission receiver type. [default: user]                   │
│ *  --level    -l      [can_view|can_manage|can_manage_run]  Permission level. [default: None] [required]                │
│    --filter   -f      TEXT                                  filter jobs, case insensitively. [default: None]            │
│    --profile  -p      TEXT                                  profile name in ~/.databrickscfg [default: DEFAULT]         │
│    --force                                                  Attempt to assign permission without prompting for          │
│                                                             confirmation. **Use this flag with caution**                │
│    --help     -h                                            Show this message and exit.                                 │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

use as sdk to list jobs

in databricks' notebook

%pip install fish-databricks-jobs
from fish_databricks_jobs.services.jobs import JobsService, Job
host = f'https://{spark.conf.get("spark.databricks.workspaceUrl")}'
token = 'exampletokenc0e27d8b91fd8c0144f0a23'

job_list = JobsService(host, token).list()
df = spark.createDataFrame(job_list)

display(df)

Config authentication

fish-databricks-jobs uses same config file as databricks-cli. e.g.~/.databrickscfg for macOS. Similar for Windows.

[DEFAULT]
host = https://example.cloud.databricks.com
token = exampletokenc0e27d8b91fd8c0144f0a23

Developer

Setup

  1. Checkout code
  2. install poetry, e.g: in macOS or Windows-cmder
curl -sSL https://install.python-poetry.org | python -
  1. config poetry
poetry config virtualenvs.in-project true
  1. install dependencies python libraries in the venv
poetry install
poetry shell 
  1. in pycharm, Add New Interpreter -> Poetry Environment ...
  2. Verifiy
(fish-databricks-jobs-py3.8) (base) username@macbook:~/projects/fish-databricks-jobs [main] 
$ python ./fish_databricks_jobs/cli.py --version
Version: 0.7.6

Metadata

Release files for fish-databricks-jobs 0.7.18

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fish-databricks-jobs 0.7.18
File Size Uploaded Provenance Actions
fish_databricks_jobs-0.7.18.tar.gz 5.1 kB Without provenance Details for fish_databricks_jobs-0.7.18.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fish-databricks-jobs 0.7.18
File Interpreter ABI Platform Actions
fish_databricks_jobs-0.7.18-py3-none-any.whl Python 3 none any Details for fish_databricks_jobs-0.7.18-py3-none-any.whl

Total release size: 12.2 kB

Release files / fish_databricks_jobs-0.7.18.tar.gz

Download URL fish_databricks_jobs-0.7.18.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f436b736da456392f246ac124206c0b7e88db748504a72d749a89f9519c94a28
BLAKE2b-256 checksum
How to use checksums
e7fe245f934b7eb8f970bee62f67a1561868c6f644ae81bccbe068c901f5e456
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.5 Darwin/22.5.0

Release files / fish_databricks_jobs-0.7.18-py3-none-any.whl

Download URL fish_databricks_jobs-0.7.18-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
48c9c5d85ece2471d0e5f6ea70dc6bc3f0cb5f13540ff1e5a92d808660849319
BLAKE2b-256 checksum
How to use checksums
47fbc0a8462664591cb41f83f4ea21af4d2642fc0ed550ba0ec75c9bc2cbc14d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.5 Darwin/22.5.0

Security for fish-databricks-jobs 0.7.18

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page