Skip to content

Fix CI main branch Airflow 2.6 tests#2268

Merged
tatiana merged 10 commits into
mainfrom
fix-red-main-branch
Jan 14, 2026
Merged

Fix CI main branch Airflow 2.6 tests#2268
tatiana merged 10 commits into
mainfrom
fix-red-main-branch

Conversation

@tatiana
Copy link
Copy Markdown
Collaborator

@tatiana tatiana commented 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

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
Copilot AI review requested due to automatic review settings January 14, 2026 15:29
@netlify
Copy link
Copy Markdown

netlify Bot commented Jan 14, 2026

Deploy Preview for astronomer-cosmos canceled.

Name Link
🔨 Latest commit 37b6f7c
🔍 Latest deploy log https://app.netlify.com/projects/astronomer-cosmos/deploys/6967c82b76ae0e00085ee54f

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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<3 when installing dependencies for Airflow 2.6

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/test/pre-install-airflow.sh Outdated
@tatiana tatiana changed the title Fix conflicting version of pyparsing with Airlflow 2.6 Fix conflicting version of pyparsing with Airflow 2.6 Jan 14, 2026
_________ 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
@tatiana tatiana changed the title Fix conflicting version of pyparsing with Airflow 2.6 Fix CI main branch Airflow 2.6 tests Jan 14, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.04%. Comparing base (d421d51) to head (37b6f7c).
⚠️ Report is 1 commits behind head on main.

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.
📢 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.

@tatiana tatiana merged commit dbaef2c into main Jan 14, 2026
90 checks passed
@tatiana tatiana deleted the fix-red-main-branch branch January 14, 2026 17:22
@tatiana tatiana mentioned this pull request Jan 14, 2026
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 tatiana added this to the Cosmos 1.12.1 milestone Jan 29, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants