vscode-dbt-power-user: dbt command does not found in multi-root workspace folder
Expected behavior
In our project, we use multi-root workspace.
The folder structure of this project is like this.
.
├── project.code-workspace
├── dbt
│ ├── dbt_project.yml
│ ├── pyproject.toml
│ ├── ...
├── other-workspace-folder
│ ├── ...
As a priority for resolving dbt
command paths, we expect the following,
- If it is set, the settings of
dbt-power-user
extension. - Python virtual environment on each workspace folder like
dbt
folder. - Python virtual environment on workspace root.
- Global environment ($PATH)
Actual behavior
The path finding for dbt power user
is as follows:
- If it is set, the settings of
dbt-power-user
extension. - Python virtual environment on workspace root.
This python enviroment is determined the first time VSCode is opened, so moving workspace folders does not change the Python virtual environment settings.
Steps To Reproduce
- use multi-workspace.
- add
sample
workspace-folder and create dbt project on it. - create python virtual environment on the
sample
workspace. - set python virtual environment on the
sample
workspace. - install
dbt-core
in the python virtual environment on thesample
workspace. - open
sample/dbt_project.yml
Log output/Screenshots
Operating System
Mac OS 14.1.1(23B81)
dbt version
1.7.3
dbt Adapter
1.7.0
dbt Power User version
v0.27.3
Are you willing to submit PR?
- Yes I am willing to submit a PR!
About this issue
- Original URL
- State: open
- Created 7 months ago
- Reactions: 3
- Comments: 15 (12 by maintainers)
I just wanted to add a small note regarding what was said previously :
When using multi-root workspace folders, if the first folder is a DBT project, then the extension seems to work fine for that project. So in your VS Code Project definition, re-ordering folders to put the DBT project as the first folder fixes things for the said DBT environment.
It’s a quite nice workaround unless you have other projects/plugins that are not multi-root compatible like DBT power user, or unless you have multiple DBT projects with different configs
@yassun7010 let us know if you need help making these changes