-
Notifications
You must be signed in to change notification settings - Fork 132
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
[FEATURE] Make use of meta config when defining model metadata #106
Comments
This is a great request and something we are planning to experiment with. We want to ensure a smooth transition to this feature and we're working out whether this would be replacement functionality or whether it would work alongside macro parameters (and then whether that would be a good idea!) We originally suggested this change here so we're excited for the possibilities for this. Thanks again! |
Perhaps the simplest solution with minimal impact to users might be to set default values for macro arguments, taking those defined in config. Something like:
This implementation should effectively be backward compatible. schema.yml
my_hub.sql
|
Yes this was the kind of thing we had in mind! Just hadn't had a chance to play around with it yet. Thanks for this :) |
Hi! I did some investigation on this yesterday, and discovered it might not be possible yet. I've submitted an issue to dbt here. Essentially |
@DVAlexHiggs interesting, thanks for looking at this. And thanks for raising the ticket in dbt-core. I suspect this might be an issue related to the timing of when dbt parses the properties file(s). The reason I say this is because I've created macros that behave in a similar way, but where the config options are specified in the config block of the model, they work as expected. Do you know what the precedence is for model parsing? Are you having the same problem if you define |
I think I did try this. Will clarify. It would be better if it would work either way, however. |
No unfortunately that does not work either.
|
Minor update @alexjreilly |
Make use of the
meta
dictionary either in the model config block or properties (.yml) file(s) when defining the model metadata. (e.g.src_pk
etc.).I think this would be cleaner and could improve readability of the models.
Docs for reference.
AB#5376
The text was updated successfully, but these errors were encountered: