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

issue106/get_models helper macro #115

Merged
merged 13 commits into from
Feb 1, 2023
Merged

issue106/get_models helper macro #115

merged 13 commits into from
Feb 1, 2023

Conversation

erkanncelen
Copy link
Contributor

resolves #

This is a:

  • documentation update
  • bug fix with no breaking changes
  • new functionality
  • a breaking change

All pull requests from community contributors should target the main branch (default).

Description & motivation

Added a helper macro named "get_models" in the macros/helpers section. The macro is used to get a list of all models with a specified prefix, in a specified directory.

Example:
codegen.get_models(directory='marts', prefix='fct')

I mainly created this to make generate_model_yaml macro more powerful.

Example:
codegen.generate_model_yaml(
model_names = codegen.get_models(directory='marts', prefix='fct')

This way we can generate yamls for any set of models in our project.

Checklist

Copy link
Contributor

@joellabes joellabes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two wee tweaks but otherwise we're good to go!

README.md Outdated Show resolved Hide resolved
integration_tests/tests/test_helper_get_models.sql Outdated Show resolved Hide resolved
erkanncelen and others added 3 commits January 31, 2023 10:21
Co-authored-by: Joel Labes <joel.labes@dbtlabs.com>
Co-authored-by: Joel Labes <joel.labes@dbtlabs.com>
@erkanncelen
Copy link
Contributor Author

You are right, I accepted the changes in readme.

And yes, apparently I forgot to delete | trims after I reworked the test.

All done! Thanks @joellabes

@joellabes joellabes linked an issue Feb 1, 2023 that may be closed by this pull request
@joellabes joellabes merged commit e24e5dc into dbt-labs:main Feb 1, 2023
jeremyholtzman pushed a commit that referenced this pull request Apr 10, 2023
issue106/get_models helper macro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

folder_path and model_prefix functionality for generate_model_yaml
2 participants