Skip to content

Fix dbt project parsing dbt_vars behavior#1543

Merged
tatiana merged 3 commits into
astronomer:mainfrom
AlexandrKhabarov:fix/dbt-vars-dbt-ls
Mar 3, 2025
Merged

Fix dbt project parsing dbt_vars behavior#1543
tatiana merged 3 commits into
astronomer:mainfrom
AlexandrKhabarov:fix/dbt-vars-dbt-ls

Conversation

@AlexandrKhabarov
Copy link
Copy Markdown
Contributor

Description

DbtToAirflowConverter can pass dbt_vars to DbtGraph with help of ProjectConfig or operator_args. If operator_args is used in DbtToAirflowConverter then it will lead to the issue with absence of dbt_vars in dbt ls command (faced rendering issue during usage of cosmos with project level variables)

Related Issue(s)

Breaking Change?

No breaking changes

Checklist

  • I have made corresponding changes to the documentation (if required)
  • I have added tests that prove my fix is effective or that my feature works

@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Feb 17, 2025
@dosubot dosubot Bot added area:rendering Related to rendering, like Jinja, Airflow tasks, etc area:testing Related to testing, like unit tests, integration tests, etc labels Feb 17, 2025
@netlify
Copy link
Copy Markdown

netlify Bot commented Feb 17, 2025

Deploy Preview for sunny-pastelito-5ecb04 canceled.

Name Link
🔨 Latest commit d96953f
🔍 Latest deploy log https://app.netlify.com/sites/sunny-pastelito-5ecb04/deploys/67c58fc81648090008045263

@AlexandrKhabarov
Copy link
Copy Markdown
Contributor Author

@tatiana can you take a look, please?

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.36%. Comparing base (c84cb1e) to head (d96953f).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1543   +/-   ##
=======================================
  Coverage   97.36%   97.36%           
=======================================
  Files          80       80           
  Lines        4932     4932           
=======================================
  Hits         4802     4802           
  Misses        130      130           

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

Comment thread cosmos/dbt/graph.py
@AlexandrKhabarov
Copy link
Copy Markdown
Contributor Author

@tatiana @pankajkoti
Do you have any updates?

@tatiana tatiana added this to the Cosmos 1.9.1 milestone Feb 27, 2025
@tatiana
Copy link
Copy Markdown
Collaborator

tatiana commented Feb 28, 2025

@AlexandrKhabarov, sorry for the delay in giving feedback; this week has been quite intense at work, and I wanted to give enough attention to this review. Please let us know your thoughts on committing @pankajkoti 's suggestion - I would love to have this released as part of Cosmos 1.9.1, with the other bugfixes

@AlexandrKhabarov
Copy link
Copy Markdown
Contributor Author

@tatiana updated PR

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Mar 3, 2025
@tatiana
Copy link
Copy Markdown
Collaborator

tatiana commented Mar 3, 2025

Thank you very much, @AlexandrKhabarov. We'll release this as part of Cosmos 1.9.1 this week.

@tatiana tatiana changed the title fix: missed condition in adding vars args Fix dbt project parsing dbt_vars behavior Mar 3, 2025
@tatiana tatiana merged commit 7016dd5 into astronomer:main Mar 3, 2025
pankajkoti pushed a commit that referenced this pull request Mar 13, 2025
`DbtToAirflowConverter` can pass dbt_vars to DbtGraph with the help of
ProjectConfig or operator_args. If operator_args is used in
`DbtToAirflowConverter` then it will lead to the issue with absence of
dbt_vars in dbt ls command (faced rendering issue during usage of cosmos
with project level variables)

(cherry picked from commit 7016dd5)
@pankajkoti pankajkoti mentioned this pull request Mar 13, 2025
@tatiana tatiana mentioned this pull request Mar 13, 2025
tatiana added a commit that referenced this pull request Mar 17, 2025
Bug Fixes

* Fix import error in dbt bigquery adapter mock for ``dbt-bigquery<1.8``
for ``ExecutionMode.AIRFLOW_ASYNC`` by @pankajkoti in #1548
* Fix ``operator_args`` override configuration by @ghjklw in #1558
* Fix missing ``install_dbt_deps`` in ``ProjectConfig`` ``__init__``
method by @ghjklw in #1556
* Fix dbt project parsing ``dbt_vars`` behavior passed via
``operator_args`` by @AlexandrKhabarov in #1543
* Avoid reading the connection during DAG parsing of the async BigQuery
operator by @joppevos in #1582
* Fix: Workaround to incorrectly raised ``gcsfs.retry.HttpError``
(Invalid Credentials, 401) by @tatiana in #1598
* Fix the async execution mode read sql files for dbt packages by
@pankajastro in #1588
* Improve BQ async error handling by @tatiana in #1597
* Fix path selector when ``manifest.json`` is created using MS Windows
by @tatiana in #1601
* Fix log that prints 'Total filtered nodes' by @tatiana in #1603
* Fix select behaviour using ``LoadMode.MANIFEST`` and a path with star
by @tatiana in #1602
* Support ``on_warning_callback`` with ``TestBehavior.BUILD`` and
``ExecutionMode.LOCAL`` by @corsettigyg in #1571
* Fix ``DbtRunLocalOperator.partial()`` support by @tatiana @ashb in
#1609
* fix: ``container_name`` is null for ecs integration by @nicor88 in
#1592

Docs

* Improve MWAA getting-started docs by removing unused imports by
@jx2lee in #1562

Others

* Disable ``example_cosmos_dbt_build.py`` DAG in CI by @pankajastro in
#1567
* Upgrade GitHub Actions Ubuntu version by @tatiana in #1561
* Update GitHub bug issue template by @pankajastro in #1586
* Enable DAG ``example_cosmos_dbt_build.py`` in CI by @pankajastro in
#1573
* Run async DAG in DAG without setup/teardown task by @pankajastro in
#1599
* Add test case that fully covers recent select issue by @tatiana in
#1604
* Add CI job to test multiple dbt versions for the async DAG by
@pankajkoti in #1535
* Improve unit tests speed from 89s to 14s by @tatiana in #1600
* Pre-commit updates: #1560, #1583, #1596


Closes: #1550

Mergeable version of
#1607

Co-authored-by: Pankaj Singh
<98807258+pankajastro@users.noreply.github.com>
Co-authored-by: Pankaj Koti <pankajkoti699@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:rendering Related to rendering, like Jinja, Airflow tasks, etc area:testing Related to testing, like unit tests, integration tests, etc lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants