Simplify dbt documentation with docs blocks

Опубликовано: 04 Ноябрь 2024
на канале: Kahan Data Solutions
15,868
317

Get my Modern Data Essentials training (for free) & start building more reliable data architectures
https://www.ModernDataCommunity.com

-----

Sometimes your documentation becomes a bit complex to the point where it would be better to write it outside of your YML file. Or perhaps you find you are re-writing the same definition multiple times. In these scenarios (among others), using a docs block can be helpful. In this video I will walk through how to add them to your project.

To declare a docs block, use the jinja docs tag. Docs blocks must be uniquely named, and can contain arbitrary markdown. In practice, a docs block might look like this:

Docs blocks should be placed in files with a .md file extension. By default, dbt will search in all resource paths for docs blocks (i.e. the combined list of source-paths, data-paths, analysis-paths, macro-paths and snapshot-paths) — you can adjust this behavior using the docs-paths config.

To use a docs block, reference it from your schema.yml file with the doc() function.


Timestamps:
0:00 - Intro
0:20 - How to Add a Docs Block
2:48 - Consolidate Common Definitions
5:22 - Closing

Title & Tags:
Using Docs Blocks | DRY Documentation | dbt labs | Data Build Tool (dbt) Tutorial
#databuildtool #dataengineering #dbtdata #clouddatabase #snowflakedatawarehouse