dbt-labs / dbt-codegen

Macros that generate dbt code
https://hub.getdbt.com/dbt-labs/codegen/latest/
Apache License 2.0
464 stars 102 forks source link

Expand `generate_model_yaml` to handle seeds as well #121

Closed RiversPharmD closed 11 months ago

RiversPharmD commented 1 year ago

Describe the feature

Add an additional argument to generate_model_yaml that toggles the .append call between 'models' and 'seeds', like generate_mod_yaml(model_names=[], upstream_descriptions=False, seed=False)

Describe alternatives you've considered

I've considered writing a separate function to handle this, where you call generate_seed_yaml, but it would nearly identical to generate_model_yaml, and both functions would need to be updated.

I am debating between the if/else statement setting a variable equal to model or seed and then just having one do statement, or if the if/else statements should just call the do statement based on the input.

Additional context

To my knowledge this is not database specific. I understand the push to not seed data, but I think that this is a low-lift implementation that would benefit end users that need to quickly introduce and document seeds to a model, rather than read in full tables.

Who will this benefit?

This will benefit people working with multiple seed files, who want to document their code and tables in a consistent manner.

Are you interested in contributing this feature?

Sure! I'll wait to fork the repo until this feature is supported, but happy to handle the first draft and revisions.

github-actions[bot] commented 11 months ago

This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days.

github-actions[bot] commented 11 months ago

Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest. Just add a comment to notify the maintainers.