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

generate source to have parameter to take existing descriptions in the project #80

Closed djayatillake closed 1 year ago

djayatillake commented 1 year ago

Describe the feature

It would be good if the generate_source macro could have a boolean parameter, which if set to True, looks for existing documentation to use instead of having blank descriptions.

Describe alternatives you've considered

The alternative is to use generate_source filtering to one table and then inserting that carefully into the existing sources.yml file... but this could be error prone.

Additional context

Not db specfic

Who will this benefit?

Analytics Engineers who are using codegen to generate docs, but just want to regenerate the whole lot at once when adding a new table and therefore want to keep whatever they had before for existing tables.

Are you interested in contributing this feature?

Sure I'd need to figure out how to set up an environment etc, or is there a devcontainer and then I could use Codespaces?

djayatillake commented 1 year ago

I guess the logic change would need to be made here: https://github.com/dbt-labs/dbt-codegen/blob/c00701b99efe7bc4187f6ebb9b30bf8eeeef0733/macros/generate_source.sql#L65

But we'd need to look for the existing sources.yml earlier in the macro and store it so we could refer to elements from it in this line.

github-actions[bot] commented 1 year 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 1 year 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.