Montreal-Analytics / dbt-snowflake-utils

Snowflake-specific utility macros for dbt projects.
Apache License 2.0
107 stars 37 forks source link

[Bug] apply_meta_as_tags macro does not work with dbt<1.1.0 #22

Closed ogr003 closed 2 years ago

ogr003 commented 2 years ago

Current behavior

Due to https://github.com/dbt-labs/dbt-core/issues/4459, the res.node.meta node is not populated, meaning that no database tags are added by the apply_meta_as_tags macro.

Expected behavior

Should identify all models that has populated the database_tags meta field.

Environment

dbt: 1.0.1

Additional context

The res.node.config.meta field looks to be populated in dbt==1.0.1, so a suggested approach could be to use this instead. Alternatively, the dbt version constraint could be updated to dbt>=1.1.0, when the issue was resolved.

MartinGuindon commented 2 years ago

@jamesweakley Do you want to take a look?

jamesweakley commented 2 years ago

@MartinGuindon yes I’ll take a look

jamesweakley commented 2 years ago

@ogr003 thanks for reporting the issue and also pointing out the solution!

I've opened a PR for this.

MartinGuindon commented 2 years ago

Fixed in release 0.4.1. Thanks @jamesweakley !