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

[Bug] model-level constraints not set in dbt docs #11198

Open
2 tasks done
thmswt opened this issue Jan 8, 2025 · 0 comments
Open
2 tasks done

[Bug] model-level constraints not set in dbt docs #11198

thmswt opened this issue Jan 8, 2025 · 0 comments
Labels
bug Something isn't working triage

Comments

@thmswt
Copy link

thmswt commented Jan 8, 2025

Is this a new bug in dbt-core?

  • I believe this is a new bug in dbt-core
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

When defining constraints on model-level in the schema.yml file and then executing dbt docs generate && dbt docs serve, the columns constraint is not set.

Expected Behavior

The CONSTRAINT value should be set to PK for this example.
More generally, the expected behavior should be that there is no difference between setting the constraints at the column level or at the model level for the presentation of the value within the dbt documentation.

Steps To Reproduce

Initiate and configure a dbt project with:
dbt init

Add the model-level constraint to the my_first_dbt_model model:

constraints:
      - type: primary_key
        columns: [id]

Run dbt docs generate && dbt docs serve

The CONSTRAINT value is empty for the column id:
image

Relevant log output

No response

Environment

- OS: macOS Sequoia 15.2
- Python: 3.11.11
- dbt: 
Core:
  - installed: 1.9.1
  - latest:    1.9.1 - Up to date!

Plugins:
  - bigquery: 1.9.0 - Up to date!

Which database adapter are you using with dbt?

bigquery

Additional Context

No response

@thmswt thmswt added bug Something isn't working triage labels Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

1 participant