Skip to main content

prizm-adls-scanner

Python Version License Databricks Platform

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 sqlglot — pyspark 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

Compiled Modules

databricks/comparison_driver.py, databricks/lookup_driver.py, and databricks/exception_runner.py — the comparison/reconciliation, lookup-matching, and exception-detection engines — ship as compiled Cython extensions (.so), not plain Python. Everything else (databricks/__init__.py, _runtime.py, exception_metadata_runner.py, materialize_runner.py, side_snapshot_runner.py, the thin *_runner.py wrappers) stays plain Python.

Consequences:

  • The published wheels are manylinux only, one per Python version (cp39–cp313) — built via cibuildwheel, see [tool.cibuildwheel] in pyproject.toml. They will not install on non-Linux platforms or Python versions outside that range. There is no sdist (an sdist is source-by-definition, which would defeat the point).
  • Building it yourself (make build, or an editable pip install -e .) requires a C compiler and Cython — both pulled in automatically as build-time dependencies, but you need a working cc/gcc on your machine. An editable install does not exercise the compiled build — it just points back at the source directory, so the protected modules stay fully readable in-place during local development. Protection only applies to what actually gets published.

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
    catalog/                        # ADLS_TECHNICAL_CATALOG 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

Release files for prizm-adls-scanner 0.1.7

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

Built distributions (wheels)

Table of built distributions (wheels) for prizm-adls-scanner 0.1.7
File
prizm_adls_scanner-0.1.7-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details
prizm_adls_scanner-0.1.7-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details
prizm_adls_scanner-0.1.7-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.17+ x86-64 Details
prizm_adls_scanner-0.1.7-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details
prizm_adls_scanner-0.1.7-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details

Total release size: 15.9 MB

Release files / prizm_adls_scanner-0.1.7-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL prizm_adls_scanner-0.1.7-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 3.2 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
9c7eb1f2a6e16e11ddde4c08d0ccd506d3f6cce83389cd92d5c0b45f1d610f64
BLAKE2b-256 checksum
How to use checksums
f6e4e0b1421130d157c687285931d644790e641e5cafaba9b629153c7ce0ce14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.

Transparency log

Release files / prizm_adls_scanner-0.1.7-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL prizm_adls_scanner-0.1.7-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 3.2 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
33ec3b133bfa0e4c680b378d064a5a085e07c6ceebbca03c823455442d8cff9b
BLAKE2b-256 checksum
How to use checksums
73ad2bf7751b0010ffdde4aa228a2364480af144708c113c544745275f8d561d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.

Transparency log

Release files / prizm_adls_scanner-0.1.7-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL prizm_adls_scanner-0.1.7-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 3.3 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
41cb0ff3f25d1277099a1d29a841057a0ed9091869e603516bb65adbf73e9318
BLAKE2b-256 checksum
How to use checksums
a5121bcee5e1bf8f4d98606255a475e46a9124c9d48f12f1c25ebbef7c514c97
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.

Transparency log

Release files / prizm_adls_scanner-0.1.7-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL prizm_adls_scanner-0.1.7-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 3.2 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
d45ea3df6cb84773a7f80e897ba68873e405d7a42a1f482529e0175382434650
BLAKE2b-256 checksum
How to use checksums
230566df6e7844f0ab33d54c76be6e06ea06e15dc026e40581d41e0488f0193c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.

Transparency log

Release files / prizm_adls_scanner-0.1.7-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL prizm_adls_scanner-0.1.7-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 3.1 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
0cbfd55e0c62a1e6ddd9eafb136425433ba120668880d3cc9b57f1ed42abe5c5
BLAKE2b-256 checksum
How to use checksums
672d439896f335c086198a6cfb20836ffd55e64a8a494ec7370605e6bf1e9dc6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.7

5 release files

0.2.6

5 release files

0.2.5

5 release files

0.2.4

5 release files

0.2.3

5 release files

0.2.2

5 release files

0.2.1

5 release files

0.1.15

5 release files

0.1.14

5 release files

0.1.13

5 release files

0.1.12

5 release files

0.1.11

5 release files

0.1.10

5 release files

0.1.9

5 release files

0.1.8

5 release files

This release

0.1.7 This release

5 release files

0.1.6

5 release files

0.1.5

5 release files

0.1.4

5 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.0

2 release 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