Conversation
✅ Deploy Preview for sunny-pastelito-5ecb04 canceled.
|
apache-airflow==3.1.0b2 depends on Python>=3.10,<3.14
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1980 +/- ##
==========================================
- Coverage 97.81% 97.71% -0.11%
==========================================
Files 89 89
Lines 5623 5681 +58
==========================================
+ Hits 5500 5551 +51
- Misses 123 130 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
FAILED tests/operators/test_virtualenv.py::test_integration_virtualenv_operator - AttributeError: 'NoneType' object has no attribute 'state'
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for Apache Airflow 3.1 to Cosmos by addressing breaking API changes and deprecated modules. The primary changes involve adapting to new import paths for BaseHook, ObjectStoragePath, TaskGroup, and handling test framework changes for TaskInstance initialization.
Key changes:
- Updated import paths for modules relocated in Airflow 3.1 (BaseHook, ObjectStoragePath, TaskGroup)
- Fixed test compatibility by adapting to new TaskInstance signature requirements
- Updated CI/CD configurations to include Airflow 3.1 in the test matrix
Reviewed Changes
Copilot reviewed 76 out of 76 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| cosmos/profiles/base.py | Added fallback imports for BaseHook moved to airflow.sdk.bases.hook |
| cosmos/config.py | Updated ObjectStoragePath imports to support airflow.sdk location |
| cosmos/operators/local.py | Consolidated ObjectStoragePath imports and replaced self.log with logger |
| cosmos/operators/watcher.py | Updated logging patterns and template_fields configurations |
| tests/* (multiple files) | Updated mock patch paths from airflow.hooks.base to cosmos.profiles.base |
| tests/operators/test_*.py | Added conditional TaskInstance initialization for Airflow 3.1 compatibility |
| pyproject.toml | Added Airflow 3.1 to test matrix |
| .github/workflows/test.yml | Updated CI to test Airflow 3.1 |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
pankajkoti
left a comment
There was a problem hiding this comment.
Great persistence! 👏🏽
Co-authored-by: Pankaj Koti <pankajkoti699@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Apache Airflow 3.1 beta2 was released on 15 September 2025. We have been working on supporting Airflow 3.1 since its initial release on September 25, 2025.
These were some of the issues we faced while attempting to support Airflow 3.1, seen on the tests run in:
https://github.com/astronomer/astronomer-cosmos/actions/runs/17766456237/job/50490975762
Example of unittests that fail when running:
Errors:
I created a follow-up ticket for the last three tests that I didn't fix in Airflow 3.1:
#2045
Closes: https://github.com/astronomer/oss-integrations-private/issues/209