Pebble32 opened a new pull request, #77616:
URL: https://github.com/apache/airflow/pull/77616
Any Dag scheduled with `airflow.sdk.EventsTimetable` fails to parse with
`SerializationError: Failed to serialize DAG '<dag_id>': '_summary'`. It has
been broken since 3.2.0.
Dag serialization turns the SDK timetable into the core one. The core
`EventsTimetable.deserialize` reads `data["_summary"]`, but the SDK encoder
never writes it.
The fix is in the core deserializer. When `_summary` is missing it keeps the
summary `__init__` already computed from the description, so it matches what a
core timetable gives ("N events", or the user's description). Payloads that
carry `_summary` keep the stored value.
I tested it with a one-shot dag processor in a fresh SQLite home. On main
both test Dags get the import error and nothing is stored. With the fix both
are stored with the right summary, description and next run.
I found the bug while testing the TS SDK. When I asked Claude to look for an
existing fix, it found #69401 by @anxkhn, which is nearly identical and was
closed as stale, so credit to @anxkhn for the fix. It also uses the
`contextlib.suppress` form uranusjr suggested there.
The test here goes through the real SDK encoder and core decoder, with and
without a description, with `restrict_to_events` and with no events.
Related: #76181 fixes the inverted `presorted` handling in the SDK
`EventsTimetable`, which only matters once these Dags serialize again.
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes, Claude Code
Generated-by: Claude Code following [the
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
--
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]