Skip to content

Commit a3b7856

Browse files
[v3-1-test] Fix migration errors for Pydantic 2.12.0 (#56579) (#56581)
Pydantic 2.12.0 implemented experimental Sentinel that requires newer version of typing extensions. Our migration scripts however downgrade airflow to 2.11.0 and since airflow 2.11 does not have pydantic specified as required dependency, it does not downgrade it - but it downgrades typing-extensions that are airflow dependency. This causes a mismatch between expected version of typing extensions by Pydantic (4.14.1) and the one that we have installed in airflow 2.11 (4.13.1). However - in fact - pydantic is a dependency of Airflow 2.11 - becuase serialization uses pydantic serializer in 2.11 and it fails being imported if typing extensions is too low. This is only a problem when downgrading to Airflow 2.11 with constraints when you do not specify pydantic as extra. This should be fixed in 2.11.1 as there constraints should include latest version of typing-extension and pydantic. For now - the fix is to add pydantic as extra when downgrading airflow to 2.11.0 (cherry picked from commit dfb24d7) Co-authored-by: Jarek Potiuk <[email protected]>
1 parent 994f142 commit a3b7856

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/actions/migration_tests/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ runs:
2828
- name: "Test migration file 2 to 3 migration: ${{env.BACKEND}}"
2929
shell: bash
3030
run: |
31-
breeze shell "${AIRFLOW_2_CMD}" --use-airflow-version 2.11.0 --answer y &&
31+
breeze shell "${AIRFLOW_2_CMD}" --use-airflow-version 2.11.0 --airflow-extras pydantic --answer y &&
3232
breeze shell "export AIRFLOW__DATABASE__EXTERNAL_DB_MANAGERS=${DB_MANGERS}
3333
${AIRFLOW_3_CMD}" --no-db-cleanup
3434
env:
@@ -57,7 +57,7 @@ runs:
5757
- name: "Test ORM migration 2 to 3: ${{env.BACKEND}}"
5858
shell: bash
5959
run: >
60-
breeze shell "${AIRFLOW_2_CMD}" --use-airflow-version 2.11.0 --answer y &&
60+
breeze shell "${AIRFLOW_2_CMD}" --use-airflow-version 2.11.0 --airflow-extras pydantic --answer y &&
6161
breeze shell "export AIRFLOW__DATABASE__EXTERNAL_DB_MANAGERS=${DB_MANGERS}
6262
${AIRFLOW_3_CMD}" --no-db-cleanup
6363
env:

0 commit comments

Comments
 (0)