dbt-labs / dbt-labs/dbt-codegen
Fill in model/column descriptions when available in database metadata
- Dominant language
- Makefile
- Stars
- 676
- Forks
- 132
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the feature
Model and column descriptions can be stored in the database using the [persist_docs](https://docs.getdbt.com/reference/resource-configs/persist_docs) feature. It is sometimes useful to "regenerate" the YAML files for models when tweaks have been made. However, the regenerated YAML has empty descriptions, meaning you need to manually copy and paste the old descriptions. If these descriptions have been stored in the database (persist_docs is set to true), then that could be used as the source to fill in already written descriptions.
### Describe alternatives you've considered
Manually copy and paste descriptions from the old yaml into the new yaml.
### Additional context
Different databases may store these descriptions differently, but you should be able to reference how persist_docs handles it.
### Who will this benefit?
Anybody using codegen to automate the creation of source/model YAML files with descriptions already written.
### Are you interested in contributing this feature?
I'm not currently able to
Contributor guide
Research direction
Start by reviewing how codegen currently generates model and column YAML and how dbt's persist_docs feature exposes descriptions in database metadata. Compare metadata behavior across the supported databases, then define completion as regenerated YAML retaining available model and column descriptions while preserving existing behavior when metadata is absent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100