Repository navigation
Default batch_asset_events to the constructed value when absent from serialized data - #75009
vatsrahul1001 wants to merge 1 commit into
Conversation
f20ebcc to
170dc0c
Compare
…serialized data Asset-triggered timetables deserialized a missing batch_asset_events key as True, but the field is opt-in and defaults to False (or to True only when the asset condition requires batching). Blobs that predate the field -- and the window on upgrade before the dag-processor re-parses a DAG -- therefore came back batching queued asset events into a single run instead of one run per event. Pass batch_asset_events to the timetable only when the key is present, so a missing key falls back to the same attrs factory default the constructor uses: False for a plain condition, True for AND/partition conditions that require batching. Applied at all three deserialize sites (AssetTriggeredTimetable, PartitionedAssetTimetable, AssetOrTimeSchedule). Closes: #75007
170dc0c to
8c6d303
Compare
|
Closing — this is not a bug. The absent-key |
What
Asset-triggered timetables deserialized a missing
batch_asset_eventskey asTrue, but the field is opt-in and defaults toFalse(added in #68517) — or toTrueonly when the asset condition requires batching. Any serialized DAG whose blob lacks the key (every DAG serialized before 3.4, and the window on upgrade before the dag-processor re-parses) therefore came back batching queued asset events into a single DAG run instead of one run per event.Fix: only pass
batch_asset_eventswhen the key is present, so a missing key falls back to the same attrs factory default the constructor uses —Falsefor a plain condition,Truefor AND/partition conditions that require batching. Applied at all three deserialize sites:timetables/simple.py—AssetTriggeredTimetable,PartitionedAssetTimetabletimetables/assets.py—AssetOrTimeScheduleA hardcoded
Falsewould be wrong because AND/partition timetables require batching; deferring to the factory keeps both cases correct.Added a regression test (
test_deserialize_without_batch_asset_events_key_uses_construct_default) covering plain (→False), AND (→True), and explicit-value round-trip.Closes: #75007
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 4.8) following the guidelines