Vamsi-klu commented on PR #69401:
URL: https://github.com/apache/airflow/pull/69401#issuecomment-4912280789
Confirmed the root cause: the SDK serialize_timetable for EventsTimetable in
serialization/encoders.py emits only event_dates/restrict_to_events/description
and omits _summary (which #51203 made a field the core deserialize read
unconditionally), so a DAG using `from airflow.sdk import EventsTimetable`
serializes fine but KeyErrors on deserialize -> SerializationError.
data.get("_summary", timetable._summary) is safe because core __init__ always
sets self._summary (the description if given, else "{n} events"), and existing
core-serialized payloads that still carry _summary keep their stored value. The
parametrized test reproduces both branches and KeyErrors without the change.
One thing worth stating explicitly: the deserialize-side fix is the correct
location regardless of any encoder change, because serialized_dag rows already
written since #58669 lack _summary, so tolerating its absence on read is
required to recover them, whereas emitting _summary only from the SDK encoder
wou
ld leave already-persisted DAGs broken. FWIW the .get() form is functionally
identical to the contextlib.suppress(KeyError) suggestion in the thread. Minor:
the newsfragment is named 69283.bugfix.rst but #69283 is an unrelated merged
PR, presumably a placeholder to rename to the real number.
--
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]