dbt-labs/dbt-docs

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

Closed this issue ยท 3 comments

Describe the bug

I'm using the following stack:

  • poetry 1.6.1
  • dbt-core 1.5.6
  • dbt-redshift 1.5.7
  • dbt_utils 1.1.1

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:

  • Run dbt init
  • Complete your credentials in profiles.yml
  • Add dbt_utils 1.1.1 to packages.yml
packages:
  - package: dbt-labs/dbt_utils
    version: 1.1.1
  • Run dbt deps
  • Exclude the docs in dbt_project.yml by adding:
models:
  ...

  dbt_utils:
    +docs:
      show: false
  • Run any of the above commands, like dbt docs generate
  • Run dbt docs serve --browser --port 8888

Expected behavior

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

Screenshots and log output

N/A

Additional context

N/A

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 dbt-labs/dbt-core#8061, so I'm going to close this one as a duplicate.

Hi @dbeatty10! Hope you're doing well.

Thanks for your reply! I didn't find that issue before ๐Ÿ˜…

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).