Skip to main content

prizm-adls-scanner

Python Version License Databricks

Python package that runs Prizm Exception, Lookup, Comparison, Materialize, and Behavioral jobs inside a Databricks Spark cluster.

Location: prizm-cli/prizm-adls-scanner (under Server root)

What it is:

  • ✅ A library imported inside a Databricks notebook or job task — it does not read files or connect to storage itself; it operates on an already-active spark session
  • ✅ Runtime deps are just requests and sqlglotpyspark is intentionally not a dependency (Databricks already provides Spark on the cluster; installing PyPI pyspark there would conflict with it)
  • pyspark is imported lazily inside each runner module, so pip install/import prizm_adls_scanner succeeds even outside Databricks (useful for local dev of non-Spark code paths)

What it is not:

  • ❌ Not a CLI — no console script, no argparse/click entry point
  • ❌ Not a file scanner/connector — it has no ADLS/S3 I/O logic; it assumes data is already loaded into Spark by the notebook/job that calls it
  • ❌ Not the metrics-collection scanner — that's a different, unrelated concern

Install

Databricks notebook

%pip install prizm-adls-scanner
dbutils.library.restartPython()

Cluster / job library (recommended for production)

Attach the published wheel as a cluster or job library so tasks don't need %pip on every run.

From a built wheel

make build
pip install dist/prizm_adls_scanner-*.whl

Note: pyspark is not a package dependency. Databricks already provides Spark. Do not install PyPI pyspark on the cluster.


Databricks notebook usage

Use a thin notebook; all job logic lives in the package:

%pip install prizm-adls-scanner
dbutils.library.restartPython()

import json
from prizm_adls_scanner.databricks import run_metric_notebook_job

WIDGET_NAMES = [
    "job_config",
    "storage_account",
    "access_key",
    "client_id",
    "client_secret",
    "tenant_id",
    "uc_catalog",
    "uc_schema",
    "exception_url",
    "run_id",
    "file_batch",
    "job_type",
    "connector",
    "container",
    "asset_id",
    "source_id",
]

for name in WIDGET_NAMES:
    try:
        dbutils.widgets.text(name, "")
    except Exception:
        pass

widgets = {}
for name in WIDGET_NAMES:
    try:
        widgets[name] = dbutils.widgets.get(name)
    except Exception:
        widgets[name] = ""

result = run_metric_notebook_job(
    spark=spark,
    dbutils=dbutils,
    widgets=widgets,
)
dbutils.notebook.exit(json.dumps(result, default=str))

A reference notebook source also ships in the repo as prizm_adls_scanner/databricks/notebook/prizm_iceberg_notebook.py.


API

from prizm_adls_scanner.databricks import (
    run_metric_notebook_job,   # routes by widgets["job_type"] to the right runner
    run_exception_job,
    run_exception_notebook_job,
    run_lookup_job,
    run_comparison_job,
    run_materialize_job,
)
# also available directly off the top-level package (lazy import):
from prizm_adls_scanner import run_exception_job
Argument Description
spark Active Databricks SparkSession
dbutils Optional dbutils
widgets Dict of notebook/job widget values

Every runner returns a dict with at least status (success / failed). On failure, includes error / errors.

run_metric_notebook_job routes by widgets["job_type"]:

  • EXCEPTION / EXCEPTION_METADATA → exception runner
  • LOOKUP → lookup runner
  • COMPARISON → comparison runner
  • BEHAVIORAL → side-snapshot runner
  • MATERIALIZE_ICEBERG / DELETE (or is_delete_action, or no job_type) → materialize runner (ADLS → Unity Catalog Delta UniForm)

Development

Development Setup

pip install -e ".[dev,test]"

Running Tests

Most of the test suite runs without pyspark installed (package-surface/import checks); a couple of tests are skipped automatically if pyspark isn't present.

make test

Building Wheels

make build

For offline/local environments where build dependencies are already installed:

make build-local

Clean Build Artifacts

make clean

Package Layout

prizm_adls_scanner/
  __init__.py                     # lazy top-level re-exports
  databricks/
    __init__.py                   # run_exception_job, run_lookup_job, run_comparison_job,
                                   # run_materialize_job, run_metric_notebook_job
    _runtime.py                   # shared runtime helpers
    exception_runner.py           # EXCEPTION / EXCEPTION_METADATA runtime
    exception_notebook.py         # reference notebook source
    exception_metadata_runner.py  # exception metadata runtime
    lookup_driver.py / lookup_runner.py         # LOOKUP runtime
    comparison_driver.py / comparison_runner.py # COMPARISON runtime
    materialize_runner.py         # MATERIALIZE_ICEBERG / DELETE runtime
    side_snapshot_runner.py       # BEHAVIORAL runtime
    notebook/prizm_iceberg_notebook.py  # reference Iceberg notebook source

License

MIT License

Support

For issues and questions, please visit: https://github.com/DQLabs-Inc/prizm-cli/issues

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prizm_adls_scanner-0.1.3.tar.gz (60.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

prizm_adls_scanner-0.1.3-py3-none-any.whl (65.0 kB view details)

Uploaded Python 3

File details

Details for the file prizm_adls_scanner-0.1.3.tar.gz.

File metadata

  • Download URL: prizm_adls_scanner-0.1.3.tar.gz
  • Upload date:
  • Size: 60.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for prizm_adls_scanner-0.1.3.tar.gz
Algorithm Hash digest
SHA256 96e29f844657a4b71f8e3de7a33969710784ba7493543d11996f3c0c286ba9af
MD5 15847a501fb5b804ff762a6770a5cb90
BLAKE2b-256 f5fa74adda1fd7b571fed32d84b91f8dd30ef4390bc8c65ae614661146f25e9c

See more details on using hashes here.

Provenance

The following attestation bundles were made for prizm_adls_scanner-0.1.3.tar.gz:

Publisher: publish-pypi.yml on DQLabs-Inc/prizm-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file prizm_adls_scanner-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for prizm_adls_scanner-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0b2101eee656cfd3fe270b642b5385437af741e4af4f62ef0d3ce079ca6f43bc
MD5 a7dda7a0cf716818dbd67e15743c7ce8
BLAKE2b-256 88f23e28dc9e31dabe660334b29806a946b0929c13eed5e159fbe137a3431030

See more details on using hashes here.

Provenance

The following attestation bundles were made for prizm_adls_scanner-0.1.3-py3-none-any.whl:

Publisher: publish-pypi.yml on DQLabs-Inc/prizm-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 files

0.1.2

2 files

0.1.0

2 files

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