generate_dag_from_contract
Generate an Airflow DAG from an ODCS data contract to validate live table schema and data-quality rules, using SQL checks against CDW.
Instructions
Generate Airflow DAG Python from an ODCS data contract (no WAP).
Validates live table schema (required columns, PK uniqueness) and data quality rules using Airflow SQLCheckOperator against the CDW connection (default: CDW). Default schedule is once daily (0 3 * * *) unless overridden.
Args: contract_json: ODCS-compatible contract JSON (schema_objects + quality rules). schedule: Cron schedule (default 0 3 * * * — daily at 03:00 UTC). cdw_connection_id: Airflow connection id for Hive/Impala in CDW (default CDW). audit_table: Optional qualified audit table name for check results.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| schedule | No | ||
| audit_table | No | ||
| contract_json | Yes | ||
| cdw_connection_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |