AltimateAI / AltimateAI/vscode-dbt-power-user

Support python interpreter per workspace folder

Đang mở
#770 16 bình luận 5 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
JavaScript
Star
585
Fork
121
Merge trung bình
5 ngày 39 phút
Pull request đã merge (30 ngày)
4

Mô tả

### Expected behavior

In our project, we use [multi-root workspace](https://code.visualstudio.com/docs/editor/multi-root-workspaces).

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,

1. If it is set, the settings of `dbt-power-user` extension.
2. Python virtual environment on each workspace folder like `dbt` folder.
3. Python virtual environment on workspace root.
4. Global environment ($PATH)

### Actual behavior

The path finding for `dbt power user` is as follows:

1. If it is set, the settings of `dbt-power-user` extension.
2. 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

1. use multi-workspace.
2. add `sample` workspace-folder and create dbt project on it.
3. create python virtual environment on the `sample` workspace.
4. set python virtual environment on the `sample` workspace.
![figure](https://github.com/AltimateAI/vscode-dbt-power-user/assets/47286750/7c130a01-3e37-4099-972f-4497ac9accbd)
4. install `dbt-core` in the python virtual environment on the `sample` workspace.
6. open `sample/dbt_project.yml`

### Log output/Screenshots

https://private-user-images.githubusercontent.com/47286750/289367172-311f6d7f-f917-469a-8a9a-4f547416d3ba.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTEiLCJleHAiOjE3MDIyNjEzOTEsIm5iZiI6MTcwMjI2MTA5MSwicGF0aCI6Ii80NzI4Njc1MC8yODkzNjcxNzItMzExZjZkN2YtZjkxNy00NjlhLThhOWEtNGY1NDc0MTZkM2JhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFJV05KWUFYNENTVkVINTNBJTJGMjAyMzEyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjMxMjExVDAyMTgxMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWFjZTQ1MjYzOGExMDdhYzM4MjM1Zjk2NjNhMzI1NzA3MmYwZDRkMGIzMjFiNWRmOWY0MThiZjhlZjllY2U0N2QmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.S7E_pLOh74ScMYS_NFfMVzTlBsqXSUiaTFTZdnNSJ7Q

### 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?

- [X] Yes I am willing to submit a PR!

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.