Copilot commented on code in PR #63443:
URL: https://github.com/apache/airflow/pull/63443#discussion_r3066489894
##########
airflow-core/src/airflow/models/serialized_dag.py:
##########
@@ -446,7 +446,20 @@ def _definitions_match(deadline_data: dict, existing:
DeadlineAlertModel) -> boo
if len(existing_deadline_uuids) != len(new_deadline_data):
return None
- existing_deadline_uuids_as_uuid = [UUID(uid) for uid in
existing_deadline_uuids]
+ # Guard against data shape changes introduced in the 3.1→3.2 migration.
+ # Deadline UUIDs were previously stored as plain strings but may
appear as dicts
+ # in migrated databases. We handle three cases:
+ # - str → parse directly as UUID
+ # - dict with "uuid" or "id" key → extract and parse the UUID string
+ # - any other dict (e.g. a legacy encoded alert) → cannot reuse,
return None
+ existing_deadline_uuids_as_uuid = []
+ for uid in existing_deadline_uuids:
Review Comment:
The function now explicitly supports `existing_deadline_uuids` entries being
dicts (e.g. with `"uuid"`/`"id"` keys), but the type annotation and docstring
for `_try_reuse_deadline_uuids` still describe this argument as a list of UUID
strings. Please update the signature/type hints (and the param docs) to reflect
the accepted shapes so static checking and future callers match the actual
behavior.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]