dbt-labs / dbt-labs/dbt-codegen

Generated YAML and SQL code should conform to dbt Labs style guide

Open
#218 1 comment 2 reactions 0 assignees View on GitHub
enhancement Stale
Dominant language
Makefile
Stars
676
Forks
132
PR merge metrics
No merged PRs in 30d

Description

### Describe the feature

Any YAML or SQL generated by `codegen` should adhere to these style guides:
- [How we style our YAML](https://docs.getdbt.com/best-practices/how-we-style/5-how-we-style-our-yaml)
- [How we style our SQL](https://docs.getdbt.com/best-practices/how-we-style/2-how-we-style-our-sql)

### Additional context

See https://github.com/dbt-labs/dbt-codegen/pull/74/files#r944596657 for the instigating thread.

For example, here is our current and original style guides for CTEs (`with` statement):
- [Current](https://docs.getdbt.com/best-practices/how-we-style/2-how-we-style-our-sql#import-ctes)
- [Original](https://github.com/dbt-labs/corp/blob/08c3799c7c62fa618e3105362cf0c020c17d3ee8/dbt_style_guide.md#ctes) (just for historical context of any changes over time)

### Who will this benefit?

This will avoid confusion for users that see one thing recommended as a best practice or adopted style guide, but then see something else auto-generated by this package.

Contributor guide

Open the contributing guide

Research direction

Start at the `codegen` generation entry points and compare their YAML and SQL output with the linked dbt Labs style guides, including the CTE guidance. Done means generated YAML and SQL consistently follow those current guides; use the linked pull request discussion for the original context.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql, yaml
Domain
data-engineering, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.