Release 1.2.0#600
Merged
Merged
Conversation
Apply Sweep Rules to your PR?
|
👷 Deploy Preview for amazing-pothos-a3bca0 processing.
|
harels
approved these changes
Oct 13, 2023
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #600 +/- ##
=======================================
Coverage 93.13% 93.13%
=======================================
Files 51 51
Lines 2053 2053
=======================================
Hits 1912 1912
Misses 141 141
☔ View full report in Codecov by Sentry. |
This was referenced Apr 16, 2025
tatiana
added a commit
that referenced
this pull request
Apr 16, 2025
…` during DAG parsing (#1668) Support running `dbt deps` incrementally to pre-calculated `dbt_packages` during DAG parsing. This was a use case requested by an Astro customer. Before this change, Cosmos supported two types of configuration: * If users choose `RenderConfig. dbt_deps=False` or `ProjectConfig.install_dbt_deps=False`, Cosmos would create a symbolic link for the user's pre-defined `dbt_packages` (background: #488, #600, #730) * If users choose `RenderConfig. dbt_deps=True` or `ProjectConfig.install_dbt_deps=True` (default), Cosmos would ignore any user-predefined ' dbt_packages` and do a run `dbt deps` from scratch from a temporary folder. An Astronomer customer requested to reuse the defined initially `dbt_packages` directory and run `dbt deps` (incrementally). We do not run dbt commands directly in the original dbt project folder with Cosmos because some users use read-only filesystems (#414). We also decided to use symbolic links instead of copying the directory due to performance issues (#488). Since we did not want to introduce a breaking change in a minor Cosmos release by changing the existing Cosmos 1.x behaviour to meet this new use case, this PR supports: * Copying the dbt deps related files (dbt packages folder and symbolic link) to the Cosmos temporary folder; and * Running `dbt deps`. So this is not a breaking change, users must opt into this behaviour by either: - Changing individual `DbtDag` or `DbtTaskGroup` instances, using `ProjectConfig.copy_dbt_packages=True` (new configuration) and `RenderConfig. dbt_deps=True` or `ProjectConfig.install_dbt_deps=True`; or - Changing the behaviour globally, by setting the Airflow configuration either via the environment variable `AIRFLOW__COSMOS__DEFAULT_COPY_DBT_PACKAGES_VALUE=True`. or via the `airflow.cfg`: ``` [cosmos] default_copy_dbt_packages_value=True ``` The following two missing parts are being added as part of a separate PR: - Mimic this behaviour during task execution; - Update documentation to be representative of both changes. Depends on #1669 Related to: #1630
tatiana
added a commit
that referenced
this pull request
Apr 16, 2025
…` during task execution (#1670) Support running `dbt deps` incrementally to pre-calculated `dbt_packages` during the task execution. This was a use case requested by an Astro customer. Before this change, Cosmos supported two types of configuration: * If users choose `operator_args={"install_deps": False}` or `ProjectConfig.install_dbt_deps=False`, Cosmos would create a symbolic link for the user's pre-defined `dbt_packages` (background: #488, #600, #730) * If users choose `operator_args={"install_deps": True}` or `ProjectConfig.install_dbt_deps=True` (default), Cosmos would ignore any user-predefined ' dbt_packages` and do a run `dbt deps` from scratch from a temporary folder. An Astronomer customer requested to reuse the defined initially `dbt_packages` directory and run `dbt deps` (incrementally). # Implementation We do not run dbt commands directly in the original dbt project folder with Cosmos because some users use read-only filesystems (#414). We also decided to use symbolic links instead of copying the directory due to performance issues (#488). Since we did not want to introduce a breaking change in a minor Cosmos release by changing the existing Cosmos 1.x behaviour to meet this new use case, this PR supports: * Copying the dbt deps related files (dbt packages folder and symbolic link) to the Cosmos temporary folder; and * Running `dbt deps`. So this is not a breaking change, users must opt into this behaviour by using `ProjectConfig.copy_dbt_packages=True` (new configuration) and `operator_args={"install_dbt_deps": True}` or `ProjectConfig. install_dbt_deps =True` and one of the following: - Changing the operator to receive the argument `copy_dbt_packages=True` - Changing individual `DbtDag` or `DbtTaskGroup` instances to use the new configuration `ProjectConfig.copy_dbt_packages=True` - Changing the behaviour globally, by setting the Airflow configuration either via the environment variable `AIRFLOW__COSMOS__DEFAULT_COPY_DBT_PACKAGES_VALUE=True` or via the `airflow.cfg`: ``` [cosmos] default_copy_dbt_packages_value=True ``` # How this was tested To validate the end-to-end behaviour, we run the following dag from `dev/dags`: ``` airflow dags test dbt_deps_example ``` # Related tickets This is a follow-up to #1668 and #1669. I'll make a follow-up PR covering the documentation. Closes: #1630
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Features
dbt_project_pathin theProjectConfigoptional by @MrBones757 in Make the arg dbt_project_path in the ProjectConfig optional #581Bug fixes
GoogleCloudServiceAccountDictProfileMappingtogether withLoadMethod.DBT_LSby @joppevos in Skip mocking of keyfile_json field #587full_refreshargument in projects that contain tests by @EgorSemenov and @tatiana in fix: full_refresh unsused in test operators #590dbt_packages(solvesLocalExecutorconcurrency issue) by @tatiana in Release 1.2.0 #600Others