Skip to content

Add CI job to test multiple dbt versions for the async DAG#1535

Merged
pankajkoti merged 6 commits into
mainfrom
run-async-on-dbt-versions
Mar 13, 2025
Merged

Add CI job to test multiple dbt versions for the async DAG#1535
pankajkoti merged 6 commits into
mainfrom
run-async-on-dbt-versions

Conversation

@pankajkoti
Copy link
Copy Markdown
Contributor

@pankajkoti pankajkoti commented Feb 12, 2025

This PR introduces a new CI job named Run-Integration-Tests-DBT-Async to ensure compatibility of the async example DAG with multiple dbt versions. It achieves this by adding a third dimension to the pyproject.toml matrix, enabling the CI to run the DAG across a list of dbt versions.

Additionally, this PR includes a new test file: tests/test_async_example_dag.py. While we already have tests/test_example_dags.py, certain dbt versions have shown parsing issues with some example DAGs, which can cause CI failures unrelated to the async DAG. To prevent this, the new file is a modified copy that exclusively tests simple_async_dag, with other DAGs ignored via .airflowignore. This ensures that the CI job focuses on validating the async DAG without being affected by unrelated parsing errors.

closes: #1489

@netlify
Copy link
Copy Markdown

netlify Bot commented Feb 12, 2025

Deploy Preview for sunny-pastelito-5ecb04 canceled.

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

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Feb 12, 2025

Deploying astronomer-cosmos with  Cloudflare Pages  Cloudflare Pages

Latest commit: e0b60a1
Status: ✅  Deploy successful!
Preview URL: https://3c1c7322.astronomer-cosmos.pages.dev
Branch Preview URL: https://run-async-on-dbt-versions.astronomer-cosmos.pages.dev

View logs

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.36%. Comparing base (dd8b6c7) to head (0f00368).
Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1535   +/-   ##
=======================================
  Coverage   97.36%   97.36%           
=======================================
  Files          80       80           
  Lines        4934     4934           
=======================================
  Hits         4804     4804           
  Misses        130      130           

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

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pankajkoti pankajkoti force-pushed the run-async-on-dbt-versions branch from d4f4043 to 8d0ad67 Compare February 19, 2025 08:59
@pankajkoti pankajkoti force-pushed the run-async-on-dbt-versions branch from 8d0ad67 to 030541c Compare March 12, 2025 06:16
@pankajkoti pankajkoti force-pushed the run-async-on-dbt-versions branch from e2bc332 to 40be499 Compare March 12, 2025 10:52
@pankajkoti pankajkoti force-pushed the run-async-on-dbt-versions branch from 40be499 to fa12cc4 Compare March 12, 2025 10:59
@pankajkoti pankajkoti force-pushed the run-async-on-dbt-versions branch from fa12cc4 to 101488a Compare March 12, 2025 11:03
@pankajkoti pankajkoti force-pushed the run-async-on-dbt-versions branch from 101488a to 63863ae Compare March 12, 2025 11:21
Copy link
Copy Markdown
Collaborator

@tatiana tatiana left a comment

Choose a reason for hiding this comment

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

Hi @pankajkoti , I believe this is great, thank you very much!

I left some comments inline and, please, could you log a ticket to cover this part of the original ticket:
3. Validate that the monkeypatched behavior is consistent and functional across all versions.

So we can actually confirm that:

  • The setup task does not actually perform the queries in BigQuery
    Making sure the mock works as expected for the desired dbt versions?

Also, if you could log a ticket for us to add a compatibility document, explaining which versions of dbt/airflow/python are tested with Cosmos, it could be great.

Comment thread .github/workflows/test.yml Outdated
Comment thread .github/workflows/test.yml
Comment thread tests/test_async_example_dag.py
@pankajkoti pankajkoti marked this pull request as ready for review March 13, 2025 10:50
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. area:ci Related to CI, Github Actions, or other continuous integration tools area:testing Related to testing, like unit tests, integration tests, etc labels Mar 13, 2025
@pankajkoti
Copy link
Copy Markdown
Contributor Author

Hi @pankajkoti , I believe this is great, thank you very much!

I left some comments inline and, please, could you log a ticket to cover this part of the original ticket: 3. Validate that the monkeypatched behavior is consistent and functional across all versions.

So we can actually confirm that:

  • The setup task does not actually perform the queries in BigQuery
    Making sure the mock works as expected for the desired dbt versions?

Also, if you could log a ticket for us to add a compatibility document, explaining which versions of dbt/airflow/python are tested with Cosmos, it could be great.

Thanks. Created a couple of tickets:

  1. Add a CI test to validate that the mock behaves correctly during async execution #1605
  2. Extend compatibility information in Cosmos documentation #1606

@pankajkoti pankajkoti requested a review from tatiana March 13, 2025 10:52
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Mar 13, 2025
@tatiana tatiana added this to the Cosmos 1.9.1 milestone Mar 13, 2025
@pankajkoti pankajkoti force-pushed the run-async-on-dbt-versions branch from e0b60a1 to 9f1a85b Compare March 13, 2025 13:36
@pankajkoti pankajkoti merged commit 372d388 into main Mar 13, 2025
@pankajkoti pankajkoti deleted the run-async-on-dbt-versions branch March 13, 2025 13:36
pankajkoti added a commit that referenced this pull request Mar 13, 2025
This PR introduces a new CI job named `Run-Integration-Tests-DBT-Async`
to ensure compatibility of the async example DAG with multiple dbt
versions. It achieves this by adding a third dimension to the
`pyproject.toml` matrix, enabling the CI to run the DAG across a list of
dbt versions.

Additionally, this PR includes a new test file:
`tests/test_async_example_dag.py`. While we already have
`tests/test_example_dags.py`, certain dbt versions have shown parsing
issues with some example DAGs, which can cause CI failures unrelated to
the async DAG. To prevent this, the new file is a modified copy that
exclusively tests `simple_async_dag`, with other DAGs ignored via
`.airflowignore`. This ensures that the CI job focuses on validating the
async DAG without being affected by unrelated parsing errors.

closes: #1489
(cherry picked from commit 372d388)
@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:ci Related to CI, Github Actions, or other continuous integration tools area:testing Related to testing, like unit tests, integration tests, etc lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run async DAGs over multiple versions of dbt adapters to ensure monkeypatch works correctly

3 participants