fix(mwaa): match real MWAA's Airflow/Python pairing for the emulated image tag (#3445)

Real Amazon MWAA runs every Airflow version through 2.10.x on Python 3.11,
and only 2.11.0 onward (and every 3.x release) on Python 3.12. Floci
hardcoded apache/airflow:<version>-python3.12 for every supported version,
so a requirements.txt built the way AWS documents (a --constraint file
matching the real Airflow/Python pairing, e.g. constraints-3.11.txt for
2.9.x) resolves dependencies for the wrong Python minor version.

Fixes #3438
This commit is contained in:
Priamo Germosen authored and GitHub committed 2026-09-11 20:54:52 -05:00
1 parent 924e35cefe
commit 473a26aad9
4 files changed
+34 -4

No files matched your search

@@ -131,7 +131,21 @@ class MwaaEnvironmentManagerTest {
@Test
void airflowImageTagSubstitutesTheRequestedVersion() {
ContainerSpec spec = startAirflowAndCaptureSpec(false);
assertEquals("apache/airflow:2.10.5-python3.12", spec.image());
// Real Amazon MWAA runs 2.10.x on Python 3.11, not 3.12.
assertEquals("apache/airflow:2.10.5-python3.11", spec.image());
}
@Test
void pythonTagForMatchesRealMwaasAirflowPythonPairing() {
// Every version through 2.10.x runs Python 3.11 on real Amazon MWAA.
assertEquals("python3.11", MwaaEnvironmentManager.pythonTagFor("2.7.2"));
assertEquals("python3.11", MwaaEnvironmentManager.pythonTagFor("2.8.4"));
assertEquals("python3.11", MwaaEnvironmentManager.pythonTagFor("2.9.3"));
assertEquals("python3.11", MwaaEnvironmentManager.pythonTagFor("2.10.5"));
// 2.11.0 onward, and every 3.x release, runs Python 3.12.
assertEquals("python3.12", MwaaEnvironmentManager.pythonTagFor("2.11.0"));
assertEquals("python3.12", MwaaEnvironmentManager.pythonTagFor("2.11.2"));
assertEquals("python3.12", MwaaEnvironmentManager.pythonTagFor("3.0.6"));
}
@Test