Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Airflow 2.10 regression and Add Airflow 2.10 in test matrix #1162

Merged
merged 5 commits into from
Aug 20, 2024

Conversation

pankajastro
Copy link
Contributor

@pankajastro pankajastro commented Aug 16, 2024

We have a few classes that lack an __init__ method, and their parent class is BaseOperator. These classes are failing to load due to changes introduced in the PR: apache/airflow#41085.

I'm adding __init__ at missing places in this PR and also adding Airflow 2.10 in our test matrix

CI: https://github.com/astronomer/astronomer-cosmos/actions/runs/10469548488

closes: #1166
closes: #1165

Copy link

netlify bot commented Aug 16, 2024

Deploy Preview for sunny-pastelito-5ecb04 canceled.

Name Link
🔨 Latest commit ad87979
🔍 Latest deploy log https://app.netlify.com/sites/sunny-pastelito-5ecb04/deploys/66c475bc4baf90000826d330

Copy link

codecov bot commented Aug 16, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 12 lines in your changes missing coverage. Please review.

Project coverage is 96.09%. Comparing base (4273d99) to head (2622b6d).

Files Patch % Lines
cosmos/operators/aws_eks.py 81.25% 3 Missing ⚠️
cosmos/operators/azure_container_instance.py 78.57% 3 Missing ⚠️
cosmos/operators/docker.py 78.57% 3 Missing ⚠️
cosmos/operators/kubernetes.py 78.57% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1162      +/-   ##
==========================================
- Coverage   96.35%   96.09%   -0.26%     
==========================================
  Files          64       64              
  Lines        3568     3638      +70     
==========================================
+ Hits         3438     3496      +58     
- Misses        130      142      +12     

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

Copy link
Collaborator

@dwreeves dwreeves left a comment

Choose a reason for hiding this comment

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

Can you check #1163 before merging? I think that #1163 has a fix that is a little simpler and more robust. (Note that my PR points to your branch, not main, so merging my PR merges to test-af-2.10. I based my PR off your PR especially with the changes to the CI + hatch env.) Let me know what you think.

(It also fixes an issue that's been annoying me for a while, which is that the Mixins needed lots of type: ignores. 😆)

pankajastro pushed a commit that referenced this pull request Aug 19, 2024
## Description

Fixes Airflow 2.10 regression / compat

## Related Issue(s)

This is a fix for #1161, and is designed to be a different proposal to
the changes in #1162.

Ultimately the issue that popped up in 2.10 relates to how the MRO was
impacted by the Mixin class.

The simplest, most robust fix to make the MRO work properly is to make
each mixin a subclass of `BaseOperator`. This doesn't require the
unintuitive hack of needing an `__init__()` call to shuffle the MRO
around, and it makes things more easily maintainable going forward, I
think.

A note: This PR is merging to `test-af-2.10`, not `main`.

Tested for 2.10.

I also removed an unnecessary `__init__` for the `DbtTestMixin` while I
was at it.

## Checklist

- [x] I have made corresponding changes to the documentation (if
required)
- [x] I have added tests that prove my fix is effective or that my
feature works
@dwreeves
Copy link
Collaborator

@pankajastro I force pushed away my change, sorry for wasting time! ☹️ Let's just prioritize getting this out ASAP.

@dwreeves dwreeves self-requested a review August 19, 2024 10:45
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 19, 2024
.github/workflows/test.yml Outdated Show resolved Hide resolved
@pankajkoti
Copy link
Contributor

Can we create a ticket for this in our repo/board for tracking the work done here and link it in the description?

@pankajkoti pankajkoti mentioned this pull request Aug 19, 2024
18 tasks
@pankajastro pankajastro changed the title [WIP] Add Airflow-2.10 in test matrix Fix Airflow 2.10 regression and Add Airflow 2.10 in test matrix Aug 20, 2024
@pankajastro pankajastro marked this pull request as ready for review August 20, 2024 10:11
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. execution:docker Related to Docker execution environment execution:kubernetes Related to Kubernetes execution environment execution:local Related to Local execution environment execution:virtualenv Related to Virtualenv execution environment labels Aug 20, 2024
Co-authored-by: Pankaj Koti <[email protected]>
@pankajastro pankajastro merged commit 9a7c1d0 into main Aug 20, 2024
29 of 30 checks passed
@pankajastro pankajastro deleted the test-af-2.10 branch August 20, 2024 10:54
@pankajastro pankajastro added this to the Cosmos 1.6.0 milestone Aug 20, 2024
@pankajkoti pankajkoti mentioned this pull request Aug 20, 2024
pankajkoti added a commit that referenced this pull request Aug 20, 2024
New Features

* Add support for loading manifest from cloud stores using Airflow
Object Storage by @pankajkoti in #1109
* Cache ``package-lock.yml`` file by @pankajastro in #1086
* Support persisting the ``LoadMode.VIRTUALENV`` directory by @tatiana
in #1079
* Add support to store and fetch ``dbt ls`` cache in remote stores by
@pankajkoti in #1147
* Add default source nodes rendering by @arojasb3 in #1107
* Add Teradata ``ProfileMapping`` by @sc250072 in #1077

Enhancements

* Add ``DatabricksOauthProfileMapping`` profile by @CorsettiS in #1091
* Use ``dbt ls`` as the default parser when ``profile_config`` is
provided by @pankajastro in #1101
* Add task owner to dbt operators by @wornjs in #1082
* Extend Cosmos custom selector to support + when using paths and tags
by @mvictoria in #1150
* Simplify logging by @dwreeves in #1108

Bug fixes

* Fix Teradata ``ProfileMapping`` target invalid issue by @sc250072 in
#1088
* Fix empty tag in case of custom parser by @pankajastro in #1100
* Fix ``dbt deps`` of ``LoadMode.DBT_LS`` should use
``ProjectConfig.dbt_vars`` by @tatiana in #1114
* Fix import handling by lazy loading hooks introduced in PR #1109 by
@dwreeves in #1132
* Fix Airflow 2.10 regression and add Airflow 2.10 in test matrix by
@pankajastro in #1162

Docs

* Fix typo in azure-container-instance docs by @pankajastro in #1106
* Use Airflow trademark as it has been registered by @pankajastro in
#1105

Others

* Run some example DAGs in Kubernetes execution mode in CI by
@pankajastro in #1127
* Install requirements.txt by default during dev env spin up by
@@CorsettiS in #1099
* Remove ``DbtGraph.current_version`` dead code by @tatiana in #1111
* Disable test for Airflow-2.5 and Python-3.11 combination in CI by
@pankajastro in #1124
* Pre-commit hook updates in #1074, #1113, #1125, #1144, #1154,  #1167

---------

Co-authored-by: Pankaj Koti <[email protected]>
Co-authored-by: Pankaj Singh <[email protected]>
@tatiana tatiana modified the milestones: Cosmos 1.6.0, Cosmos 1.7.0 Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
execution:docker Related to Docker execution environment execution:kubernetes Related to Kubernetes execution environment execution:local Related to Local execution environment execution:virtualenv Related to Virtualenv execution environment 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.

[CI] Run test for Airflow-2.10 Fix Airflow-2.10 and Cosmos compatibility issue
4 participants