Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve relative local dependencies of local dependencies #10600

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

dbeatty10
Copy link
Contributor

@dbeatty10 dbeatty10 commented Aug 23, 2024

Resolves #5410

Problem

#5410 describes how package dependencies that include transitive relative paths to a parent directory don't work as expected. e.g., when packages.yml has a local package and that package also depends on a different local package, the paths get messed up.

This is because currently, the local package's resolved path is always relative to the root project from which dbt deps is run.

Solution

Per #5410 (comment), find a way to pass in the absolute path of the package's packages.yml.

E.g., get the location of the packages.yml file in which each local package specification is actually defined. Then pass in the absolute path of that location and use it to resolve the local package's path.

Checklist

  • I have read the contributing guide and understand what's expected of me.
  • I have run this code in development, and it appears to resolve the stated issue.
  • This PR includes tests, or tests are not required or relevant for this PR.
  • This PR has no interface changes (e.g., macros, CLI, logs, JSON artifacts, config files, adapter interface, etc.).
  • This PR includes type annotations for new and modified functions.

@cla-bot cla-bot bot added the cla:yes label Aug 23, 2024
Copy link
Contributor

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

Copy link

codecov bot commented Aug 23, 2024

Codecov Report

Attention: Patch coverage is 96.42857% with 1 line in your changes missing coverage. Please review.

Project coverage is 86.72%. Comparing base (bba020f) to head (b290855).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10600      +/-   ##
==========================================
- Coverage   88.91%   86.72%   -2.20%     
==========================================
  Files         180      180              
  Lines       22755    22766      +11     
==========================================
- Hits        20232    19743     -489     
- Misses       2523     3023     +500     
Flag Coverage Δ
integration 83.56% <96.42%> (-2.66%) ⬇️
unit 62.33% <89.28%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Unit Tests 62.33% <89.28%> (-0.01%) ⬇️
Integration Tests 83.56% <96.42%> (-2.66%) ⬇️

@dbeatty10
Copy link
Contributor Author

Failing two tests related to ensuring partial parsing still works after renaming the root directory of a dbt project:

FAILED tests/functional/partial_parsing/test_partial_parsing.py::TestPortablePartialParsing::test_pp_renamed_project_dir_unchanged_project_contents
FAILED tests/functional/partial_parsing/test_partial_parsing.py::TestPortablePartialParsing::test_pp_renamed_project_dir_changed_project_contents

Source code:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CT-775] [Enhancement] dbt deps does not correctly resolve local dependency of local dependency
1 participant