Skip to content

Keep asset event endpoints working for older Task SDK clients - #72634

Closed
henry3260 wants to merge 1 commit into
apache:mainfrom
henry3260:fix-asset-event-dagrun-start-date-old-clients
Closed

henry3260 wants to merge 1 commit into
apache:mainfrom
henry3260:fix-asset-event-dagrun-start-date-old-clients

Conversation

@henry3260

Copy link
Copy Markdown
Member

Why

#71379 made DagRunAssetReference.start_date nullable so asset-event endpoints no longer 500 when a created Dag run is still queued. The change was never registered with the Execution API versioning layer, so the server sends "start_date": null to every client. All released Task SDKs (1.1.x through 1.3.x) still require start_date and use extra="forbid", so GET /asset-events/by-asset and /by-asset-alias fail client-side with a ValidationError whenever an event created a queued run.

What

  • Add run_after to DagRunAssetReference and register MakeCreatedDagRunStartDateNullable in the head version (2026-10-30). For older clients the converter fills a null start_date with run_after and strips run_after, mirroring the existing DagRun fallback in MakeDagRunStartDateNullable.
  • Regenerate task-sdk datamodels, the supervisor schema snapshot and ts-sdk types.
  • Tests: new versions/v2026_06_30/test_asset_events.py covers both endpoints for a queued and a started run (fails without the fix); head test now asserts run_after is present; task-sdk client test payload gains run_after.

related:#71379

Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Fable 5.1)

Since the Execution API started returning a null start_date for created
Dag runs that have not started yet, every released Task SDK fails to parse
asset event responses whenever a queued run is attached to an event. Their
generated model still requires start_date and rejects unknown fields, so a
mixed-version deployment breaks asset-driven tasks with a client-side
validation error that never shows up in API server logs.

The change was never registered with the versioning layer, so the server
kept sending the new shape to every client. Register it against the head
version and expose run_after on the created-run reference so older clients
receive a non-null start_date, the same fallback the DagRun model already
uses.
@henry3260

Copy link
Copy Markdown
Member Author

@kaxil Could you take a look when you have a chance Thanks!

@kaxil

kaxil commented Sep 10, 2026

Copy link
Copy Markdown
Member

Duplicate of #71862 ? @henry3260 Could you review that PR instead?

@henry3260

Copy link
Copy Markdown
Member Author

Duplicate of #71862 ? @henry3260 Could you review that PR instead?

Ah, you’re right looks like a duplicate of #71862. I’ll review that one instead and close this. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API area:task-sdk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants