AltimateAI / AltimateAI/vscode-dbt-power-user

Cannot go to source yml definition when source is defined in a package

Đang mở
#806 2 bình luận 0 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

Cannot control click the schema or table name in a `source` macro; clicking the model in the `PARENT MODELS` sidebar tries to open a file in the wrong directory and fails with a `The editor could not be opened because the file was not found.` error.

### Actual behavior

Clicking the model in the `PARENT MODELS` sidebar view or `CTRL+Click`ing the model or schema name in a `source` macro should take me to the file which contains the declaration for that source.

### Steps To Reproduce

This issue occurs when a yaml file containing a source definition is imported from an external package via the `packages.yml` file. The yaml files are downloaded into `dbt_packages/package_name/sources/my_source.yml` through the `dbt deps` command.

The extension is able to correctly identify these imported sources, and building models utilizing them them works correctly in DBT (including generating documentation). Their definition also shows up when hovering over the model name, but attempting to follow any links to them does not work correctly; right clicking does nothing, and clicking them in the `PARENT MODELS` view attempts to open a `sources/my_source.yml` file, which seems to omit the `dbt_packages/package_name` prefix.

Note that adding the `dbt_packages/package_name` directory to the `model-paths` in the `dbt_project.yml` configuration file seems to cause the extension to work correctly, and use the full path when trying to open the file. This does, however, cause unintended side effects in DBT, such as the documentation for these sources being duplicated.

### Log output/Screenshots

_No response_

### Operating System

MacOS

### dbt version

1.5.8, also tested on 1.7.1

### dbt Adapter

dbt-snowflake

### dbt Power User version

0.28.4

### Are you willing to submit PR?

- [ ] 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.