Release 1.11.3#2205
Merged
Merged
Conversation
Some dbt projects are generic and are configured in a way that the
`packages-install-path` is jinja templated. For example:
```
packages-install-path: 'dbt_packages{{ "_" + env_var("dbt_packages_suffix","") if env_var("dbt_packages_suffix","")!="" }}'
```
When attempting to use this with
- `ProjectConfig.install_dbt_deps=True`
- `ProjectConfig.copy_dbt_packages=True`
Users who have this configuration face the following error:
```
[2025-12-11, 10:54:23 UTC] {local.py:474} INFO - Copying dbt packages to temporary folder.
[2025-12-11, 10:54:23 UTC] {project.py:77} INFO - Copying dbt packages to temporary folder...
[2025-12-11, 10:54:23 UTC] {taskinstance.py:3336} ERROR - Task failed with exception
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/airflow/models/taskinstance.py", line 776, in _execute_task
result = _execute_callable(context=context, **execute_callable_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/airflow/models/taskinstance.py", line 742, in _execute_callable
return ExecutionCallableRunner(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/airflow/utils/operator_helpers.py", line 252, in run
return self.func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/cosmos/operators/base.py", line 310, in execute
self.build_and_run_cmd(context=context, cmd_flags=self.add_cmd_flags())
File "/usr/local/lib/python3.11/site-packages/cosmos/operators/local.py", line 842, in build_and_run_cmd
result = self.run_command(
^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/cosmos/operators/local.py", line 601, in run_command
self._clone_project(tmp_dir_path)
File "/usr/local/lib/python3.11/site-packages/cosmos/operators/local.py", line 475, in _clone_project
copy_dbt_packages(Path(self.project_dir), tmp_dir_path)
File "/usr/local/lib/python3.11/site-packages/cosmos/dbt/project.py", line 91, in copy_dbt_packages
shutil.copy2(src_path, dst_path)
File "/usr/local/lib/python3.11/shutil.py", line 448, in copy2
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "/usr/local/lib/python3.11/shutil.py", line 256, in copyfile
with open(src, 'rb') as fsrc:
^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/airflow/dags/dbt/pr_3531_13_dbt_vip_enrichment/dbt_packages{{ "_" + env_var("dbt_packages_suffix","") if env_var("dbt_packages_suffix","")!="" }}'
```
This is because when we implemented
#1768 we did not
forsee the parameter could be a template.
This PR aims to solve this issue.
Observation: we'll need to release this not only as part of 1.12.0, but
also cherry-pick it and, exceptionally, backport it to v1.10.3 and
1.11.3.
(cherry picked from commit 4a906cd)
pankajkoti
approved these changes
Dec 16, 2025
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.
Bug Fixes
packages-install-pathwhen it usesenv_varby @tatiana in Fix resolution ofpackages-install-pathwhen it usesenv_var#2194