Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restrict generate sources to output yml files only #6

Closed
kon-mal opened this issue Jul 2, 2021 · 2 comments
Closed

Restrict generate sources to output yml files only #6

kon-mal opened this issue Jul 2, 2021 · 2 comments
Labels
documentation Improvements or additions to documentation question Further information is requested triaged: no Hasn't been approved for future implementation

Comments

@kon-mal
Copy link

kon-mal commented Jul 2, 2021

Is your feature request related to a problem? Please describe.
Generating full .yml files (model name, list of columns, empty description fields) for every model in a dbt project - thorough documentation.

Describe the solution you'd like
If the current generate sources function had a flag that disables .sql files creation / or yml-only flag, it would achieve exactly that. Although it's set up for sources specifically, if you provide your analytics schema in the .dbt_coves.yml, it will create the yml definitions for all of the dbt models in a project.

Describe alternatives you've considered
As an alternative I had a wrapper python function that captured terminal output of this function https://github.com/dbt-labs/dbt-codegen/blob/0.3.2/macros/generate_model_yaml.sql for each model and created the ymls.

Additional context
The generate sources function is extremely useful in creating staging models for a dbt project. It seems, however, that it could be easily extended to help with thorough documentation of all models within a dbt project. Ideally, it wouldn't then put the "sources" part at the top of the file, but that's much easier to get rid of than creating all of the ymls from scratch!

@github-actions github-actions bot added documentation Improvements or additions to documentation question Further information is requested triaged: no Hasn't been approved for future implementation labels Jul 2, 2021
@ssassi
Copy link
Contributor

ssassi commented Jul 7, 2021

Nice idea @kon-mal.
I would suggest then creating another variant of the generate subcommand, i.e. dbt-coves generate properties.
Instead of reading the DB schema, I'd suggest reading models information from the dbt manifest.
The tool could list the models so the user selects which ones to generate.

@noel
Copy link
Contributor

noel commented Nov 12, 2022

@kon-mal generate properties now exists

@noel noel closed this as completed Nov 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation question Further information is requested triaged: no Hasn't been approved for future implementation
Projects
None yet
Development

No branches or pull requests

3 participants