dbt-labs / dbt-docs

Auto-generated data documentation site for dbt projects
Apache License 2.0
139 stars 74 forks source link

[CT-3533] dbt docs generate doesn't hide package's documentation #487

Closed hvignolo87 closed 8 months ago

hvignolo87 commented 8 months ago

Describe the bug

I'm using the following stack:

This is my dbt_project.yml:

models:
  bind: false
  my_project:
    +full_refresh: false
    +on_schema_change: "append_new_columns"
    ...

  dbt_utils:
    +docs:
      show: false

This is my packages.yml:

packages:
  - package: dbt-labs/dbt_utils
    version: 1.1.1

When I run any of these commands:

poetry run dbt docs generate --project-dir my_project --profiles-dir my_project
poetry run dbt docs generate --select my_project --exclude dbt_utils --project-dir my_project --profiles-dir my_project
cd my_project && poetry run dbt docs generate
cd my_project && poetry run dbt docs generate --select my_project --exclude dbt_utils

Or any other combination, when I render the documentation, the package's docs are shown under Projects.

Steps To Reproduce

Create a dummy project and try:

Expected behavior

The package's documentation is not shown in the rendered HTML.

Screenshots and log output

N/A

Additional context

N/A

dbeatty10 commented 8 months ago

Thanks for reaching out @hvignolo87 !

Following your example, it looks like the documentation website includes the macros directory from dbt_utils:

image

Typically, disabling a particular resource type (like macros) is accomplished like this in dbt_project.yml:

macros:
  dbt_utils:
    +docs:
      show: false

But the macro resource type is the one thing that is not able to be configured in dbt_project.yml right now.

We already have an issue for that in https://github.com/dbt-labs/dbt-core/issues/8061, so I'm going to close this one as a duplicate.

hvignolo87 commented 8 months ago

Hi @dbeatty10! Hope you're doing well.

Thanks for your reply! I didn't find that issue before 😅

dbeatty10 commented 8 months ago

Good to see you again @hvignolo87. No worries... it took me a little while to find that one even though I knew it existed (somewhere).