spark-data-quality
Data Quality validation library for Kubernetes Spark pods. Runs Great Expectations and Trino SQL checks against any table, then persists results to the Data Quality Engine API.
Usage — By Table Name
When you only have the table's fully qualified name (catalog.schema.table),
no table_id or test_suite_id is needed. The DQ Engine auto-resolves all
IDs from Discovery Hub.
from spark_dq.quality import SparkDQAgent
agent = SparkDQAgent(
catalog="my_catalog",
schema="my_schema",
table="my_table",
data_quality_url="http://dq-engine:8000/api/v1/spark",
trino_host="trino:443",
trino_user="user",
trino_pwd="pwd",
)
cfg = agent.fetch_table_config()
results = agent.execute_data_quality(df)
fetch_table_config()
Calls GET /config on the DQ Engine with catalog_name, schema_name, and
table_name as query parameters. The DQ Engine then calls Discovery Hub's
GET /ds/table/lookup/ to resolve the internal table_id, schema_id, and
catalog_id. Once the table is identified, the DQ Engine fetches all active
test suites and their expectations for that table and returns them as a config
dict containing:
quality_query— the SQL query to load table datatable_type—TABLEorVIRTUAL_VIEWcatalog_type—managedorunmanagedscan_limit— max rows to scan (if configured)suites— list of test suites, each with its expectationstable_id,schema_id,catalog_id— resolved IDs
The config is cached after the first call, so subsequent calls return instantly.
execute_data_quality(df)
Takes a Spark DataFrame and runs all suites from the config against it.
- Reads the config (calls
fetch_table_config()internally if not already cached) - Backfills
table_idfrom the config if it was not provided at init - For each suite, splits expectations into two concurrent paths:
- Trino fast-path — null checks, uniqueness, range, regex (single SQL query)
- GE slow-path — all other expectation types (parallel Great Expectations validators)
- Saves results to the DQ Engine via
POST /save-results - Returns per-suite statistics (evaluated, passed, failed, success %)
Suites run in parallel (up to 8 concurrently). If Trino credentials are not provided, all expectations run through Great Expectations only.
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spark_data_quality-1.0.8.tar.gz.
File metadata
- Download URL: spark_data_quality-1.0.8.tar.gz
- Upload date:
- Size: 15.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
113dc1b233b51b0f7112629631f7e3a85b14a52bafe4415accc3b889096777af
|
|
| MD5 |
eddf3e562ebd63f881d9ccb7493c93d9
|
|
| BLAKE2b-256 |
02a20ed28d002043397dd108a5951846767d5cdf3d798e92999031a3af02f5db
|
Provenance
The following attestation bundles were made for spark_data_quality-1.0.8.tar.gz:
Publisher:
ci.yml on saal-core/digixt-quality-package
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spark_data_quality-1.0.8.tar.gz -
Subject digest:
113dc1b233b51b0f7112629631f7e3a85b14a52bafe4415accc3b889096777af - Sigstore transparency entry: 2289255706
- Sigstore integration time:
-
Permalink:
saal-core/digixt-quality-package@8075a5a5cf749f64059eb5ef5d2df18432225235 -
Branch / Tag:
refs/tags/v1.0.8 - Owner: https://github.com/saal-core
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@8075a5a5cf749f64059eb5ef5d2df18432225235 -
Trigger Event:
push
-
Statement type:
File details
Details for the file spark_data_quality-1.0.8-py3-none-any.whl.
File metadata
- Download URL: spark_data_quality-1.0.8-py3-none-any.whl
- Upload date:
- Size: 20.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1ffaaf337d172959e132eca97eb4c945438e3e1f31e1d18c141d7fef11ce5fe
|
|
| MD5 |
9150a85cc4a19d254dfecce20d18f4a6
|
|
| BLAKE2b-256 |
36d7e6d054265f550a5c376bc41e999a509f897bcde3f7c046cbcf2c55988aae
|
Provenance
The following attestation bundles were made for spark_data_quality-1.0.8-py3-none-any.whl:
Publisher:
ci.yml on saal-core/digixt-quality-package
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spark_data_quality-1.0.8-py3-none-any.whl -
Subject digest:
f1ffaaf337d172959e132eca97eb4c945438e3e1f31e1d18c141d7fef11ce5fe - Sigstore transparency entry: 2289255740
- Sigstore integration time:
-
Permalink:
saal-core/digixt-quality-package@8075a5a5cf749f64059eb5ef5d2df18432225235 -
Branch / Tag:
refs/tags/v1.0.8 - Owner: https://github.com/saal-core
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@8075a5a5cf749f64059eb5ef5d2df18432225235 -
Trigger Event:
push
-
Statement type: