Skip to content

refactor: collapse v1/v2 constraint rendering onto TypedConstraint - #1645

Draft
saishreeeee wants to merge 2 commits into
1.13.latestfrom
feature/unify-constraint-renderer
Draft

refactor: collapse v1/v2 constraint rendering onto TypedConstraint#1645
saishreeeee wants to merge 2 commits into
1.13.latestfrom
feature/unify-constraint-renderer

Conversation

@saishreeeee

@saishreeeee saishreeeee commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Description

  • Route v1 persist_constraints through the Python TypedConstraint renderer instead of the Jinja constraint macros.
  • Parse legacy meta.constraints in Python so v1 and v2 apply the same contract and Databricks constraint formats.
  • Keep v1 behavior: skip unsupported constraints, generate stable names for unnamed ones, and still apply constraints on Hive Metastore.

Testing

  • Unit tests for parse/render and constraint macros
  • Functional persist_constraints on UC SQL warehouse
  • Functional contract/constraint tests on UC SQL warehouse

@saishreeeee saishreeeee changed the title Collapse v1/v2 constraint rendering onto TypedConstraint refactor: collapse v1/v2 constraint rendering onto TypedConstraint Aug 21, 2026
@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  dbt/adapters/databricks
  constraints.py 135, 237, 316-317, 326-341
  impl.py 1087-1088
  dbt/adapters/databricks/relation_configs
  constraints.py
Project Total  

This report was generated by python-coverage-comment-action

@saishreeeee
saishreeeee force-pushed the feature/unify-constraint-renderer branch from dcc1dfb to 922cb84 Compare August 22, 2026 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant