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

Only create the packages-install-path / dbt_packages folder during dbt deps #9810

Merged
merged 3 commits into from
Apr 5, 2024

Conversation

dbeatty10
Copy link
Contributor

@dbeatty10 dbeatty10 commented Mar 23, 2024

resolves #6985
resolves #9584

Problem

dbt commands other than dbt deps are making sure a directory exists at this configured packages-install-path (which defaults to "dbt_packages").

This is leading to the surprising behavior reported in #6985 and #9584.

Solution

Only create the packages-install-path / dbt_packages folder when running dbt deps.

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/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 Mar 23, 2024
Copy link

codecov bot commented Mar 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.04%. Comparing base (c071868) to head (24d43d3).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9810      +/-   ##
==========================================
- Coverage   88.09%   88.04%   -0.05%     
==========================================
  Files         178      178              
  Lines       22461    22460       -1     
==========================================
- Hits        19787    19775      -12     
- Misses       2674     2685      +11     
Flag Coverage Δ
integration 85.42% <ø> (-0.14%) ⬇️
unit 61.72% <ø> (-0.01%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dbeatty10 dbeatty10 marked this pull request as ready for review March 23, 2024 19:30
@dbeatty10 dbeatty10 requested a review from a team as a code owner March 23, 2024 19:30
Copy link
Contributor

@QMalcolm QMalcolm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for putting this together 🙂 It looks great!

Of note, part of #9584 is the following line

Rather, it should only create this directory when running dbt deps (and only if there is at least one package to install).

The in parentheses portion of that is to only create the directory when there are actually dependencies to install. I am absolutely okay with that not being part of this PR. However, we still want to implement that we can either create a new issue for just that part or I'm happy to pair and get that in as part of this PR.

@dbeatty10
Copy link
Contributor Author

The in parentheses portion of that is to only create the directory when there are actually dependencies to install. I am absolutely okay with that not being part of this PR. However, we still want to implement that we can either create a new issue for just that part or I'm happy to pair and get that in as part of this PR.

I think the part in parentheses is already taken care of here in DepsTask whenever dbt deps is executed:

system.make_directory(self.project.packages_install_path)

Just let me know if it looks like something key is missing!

@dbeatty10 dbeatty10 merged commit e81f7fd into main Apr 5, 2024
62 checks passed
@dbeatty10 dbeatty10 deleted the dbeatty/fix-6985 branch April 5, 2024 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants