Montreal-Analytics / dbt-snowflake-utils

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

fix: session db/schema and macro references #25

Closed calleo closed 1 year ago

calleo commented 1 year ago

Hi,

I could not get it to work neither using DBT 1.2 or 1.3. Calls that are made to macros within the package fail and tags are being looked for and created in the database and schema specified in the profile, not the database/schema of the model.

With the changes suggested by this PR I got it to work, by:

Database Error
  001003 (42000): SQL compilation error:
  syntax error line 1 at position 0 unexpected 'None'.

Related to https://github.com/Montreal-Analytics/dbt-snowflake-utils/issues/24

But TBH, I don't really understand why I am facing these issues seeing that https://github.com/Montreal-Analytics/dbt-snowflake-utils/pull/21 has been merged and things seem to work fine at that point.

jamesweakley commented 1 year ago

Thanks @calleo for the PR. I'm not sure why you sometimes need to qualify the macro calls, certainly in my past experience it was optional within a package.

The only part of the PR I'm unsure about is changing the location of tags specifically to match the model. I think it's OK for existing users, because the macro was already checking the fully qualified location for existing tags.

jamesweakley commented 1 year ago

If people do prefer a fixed location for all their tags, we can support that in future via some new environment variables

calleo commented 1 year ago

@JFrackson thank you for taking a look at the PR! I have added a few lines to the readme to clarify where the tags will be created.

calleo commented 1 year ago

No worries! Thanks for putting this together. I don't seem to be bale to merge so that's up to one of the maintainers.