waterWang opened a new pull request, #71361:
URL: https://github.com/apache/airflow/pull/71361
### 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`:
```python
start_date: datetime | None
```
### Related issue
Closes #71360
--
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]