Add apply_meta_as_tags macro#21
Conversation
|
Thank you for your contribution @jamesweakley. I will aim to merge this in the next few days! |
|
@jamesweakley I tested your macro using the yaml driven approach and the macro only executes if a table and column tag are set on a model. Are you able to have tags created/set using only the column meta tags? the log file shows " meta': {'database_tags': None}, 'transient': False}" and skips |
|
@gmatsonANSYS good pickup, I hadn't tried that scenario. Will take a look today |
…e tags. Improved documentation of internal macros and added clarification to readme.
|
@gmatsonANSYS it should now work even if you've only defined column tags |
|
Thanks James, the updates worked as expected. The only tweaks I had to make were around the existing tag filters: Converted the table and column name to upper - similar to the tag_name pipe - to return matches. Updated to the fifth column index for the tag value comparison |
|
@gmatsonANSYS thanks for the code snippets, I've pushed some more changes and tested various matching/non-matching scenarios and it seems consistent now |
|
@gmatsonANSYS hopefully this all works in your test scenario now? |
|
@jamesweakley runs smooth as silk. Thank you! |
|
Awesome, if there are no further updates to this PR I'll be merging it shortly. |
MartinGuindon
left a comment
There was a problem hiding this comment.
@jamesweakley The macro should be documented in macros.yml, and there's a typo in the README. Other than that, looks pretty good to me . Once fixed I'll merge and issue a new version.
|
@MartinGuindon Thanks, I've pushed those changes now |
This PR adds the apply_meta_as_tags as discussed here: dbt-labs/dbt-snowflake#104
Documentation is available in the readme, I opted for a yaml-driven approach.
Tested on a sample model with dbt 1.3.0.