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

176 clean before deps #183

Merged
merged 3 commits into from
Sep 30, 2023
Merged

176 clean before deps #183

merged 3 commits into from
Sep 30, 2023

Conversation

b-per
Copy link
Contributor

@b-per b-per commented Sep 29, 2023

Fixes #176

Runs dbt clean before dbt deps when the packages installed don't match the packages in packages.yml

One of the use cases where clean is required for example is when people used to use dbt_metrics and then move to 1.6. Removing the package from packages.yml doesn't remove it from dbt_packages and still raise compilation errors.

Copy link
Collaborator

@nicholasyager nicholasyager left a comment

Choose a reason for hiding this comment

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

@b-per This change is both necessary and sufficient for resolving #176. Thanks for the contribution.

@@ -7,6 +7,7 @@ venv/
__pycache__/
# IDEs
.idea/
.vscode/
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm genuinely surprised we've managed to get this far without adding .vscode to the gitignore. Thanks for adding it here.

@@ -22,7 +22,8 @@ def invoke(
result = self.dbt_runner.invoke(runner_args if runner_args else [])
if not result.success and result.exception:
if isinstance(result.exception, UninstalledPackagesFoundError):
logger.debug("Project missing packages, running dbt deps...")
logger.debug("Project missing packages, running dbt clean and dbt deps...")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Kudos for updating the debug log.

@nicholasyager nicholasyager merged commit 6ef6305 into main Sep 30, 2023
3 checks passed
@nicholasyager nicholasyager deleted the 176-clean-before-deps branch September 30, 2023 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Run dbt clean before dbt deps
2 participants