Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom constraint option #792

Merged
merged 8 commits into from
Sep 16, 2024

Conversation

roydobbe
Copy link
Contributor

Description

Added an option to create custom constraints. A usecase could be creating TIMESERIES primary keys.

Checklist

  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • I have updated the CHANGELOG.md and added information about my change to the "dbt-databricks next" section.

{% elif type == 'custom' %}
{% set expression = constraint.get("expression", "") %}
{% if not expression %}
{{ exceptions.raise_compiler_error('Invalid check constraint expression') }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'Missing custom constraint expression'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah silly! Adjusted :)

Copy link
Collaborator

@benc-db benc-db left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor change requested. Also add your thank you call out to the changelog :)

@benc-db benc-db merged commit 092296b into databricks:1.9.latest Sep 16, 2024
18 checks passed
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.

2 participants