619 feature generate dqx rules from odcs data contracts#932
Merged
mwojtyczka merged 50 commits intoNov 21, 2025
Conversation
Adding support for automated rule generation from ODCS data contracts. ODCS (Open Data Contract Standard) v3.0.x data contracts are supported. Rules can be generated implicitly from schema properties (required fields, value ranges, patterns, formats) or explicitly from quality definitions and text-based expectations! Main entry point is DQGenerator.generate_rules_from_contract() which supports: - Implicit rules from schema constraints (required, unique, min/max, pattern, etc) - Explicit rules in DQX native format - Text-based expectations processed via LLM with full schema context - Custom criticality mapping by quality dimension - Complete contract metadata tracking in generated rules Includes unit tests, integration tests, demo notebook, and sample contracts for testing and documentation.
…ity in explicit custom rules, so adding an external mapping parameter was redundant and complex.
…validation - Enforce full JSON Schema validation against bundled ODCS schemas (v3.0.0, v3.0.1, v3.0.2) - Implement proper ODCS quality check format with required fields: * type: "text" or "custom" (required) * engine: "dqx" for custom checks (required) * implementation: contains DQX rule details (required) - Use ODCS-compliant logical types: * 'date' for both dates and timestamps (distinguished by format) * 'number' instead of 'numeric' - Detect timestamps vs dates based on format string (HH, mm, ss) - Extract DQX checks from 'implementation' field per ODCS custom format spec
1 task
…om validation logic. improved the demo example.
…ple of the ODCS contract. Improved the demo notebook.
mwojtyczka
requested changes
Nov 19, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 9 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Marcin Wojtyczka <marcin.wojtyczka@databricks.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 16 out of 16 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mwojtyczka
reviewed
Nov 20, 2025
mwojtyczka
approved these changes
Nov 20, 2025
mwojtyczka
reviewed
Nov 21, 2025
mwojtyczka
reviewed
Nov 21, 2025
…, TypeError instead of a generic exception
Contributor
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 17 out of 19 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Added support for generating DQ rules from ODCS (Open Data Contract Standard) v3.0.x data contracts. This enables customers implementing data contracts to automatically derive quality checks from their standardised contract definitions.
Key features:
required,unique,pattern,minValue/maxValue,validValues,format)New components:
src/databricks/labs/dqx/datacontract/- New module for contract parsing and rule generationsrc/databricks/labs/dqx/datacontract/schemas/- Bundled ODCS JSON schemas for validationdemos/dqx_demo_odcs.py- Interactive demo notebookjsonschemadependency for contract validationUsage:
Linked issues
Resolves #...
Tests