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

clarify macro properties aren't supported in dbt_project.yml #3989

Merged
merged 45 commits into from
Dec 18, 2023

Conversation

mirnawong1
Copy link
Contributor

@mirnawong1 mirnawong1 commented Aug 30, 2023

After convo with jerco and per slack convo, clarify in the docs that macro properties aren't support in dbt_project.yml file.

adding a note in the following pages:

note - not sure how semantic models/metrics are added here

@mirnawong1 mirnawong1 requested a review from a team as a code owner August 30, 2023 12:13
@netlify
Copy link

netlify bot commented Aug 30, 2023

Deploy Preview for docs-getdbt-com ready!

Name Link
🔨 Latest commit f4ccb57
🔍 Latest deploy log https://app.netlify.com/sites/docs-getdbt-com/deploys/650321268c9f880008ebd6e5
😎 Deploy Preview https://deploy-preview-3989--docs-getdbt-com.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions github-actions bot added content Improvements or additions to content size: medium This change will take up to a week to address Docs team Authored by the Docs team @dbt Labs and removed content Improvements or additions to content labels Aug 30, 2023
@github-actions github-actions bot added the content Improvements or additions to content label Aug 31, 2023
@mirnawong1
Copy link
Contributor Author

part of me wonders if i need a project.yml example seeing as the sentence says it supports all yaml files. 🤔

Copy link
Collaborator

@jtcohen6 jtcohen6 left a comment

Choose a reason for hiding this comment

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

Thank you for following up here @mirnawong1!

There's a distinction between attributes we call "configs" and attributes we call "properties," in that "configs" can be set for many resources at once in dbt_project.yml, and "properties" can only be set for one resource at a time. The fact is that macros and analyses only have properties, and that's why they cannot be configured from dbt_project.yml.

https://docs.getdbt.com/reference/configs-and-properties

I am very supportive of the idea of calling this out explicitly in the various resource pages! I will also just say, this distinction is historical & a bit arbitrary. We have been thinking on & off about how we might change it in the future:

dbt uses YAML in a few different places. If you're new to YAML, it would be worth taking the time to learn how arrays, dictionaries and strings are represented.
:::

The following is a list of all available configurations in the `dbt_project.yml` file. Something to note, [Macro properties](/reference/macro-properties) aren't supported in the `dbt_project.yml` file:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Recommend updating this note to mention that these configurations aren't supported in dbt_project.yml:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks so much @jtcohen6 , this is so clear to me now so i really appreciate you breaking it down 🙏

this issue #3997 makes it seems that semantic models are configs, not properties -- is that right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh wait, sorry! i see the issue is related to groups only!

@mirnawong1 mirnawong1 requested a review from dbeatty10 August 31, 2023 16:33
@mirnawong1
Copy link
Contributor Author

mirnawong1 commented Aug 31, 2023

hey @dbeatty10 , can i request a tech review for this pr? since creating the pr, I've made the following changes per jerco's feedback:

  • created a partial to communicate that certain resource properties can't be set in the dbt_project.yml file. this partial is set for macro, analysis, exposure, and source properties per this doc.
  • added explicit clarification in the docs config doc about which resources support dbt_project.yml and yaml settings
  • added an explicit list of properties that aren't supported in the dbt_project.yml page

Comment on lines 51 to 53
You can use the docs property in YAML files, including the `dbt_project.yml`:


Copy link
Contributor

Choose a reason for hiding this comment

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

What if we remove all the changes related to website/docs/reference/resource-configs/docs.md out of this PR and put them into a separate one instead?

We could provide code examples for dbt_project.yml similar to enabled

Here's some code that should work:

name: "my_project"
version: "1.0.0"
config-version: 2
profile: "sandcastle"


models:
  my_project:
    +docs:
      show: false

seeds:
  my_project:
    +docs:
      show: false

snapshots:
  my_project:
    +docs:
      show: false

So the generic code examples would look like this:

models:
  [<resource-path>](/reference/resource-configs/resource-path):
    +docs:
      show: true | false

seeds:
  [<resource-path>](/reference/resource-configs/resource-path):
    +docs:
      show: true | false

snapshots:
  [<resource-path>](/reference/resource-configs/resource-path):
    +docs:
      show: true | false

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hey @dbeatty10 , i moved it out of this pr and added it here: #4529

@mirnawong1
Copy link
Contributor Author

will address monday

@github-actions github-actions bot added size: medium This change will take up to a week to address and removed size: small This change will take 1 to 2 days to address labels Nov 20, 2023
@github-actions github-actions bot added size: small This change will take 1 to 2 days to address and removed size: medium This change will take up to a week to address labels Nov 22, 2023
Remove duplicated content
Copy link
Contributor

@dbeatty10 dbeatty10 left a comment

Choose a reason for hiding this comment

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

Thanks for making these clarifications @mirnawong1 ! 🧠

These previews look good:

This combined with associated work split out in the following PRs is useful to explain the nuances:

@mirnawong1
Copy link
Contributor Author

woohooo! thank you Doug!

@mirnawong1 mirnawong1 dismissed jtcohen6’s stale review December 18, 2023 11:51

approved by Doug

@mirnawong1 mirnawong1 merged commit cb5c283 into current Dec 18, 2023
6 checks passed
@mirnawong1 mirnawong1 deleted the mwong-macro-yml branch December 18, 2023 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content Improvements or additions to content Docs team Authored by the Docs team @dbt Labs size: small This change will take 1 to 2 days to address
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants