Skip to content

Conversation

@tomasfarias
Copy link
Owner

@tomasfarias tomasfarias commented Oct 28, 2025

Closes: #166

Adds support for Airflow version 3.1 and later.

This new version of Airflow introduced a lot of changes to module import paths: Classes like DAG now come from airflow.sdk. Moreover, some XCOM methods have been removed from operator classes. They are now available only in the TaskInstance.

Moreover, and more painfully, our test suite broke with 3.1. This required a long and painful process to track which fixtures we need for things to work again.

Changes:

  • When possible, import from the compatibility module, which is offered by Airflow to work across multiple Airflow versions.
  • Update xcom_push method to use the TaskInstance in newer versions of Airflow.
  • Add new fixtures required for Airflow 3.1 testing.
  • Add Airflow 3.1 to testing pipeline.
  • Drop support for Python 3.9.

@tomasfarias tomasfarias force-pushed the fix/support-for-airflow-3.1 branch from a52c324 to c6b9dca Compare October 29, 2025 00:11
@tomasfarias tomasfarias force-pushed the fix/support-for-airflow-3.1 branch from dfb80b7 to ff59c96 Compare October 29, 2025 00:57
@tomasfarias tomasfarias force-pushed the fix/support-for-airflow-3.1 branch from 897d228 to a578b2f Compare October 29, 2025 16:19
@tomasfarias tomasfarias marked this pull request as ready for review October 29, 2025 16:40
@tomasfarias tomasfarias merged commit 9fd6bb6 into master Oct 29, 2025
22 checks passed
@tomasfarias tomasfarias deleted the fix/support-for-airflow-3.1 branch October 29, 2025 16:41
dependencies = [
"apache-airflow>=2.8",
"apache-airflow>=2.8,<4.0; python_version<'3.12'",
"apache-airflow>=3.0,<4.0; python_version>='3.12' and python_version<'3.13'",
Copy link
Contributor

Choose a reason for hiding this comment

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

@tomasfarias Hi! I'm a little confused by this change.
Is there any reason why you specified 3.0 as the minimum version for Python 3.12?
According to the Airflow changelog, support for Python 3.12 was added starting with version 2.9.0.

Copy link
Owner Author

Choose a reason for hiding this comment

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

I think I jumped ahead to the next version in our tests: We had 2.8, 3.0, and 3.1. So, I just jumped ahead to 3.0.

We could update the minimum version of Airflow to 2.9 for Python 3.12. It's not covered by our tests, but I think it should be relatively safe.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Owner Author

Choose a reason for hiding this comment

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

thanks, I'll try to get everything released soon. I've been travelling this week so releases are a bit delayed.

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.

[Bug] xcom_push failing with Airflow 3.1.0

3 participants