Skip to content

Commit

Permalink
Fix #486: using env_var in Profiles.yml raised a LookupError (#487)
Browse files Browse the repository at this point in the history
* Fix #486: using env_var in Profiles.yml raised a LookupError

* Implement raw env_var usage in 'generate sources Snowflake' test
  • Loading branch information
BAntonellini authored Jul 15, 2024
1 parent 3884b8e commit ecef89e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions dbt_coves/tasks/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ def from_args(cls, args):
if (__dbt_major_version__, __dbt_minor_version__) < (1, 8):
config = cls.ConfigType.from_args(args)
else:
from dbt_common.clients.system import get_env
from dbt_common.context import set_invocation_context

set_invocation_context(get_env())
config = RuntimeConfig.from_args(args)
try:
return cls(args, config)
Expand Down
2 changes: 1 addition & 1 deletion tests/templates/profiles.yml.template
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ test_dbt_coves_snowflake:
dev:
account: {{ env_var('ACCOUNT_SNOWFLAKE')}}
database: {{ env_var('DATABASE_SNOWFLAKE')}}
password: {{ env_var('PASSWORD_SNOWFLAKE')}}
password: {%raw%}"{{ env_var('PASSWORD_SNOWFLAKE')}}"{%endraw%}
role: {{ env_var('ROLE_SNOWFLAKE')}}
schema: {{ env_var('SCHEMA_SNOWFLAKE')}}
threads: 1
Expand Down

0 comments on commit ecef89e

Please sign in to comment.