Skip to main content

Bridge: Databricks Unity Catalog → ODGS Runtime Enforcement Schemas

Project description

ODGS Databricks Bridge

License ODGS

Transform your Databricks Unity Catalog into active ODGS runtime enforcement schemas.

Unity Catalog describes your data. ODGS enforces it.


What It Does

The ODGS Databricks Bridge connects to your Databricks workspace and transforms Unity Catalog table/column metadata into ODGS-compliant JSON schemas that the Universal Interceptor can enforce at runtime.

Unity Catalog REST API            ODGS
┌──────────────┐     Bridge      ┌──────────────┐
│ Catalogs     │ ──────────────→ │ JSON Schema  │
│ Schemas      │   reads tables, │ + Interceptor│
│ Tables       │   outputs ODGS  │ = Enforcement│
│ Columns      │                 └──────────────┘
└──────────────┘

What Gets Generated

Input Output Type ODGS Artifact
Table metadata metrics Metric definitions with full column schemas
Non-nullable columns rules NOT_NULL enforcement rules
Column data types rules TYPE_CHECK validation rules

Install

pip install odgs-databricks-bridge

Quick Start

Python API

from odgs_databricks import DatabricksBridge

bridge = DatabricksBridge(
    workspace_url="https://adb-1234567890.azuredatabricks.net",
    token="dapi...",
    organization="acme_corp",
)

# Sync all tables from a catalog → ODGS metric definitions
bridge.sync(
    catalog="production",
    output_dir="./schemas/custom/",
    output_type="metrics",
)

# Sync column constraints → ODGS enforcement rules
bridge.sync(
    catalog="production",
    schema_filter="finance",
    output_dir="./schemas/custom/",
    output_type="rules",
    severity="HARD_STOP",
)

CLI

# Using environment variables (standard Databricks SDK convention)
export DATABRICKS_HOST=https://adb-1234567890.azuredatabricks.net
export DATABRICKS_TOKEN=dapi...

odgs-databricks sync \
    --org acme_corp \
    --catalog production \
    --schema finance \
    --type rules \
    --severity HARD_STOP \
    --output ./schemas/custom/

Output

{
  "$schema": "https://metricprovenance.com/schemas/odgs/v4",
  "metadata": {
    "source": "databricks",
    "organization": "acme_corp",
    "tables_processed": 12,
    "items_generated": 47
  },
  "items": [
    {
      "rule_urn": "urn:odgs:custom:acme_corp:rule:revenue_amount_not_null",
      "name": "revenue.amount NOT NULL",
      "severity": "HARD_STOP",
      "constraint_type": "NOT_NULL",
      "target_table": "production.finance.revenue",
      "content_hash": "a1b2c3..."
    }
  ]
}

🆕 v4.1.0: Bi-Directional Write-Backs

The ODGS Databricks bridge now supports Bi-Directional Sync (Plane 4). It can parse your secure sovereign_audit.log offline and push compliance results back directly into your Unity Catalog table comments.

This creates a seamless feedback loop for Data Stewards without compromising the Air-Gapped nature of the core ODGS protocol.

odgs-databricks write-back \
    --log-path ./sovereign_audit.log \
    --url https://adb-1234567890.azuredatabricks.net \
    --token dapi...

Authentication

Method CLI Flag Environment Variable
Personal Access Token --token DATABRICKS_TOKEN
Workspace URL --url DATABRICKS_HOST

Requirements

  • Python ≥ 3.9
  • odgs ≥ 4.0.0 (core protocol)
  • Databricks workspace with Unity Catalog enabled

Related


License

Apache 2.0 — Metric Provenance | The Hague, NL 🇳🇱

Project details


Download files

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

Source Distribution

odgs_databricks_bridge-0.2.0.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

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

odgs_databricks_bridge-0.2.0-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file odgs_databricks_bridge-0.2.0.tar.gz.

File metadata

  • Download URL: odgs_databricks_bridge-0.2.0.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for odgs_databricks_bridge-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ea8bde1c9cdd76f6c6c0862c2a1ef31a0eb4853316e641feea8fe5e772a01155
MD5 fc453bd608f365d42ac6b9cff14eed07
BLAKE2b-256 64acbde090b08172d4947786d388bdb74db3e8415212bf1bf18d8a632342c9d9

See more details on using hashes here.

File details

Details for the file odgs_databricks_bridge-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for odgs_databricks_bridge-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 101c9f2ffb5c96104db8d781e62e9631fdbfb9160a1fd475948f879193480d0b
MD5 eea1b5db69d0b126fa32eddcaf6a1103
BLAKE2b-256 b20812b04865f96f82586a7fe2f90ad4155a0fe72a113c7ddef0afdecb1dabbe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page