-
Notifications
You must be signed in to change notification settings - Fork 96
Description
Describe the bug
I'm working with two teams who have been using either the dbt Cloud CLI or dbt Studio IDE and testing out dbt Fusion. I have two similar cases:
- One team has dbt macros that use
DBT_CLOUD_INVOCATION_CONTEXTenvironment variable to set targets and warehouses. - A second team usually uses dbt Studio IDE set their own custom variables:
DBT_SOURCE_DB,DBT_PREP_DB, etc. that they use indbt_project.yml. When they tried out dbt Fusion on VSCode, they expected that their dbt Platform env vars would be available to them, and in the interim created a.envfile with variables -- but their preference is for these variables to be centrally managed.
In both cases, dbtf (in VSCode) does not recognize the environment variables from dbt Platform.
I've confirmed in dbt Studio with Fusion enabled that DBT_CLOUD_INVOCATION_CONTEXT is enabled. However, in local dev (VSCode) this variable does not appear to be set.
What version of dbt Fusion is this bug in? (find out by running dbt --version)
dbt-fusion 2.0.0-preview.7
Is this a discrepancy between the dbt Fusion Engine and dbt Core? Check one.
- YES
- NO
To Reproduce
- Add a model with contents
select {{ env_var('DBT_CLOUD_INVOCATION_CONTEXT') }} as invo_contextto a local dbt Fusion project in VSCode. - Observe the following error:
dbt1501: Failed to render SQL invalid operation: 'env_var': environment variable 'DBT_CLOUD_INVOCATION_CONTEXT' not found
Expected behavior
Developers that use dbt Platform have the DBT_CLOUD_INVOCATION_CONTEXT environment variable available in their VSCode local development environment.
Operating System and CPU Type (please complete the following information):
Apple Silicon