Fix CI main branch Airflow 2.6 tests#2268
Merged
Merged
Conversation
As observed while testing Python 3.10, AF 2.6 and dbt 1.11:
```
=========================== short test summary info ============================
ERROR tests/operators/_asynchronous/test_base.py - AttributeError: module 'pyparsing' has no attribute 'DelimitedList'. Did you mean: 'delimitedList'?
ERROR tests/operators/_asynchronous/test_bigquery.py - AttributeError: module 'pyparsing' has no attribute 'DelimitedList'. Did you mean: 'delimitedList'?
ERROR tests/test_example_dags_no_connections.py - AssertionError: assert not {'/home/runner/work/astronomer-cosmos/astronomer-cosmos/dev/dags/simple_dag_async.py': 'Traceback (most recent call la...s.operators._asynchronous.bigquery.DbtRunAirflowAsyncBigqueryOperator. Unable to find the specified operator class.\n'}
+ where {'/home/runner/work/astronomer-cosmos/astronomer-cosmos/dev/dags/simple_dag_async.py': 'Traceback (most recent call la...s.operators._asynchronous.bigquery.DbtRunAirflowAsyncBigqueryOperator. Unable to find the specified operator class.\n'} = <airflow.models.dagbag.DagBag object at 0x7ffa7ee04910>.import_errors
```
https://github.com/astronomer/astronomer-cosmos/actions/runs/20999444973/job/60365156803
✅ Deploy Preview for astronomer-cosmos canceled.
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a compatibility issue between Airflow 2.6 and the pyparsing library by constraining the pyparsing version to less than 3.0. The issue was causing test failures due to API changes in pyparsing 3.x where DelimitedList was renamed to delimitedList.
Changes:
- Added a version constraint for
pyparsing<3when installing dependencies for Airflow 2.6
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
_________ ERROR collecting tests/operators/_asynchronous/test_base.py __________
tests/operators/_asynchronous/test_base.py:14: in <module>
from cosmos.operators._asynchronous.bigquery import DbtRunAirflowAsyncBigqueryOperator
cosmos/operators/_asynchronous/bigquery.py:13: in <module>
from airflow.providers.google.cloud.operators.bigquery import BigQueryInsertJobOperator
../../../.local/share/hatch/env/virtual/astronomer-cosmos/Za_bFbg4/tests.py3.10-2.6-1.10/lib/python3.10/site-packages/airflow/providers/google/cloud/operators/bigquery.py:44: in <module>
from airflow.providers.google.cloud.hooks.bigquery import BigQueryHook, BigQueryJob
../../../.local/share/hatch/env/virtual/astronomer-cosmos/Za_bFbg4/tests.py3.10-2.6-1.10/lib/python3.10/site-packages/airflow/providers/google/cloud/hooks/bigquery.py:49: in <module>
from googleapiclient.discovery import Resource, build
../../../.local/share/hatch/env/virtual/astronomer-cosmos/Za_bFbg4/tests.py3.10-2.6-1.10/lib/python3.10/site-packages/googleapiclient/discovery.py:48: in <module>
import httplib2
../../../.local/share/hatch/env/virtual/astronomer-cosmos/Za_bFbg4/tests.py3.10-2.6-1.10/lib/python3.10/site-packages/httplib2/__init__.py:51: in <module>
from . import auth
../../../.local/share/hatch/env/virtual/astronomer-cosmos/Za_bFbg4/tests.py3.10-2.6-1.10/lib/python3.10/site-packages/httplib2/auth.py:14: in <module>
token = pp.Word(tchar).set_name("token")
E AttributeError: '_WordRegex' object has no attribute 'set_name'. Did you mean: 'setName'?
_______ ERROR collecting tests/operators/_asynchronous/test_bigquery.py ________
tests/operators/_asynchronous/test_bigquery.py:8: in <module>
from airflow.providers.google.cloud.operators.bigquery import BigQueryInsertJobOperator
../../../.local/share/hatch/env/virtual/astronomer-cosmos/Za_bFbg4/tests.py3.10-2.6-1.10/lib/python3.10/site-packages/airflow/providers/google/cloud/operators/bigquery.py:44: in <module>
from airflow.providers.google.cloud.hooks.bigquery import BigQueryHook, BigQueryJob
../../../.local/share/hatch/env/virtual/astronomer-cosmos/Za_bFbg4/tests.py3.10-2.6-1.10/lib/python3.10/site-packages/airflow/providers/google/cloud/hooks/bigquery.py:49: in <module>
from googleapiclient.discovery import Resource, build
../../../.local/share/hatch/env/virtual/astronomer-cosmos/Za_bFbg4/tests.py3.10-2.6-1.10/lib/python3.10/site-packages/googleapiclient/discovery.py:48: in <module>
import httplib2
../../../.local/share/hatch/env/virtual/astronomer-cosmos/Za_bFbg4/tests.py3.10-2.6-1.10/lib/python3.10/site-packages/httplib2/__init__.py:51: in <module>
from . import auth
../../../.local/share/hatch/env/virtual/astronomer-cosmos/Za_bFbg4/tests.py3.10-2.6-1.10/lib/python3.10/site-packages/httplib2/auth.py:14: in <module>
token = pp.Word(tchar).set_name("token")
E AttributeError: '_WordRegex' object has no attribute 'set_name'. Did you mean: 'setName'?
=========================== short test summary info ============================
ERROR tests/operators/_asynchronous/test_base.py - AttributeError: '_WordRegex' object has no attribute 'set_name'. Did you mean: 'setName'?
ERROR tests/operators/_asynchronous/test_bigquery.py - AttributeError: '_WordRegex' object has no attribute 'set_name'. Did you mean: 'setName'?
!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!
=========================== short test summary info ============================ ERROR tests/operators/_asynchronous/test_base.py - AttributeError: '_WordRegex' object has no attribute 'set_name'. Did you mean: 'setName'? ERROR tests/operators/_asynchronous/test_bigquery.py - AttributeError: '_WordRegex' object has no attribute 'set_name'. Did you mean: 'setName'? https://github.com/astronomer/astronomer-cosmos/actions/runs/20999907169/job/60367080762
kaxil
approved these changes
Jan 14, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2268 +/- ##
=======================================
Coverage 98.04% 98.04%
=======================================
Files 100 100
Lines 6401 6401
=======================================
Hits 6276 6276
Misses 125 125 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Merged
tatiana
added a commit
that referenced
this pull request
Jan 14, 2026
Cosmos main branch Python 2.6 tests started failing, as observed while
testing Python 3.10, AF 2.6 and dbt 1.11:
```
=========================== short test summary info ============================
ERROR tests/operators/_asynchronous/test_base.py - AttributeError: module 'pyparsing' has no attribute 'DelimitedList'. Did you mean: 'delimitedList'?
ERROR tests/operators/_asynchronous/test_bigquery.py - AttributeError: module 'pyparsing' has no attribute 'DelimitedList'. Did you mean: 'delimitedList'?
ERROR tests/test_example_dags_no_connections.py - AssertionError: assert not {'/home/runner/work/astronomer-cosmos/astronomer-cosmos/dev/dags/simple_dag_async.py': 'Traceback (most recent call la...s.operators._asynchronous.bigquery.DbtRunAirflowAsyncBigqueryOperator. Unable to find the specified operator class.\n'}
+ where {'/home/runner/work/astronomer-cosmos/astronomer-cosmos/dev/dags/simple_dag_async.py': 'Traceback (most recent call la...s.operators._asynchronous.bigquery.DbtRunAirflowAsyncBigqueryOperator. Unable to find the specified operator class.\n'} = <airflow.models.dagbag.DagBag object at 0x7ffa7ee04910>.import_errors
```
https://github.com/astronomer/astronomer-cosmos/actions/runs/20999444973/job/60365156803
The issue seemed to be conflicting dependencies, particularly the
installation of "httplib2==0.30.0" (failure) instead of
"httplib2==0.31.0" (success)
Example of success after this change:
https://github.com/astronomer/astronomer-cosmos/actions/runs/21002268536/job/60375248518
(cherry picked from commit dbaef2c)
tatiana
added a commit
that referenced
this pull request
Jan 14, 2026
Bug Fixes * Fix ``DbtSourceWatcherOperator.template_fields`` to inherit from ``DbtSourceLocalOperator`` instead of ``DbtConsumerWatcherSensor`` by @pankajkoti in #2226 * Fix TypeError in Watcher mode with subprocess invocation by @pankajkoti in #2227 * Error when RenderConfig.invocation_mode is incorrectly set by @tatiana in #2267 Docs * Fix minor documentation typo by @dnskr in #2093 * Fix default values in documentation by @dnskr in #2092 * Remove emit event for ExecutionMode.AIRFLOW_ASYNC limitation in docs by @pankajastro in #2214 Others * Add test to check profile metrics with non-Cosmos operator by @pankajastro in #2215 * Fix CI main branch Airflow 2.6 tests by @tatiana in #2268 closes: astronomer/oss-integrations-private#295 Co-authored-by: Tatiana Al-Chueyr <tatiana.alchueyr@gmail.com>
tatiana
added a commit
that referenced
this pull request
Feb 11, 2026
**Context** Over the past few months, we have experienced recurring CI failures caused by dependency conflicts. These issues are not triggered by changes in Cosmos itself, but rather by unpinned and dynamically resolved dependencies. These conflicts have been disruptive, time-consuming to debug, and difficult to reproduce locally. Some recent examples: - #2268 - #2172 - #2076 - #1987 - #1909 - #1902 **Current Situation** We have tried several approaches to mitigate dependency issues: - Dynamically resolving dependencies while restricting requirements as little as possible - Handling Airflow version–specific dependencies individually - Sometimes relying on Airflow constraints (which do not include provider versions), sometimes not - Attempting to isolate dependencies in `pre-install-airflow.sh` More recently, however, Airflow began being reinstalled via `integration-setup.sh`, leading to overlapping installations and Python virtual environments with conflicting packages. Additionally, if we try to recreate the environment locally using the exact dependency list printed by the CI at the end of the “Install packages and dependencies” step, the environment cannot be created due to dependencies conflicts. This results in: - Non-deterministic Python package installation - CI failures that are difficult (or impossible) to reproduce locally - Significant frustration and lost engineering time **Proposed Approach** This PR proposes pinning dependencies more strictly to make our CI environments deterministic and reproducible. I do not believe this is a perfect solution. Some trade-offs include: - We will no longer automatically test against newly released dependency versions - Pinned versions may require manual updates, including potential security updates This PR also does not introduce pip constraints files (since we currently rely on pip install -r). However, it can be viewed as a step toward the approach discussed in: #967 I discussed this proposal with @pankajastro and @pankajkoti, and we agreed it is worth trying. If this strategy does not work well in practice, we can revert to the current approach. **Known Side Effects** The changes in this PR introduce a few limitations: - Tests no longer run the cross-project example DAG (dbt Loom) using the LoadMode.DBT_LS approach, as dbt Loom is now installed in a separate virtual environment due to dependency conflicts. - The S3 load manifest task is no longer executed in the corresponding DAG for Airflow 2.9, due to conflicts between aiobotocore and other dependencies.
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.
Cosmos main branch Python 2.6 tests started failing, as observed while testing Python 3.10, AF 2.6 and dbt 1.11:
https://github.com/astronomer/astronomer-cosmos/actions/runs/20999444973/job/60365156803
The issue seemed to be conflicting dependencies, particularly the installation of "httplib2==0.30.0" (failure) instead of "httplib2==0.31.0" (success)
Example of success after this change:
https://github.com/astronomer/astronomer-cosmos/actions/runs/21002268536/job/60375248518