Extension fails to register new environment variables added to .env file pointed to by the Python: Env File setting, rendering the extension useless #1348
Labels
enhancement
New feature or request
Expected behavior
After I add a new environment variable into my .env file pointed to by the Python: Env File setting, and then reference that variable in a YAML file, I should not see problems reported in my db_project.yml file or in the Problems pane of VS Code.
Actual behavior
After I add a new variable to my .env file, which is pointed to by Python: Env File setting, and after I reference this new variable in a YAML file, I see "problem" notifications in my dbt_project.yml file as well as in the Problems pane of VS Code.
The problem state is:
Env var required but not provided: <ENVIRONMENT_VARIABLE_NAME>
Here is a screenshot:
The variable is actually detected by the extension when using the command "Print environment variables", but the errors don't go away:
Unfortunately, sometimes the "Print environment variables" command fails to display anything in the terminal. It opens but stays blank like this:
To work around that display issue, navigate to the Output pane to view the Log - dbt output, which shows the environment variable is indeed set as above.
Steps To Reproduce
"python.envFile": "${workspaceFolder}/.env"
Log output/Screenshots
I believe the extension is failing to detect changes in the .env file, and therefore not registering any new environment variables added to that file. Therefore, it is impossible to use any dbt Power User commands in the command palette.
Operating System
Windows 11
dbt version
1.8.4
dbt Adapter
duckdb
dbt Power User version
0.43.2
Are you willing to submit PR?
The text was updated successfully, but these errors were encountered: