vatsrahul1001 opened a new pull request, #75009:
URL: https://github.com/apache/airflow/pull/75009

   ## What
   
   Asset-triggered timetables deserialized a missing `batch_asset_events` key 
as `True`, but the field is **opt-in** and defaults to `False` (added in 
#68517) — or to `True` only 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_events` 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:
   - `timetables/simple.py` — `AssetTriggeredTimetable`, 
`PartitionedAssetTimetable`
   - `timetables/assets.py` — `AssetOrTimeSchedule`
   
   A hardcoded `False` would 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?
   
   - [X] Yes — Claude Code (Opus 4.8)
   
   Generated-by: Claude Code (Opus 4.8) 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]

Reply via email to