Skip to content

feat: Add semantic-models as valid top-level key in dbt_project.yml#219

Merged
lucidviews merged 1 commit intomainfrom
feature/add-semantic-models-to-dbt-project
Dec 3, 2025
Merged

feat: Add semantic-models as valid top-level key in dbt_project.yml#219
lucidviews merged 1 commit intomainfrom
feature/add-semantic-models-to-dbt-project

Conversation

@lucidviews
Copy link
Contributor

Summary

This PR adds semantic-models as a valid top-level key in dbt_project.yml schemas, allowing users to configure semantic model settings at the project level.

Changes

Schema Files Updated

  • schemas/latest/dbt_project-latest.json
  • schemas/1.7/dbt_project-1.7.json
  • schemas/1.6/dbt_project-1.6.json
  • schemas/dbt_project.json

What was added

  1. New top-level property: semantic-models referencing semantic_model_configs

  2. New definition: semantic_model_configs with the following properties (per dbt documentation):

    • +enabled / enabled - Boolean or Jinja string
    • +group / group - String
    • +meta / meta - Object
  3. Additional fix: Added missing group definition to the generic schemas/dbt_project.json

Test Files Updated

Added valid semantic-models configuration examples to:

  • tests/latest/valid/dbt_project.yml
  • tests/1.7/valid/dbt_project.yml
  • tests/1.6/valid/dbt_project.yml

Example Usage

semantic-models:
  my_project:
    +enabled: true
    +group: analytics
    +meta:
      team: data-platform

Notes

  • Semantic models were introduced in dbt 1.6, so schemas for 1.5 are intentionally unchanged
  • The 1.5 schemas do not include this feature as it was not available in that version

@lucidviews lucidviews requested a review from a team as a code owner November 26, 2025 09:08
@lucidviews lucidviews linked an issue Nov 26, 2025 that may be closed by this pull request
- Add semantic-models property to dbt_project schema (latest, 1.7, 1.6, generic)
- Add semantic_model_configs definition with enabled, group, and meta properties
  (per dbt docs: https://docs.getdbt.com/docs/build/semantic-models)
- Add group definition to generic dbt_project.json schema
- Update valid test files with semantic-models example configuration
- Ensure semantic_model_configs is alphabetically sorted in $defs section

Semantic models were introduced in dbt 1.6, so schemas for 1.5 are unchanged.
@lucidviews lucidviews force-pushed the feature/add-semantic-models-to-dbt-project branch from 4fe009c to c2eee59 Compare November 26, 2025 09:16
Copy link
Contributor

@b-per b-per left a comment

Choose a reason for hiding this comment

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

TBH, I don't know if we need to modify all the older versions as well (I think that more recent PRs were just on the latest one) but the change overall looks fine

@lucidviews
Copy link
Contributor Author

Ok, will only change latest next time. Thanks @b-per!

@lucidviews lucidviews merged commit ffc77bd into main Dec 3, 2025
28 checks passed
@lucidviews lucidviews deleted the feature/add-semantic-models-to-dbt-project branch December 3, 2025 16:13
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.

Add 'semantic-models' as valid top-level key in dbt_project.yml

2 participants