-
Notifications
You must be signed in to change notification settings - Fork 135
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 run dbt deps
when there are dependencies
#1030
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✅ Deploy Preview for sunny-pastelito-5ecb04 canceled.
|
As of Cosmos 1.4, Cosmos will attempt to run dbt deps even if there are no dependencies.yml or packages.yml in the dbt project directory. This causes an unecessary overhead in creating subprocesses, without any benefit. This problem was originally spotted by Algirdas, who created a pull request proposing a solution to the problem: https://github.com/astronomer/astronomer-cosmos/pull/893/commits Since then, the PR became stale, but the problem remains relevant. This PR proposes a different implementation to solve the same problem. Co-authored-by: AlgirdasDubickas <123624084+AlgirdasDubickas@users.noreply.github.com>
6c17f57
to
8fe85dc
Compare
2 tasks
dbt deps
when there are dependenciesdbt deps
when there are dependencies
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1030 +/- ##
==========================================
+ Coverage 95.75% 95.77% +0.01%
==========================================
Files 62 62
Lines 2965 2979 +14
==========================================
+ Hits 2839 2853 +14
Misses 126 126 ☔ View full report in Codecov by Sentry. |
pankajkoti
approved these changes
Jun 7, 2024
pankajkoti
pushed a commit
that referenced
this pull request
Jun 7, 2024
As of Cosmos 1.4, Cosmos will attempt to run dbt deps even if there are no `dependencies.yml` or `packages.yml` in the dbt project directory. This causes an unnecessary overhead in creating subprocesses without any benefit. This problem was initially spotted by @AlgirdasDubickas, who created a pull request proposing a solution to the problem: #893 Despite the original PR becoming stale, the problem it addresses remains relevant. This PR proposes a different implementation to solve the same problem. It addresses the issue from a rendering perspective (converting a dbt project into an Airflow DAG using `LoadMode.DBT_LS`) and an execution perspective (when Airflow worker nodes run/trigger dbt commands to be run when using `ExecutionMode.LOCAL` or `ExecutionMode.VIRTUALENV`). Co-authored-by: AlgirdasDubickas <123624084+AlgirdasDubickas@users.noreply.github.com> (cherry picked from commit 3a63bee)
Merged
pankajkoti
added a commit
that referenced
this pull request
Jun 7, 2024
Bug fixes * Bring back ``dataset`` as a required field for BigQuery profile by @pankajkoti in #1033 Enhancements * Only run ``dbt deps`` when there are dependencies by @tatiana in #1030 Docs * Fix docs so it does not reference non-existing ``get_dbt_dataset`` by @tatiana in #1034 --------- Co-authored-by: Tatiana Al-Chueyr <tatiana.alchueyr@gmail.com>
arojasb3
pushed a commit
to arojasb3/astronomer-cosmos
that referenced
this pull request
Jul 14, 2024
As of Cosmos 1.4, Cosmos will attempt to run dbt deps even if there are no `dependencies.yml` or `packages.yml` in the dbt project directory. This causes an unnecessary overhead in creating subprocesses without any benefit. This problem was initially spotted by @AlgirdasDubickas, who created a pull request proposing a solution to the problem: astronomer#893 Despite the original PR becoming stale, the problem it addresses remains relevant. This PR proposes a different implementation to solve the same problem. It addresses the issue from a rendering perspective (converting a dbt project into an Airflow DAG using `LoadMode.DBT_LS`) and an execution perspective (when Airflow worker nodes run/trigger dbt commands to be run when using `ExecutionMode.LOCAL` or `ExecutionMode.VIRTUALENV`). Co-authored-by: AlgirdasDubickas <123624084+AlgirdasDubickas@users.noreply.github.com>
arojasb3
pushed a commit
to arojasb3/astronomer-cosmos
that referenced
this pull request
Jul 14, 2024
Bug fixes * Bring back ``dataset`` as a required field for BigQuery profile by @pankajkoti in astronomer#1033 Enhancements * Only run ``dbt deps`` when there are dependencies by @tatiana in astronomer#1030 Docs * Fix docs so it does not reference non-existing ``get_dbt_dataset`` by @tatiana in astronomer#1034 --------- Co-authored-by: Tatiana Al-Chueyr <tatiana.alchueyr@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area:performance
Related to performance, like memory usage, CPU usage, speed, etc
area:rendering
Related to rendering, like Jinja, Airflow tasks, etc
dbt:deps
Primarily related to dbt deps command or functionality
execution:local
Related to Local execution environment
lgtm
This PR has been approved by a maintainer
size:M
This PR changes 30-99 lines, ignoring generated files.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As of Cosmos 1.4, Cosmos will attempt to run dbt deps even if there are no
dependencies.yml
orpackages.yml
in the dbt project directory. This causes an unnecessary overhead in creating subprocesses without any benefit.This problem was initially spotted by @AlgirdasDubickas, who created a pull request proposing a solution to the problem: #893
Despite the original PR becoming stale, the problem it addresses remains relevant.
This PR proposes a different implementation to solve the same problem. It addresses the issue from a rendering perspective (converting a dbt project into an Airflow DAG using
LoadMode.DBT_LS
) and an execution perspective (when Airflow worker nodes run/trigger dbt commands to be run when usingExecutionMode.LOCAL
orExecutionMode.VIRTUALENV
).Co-authored-by: AlgirdasDubickas 123624084+AlgirdasDubickas@users.noreply.github.com