Skip to content

fix: make DagRunAssetReference.start_date nullable to prevent 500 on cleared dag runs - #71361

Closed
waterWang wants to merge 0 commit into
apache:mainfrom
waterWang:main
Closed

waterWang wants to merge 0 commit into
apache:mainfrom
waterWang:main

Conversation

@waterWang

Copy link
Copy Markdown

Problem

GET /execution/asset-events/by-asset returns 500 Internal Server Error when any asset event has a created_dagrun whose start_date is NULL.

dag_run.start_date is nullable and is NULL after a clear (which resets state to queued and start_date to NULL). The Pydantic model DagRunAssetReference declares start_date as a required datetime, so serializing the response raises:

pydantic_core._pydantic_core.ValidationError: 1 validation error for AssetEventResponse
created_dagruns.0.start_date
  Input should be a valid datetime [type=datetime_type, input_value=None, input_type=NoneType]

Fix

Make start_date nullable in DagRunAssetReference:

start_date: datetime | None

Related issue

Closes #71360

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Asset events API returns 500 when a created DagRun has NULL start_date

2 participants