data-mie / dbt-profiler

Macros for generating dbt model data profiles
Apache License 2.0
81 stars 33 forks source link

Search for `docs` blocks within the `"docs"` directory (#71) #82

Closed dbeatty10 closed 1 year ago

dbeatty10 commented 1 year ago

resolves #71

Description & motivation

The dbt_profiler dbt package generates docs blocks that are written into the docs/dbt_profiler directory.

But "docs" isn't included in the default for docs-paths, so the "docs" folder needs to be explicitly added to dbt_project.yml either via model-paths or docs-paths.

Suggested approach to enable docs/dbt_profiler folder

There are two main options:

  1. Override model-paths
  2. Override docs-paths

Overriding model-paths to be ["models", "docs"] (or extending it to add "docs") will "always work".

This is because by default, dbt will search in all resource paths for docs blocks (i.e. the combined list of model-paths, seed-paths, analysis-paths, macro-paths and snapshot-paths).

However, overriding docs-paths instead could have unintended side-effects if the dbt project has pre-existing docs blocks within their model-paths, seed-paths, analysis-paths, macro-paths and/or snapshot-paths.

So I'd recommend going the model-paths route rather than the docs-paths route.

Checklist

stumelius commented 1 year ago

Everything looks good here! Thanks for your contribution @dbeatty10 ❤️