Skip to content

API: Return asset events for Dag Runs without a start date - #71379

Open
rino0601 wants to merge 4 commits into
apache:mainfrom
rino0601:fix-asset-event-null-start-date
Open

API: Return asset events for Dag Runs without a start date#71379
rino0601 wants to merge 4 commits into
apache:mainfrom
rino0601:fix-asset-event-null-start-date

Conversation

@rino0601

Copy link
Copy Markdown
Contributor

Return asset events even when a created Dag Run has not started.

Asset-event responses serialize linked Dag Runs through API models that treated start_date as required, although queued and cleared Dag Runs may have a NULL value. Align the Core API and Execution API contracts with their generated UI, Task SDK, and AirflowCTL clients.

Add regression coverage for Core /assets/events, upstream asset events, the Execution API, and client response parsing.

closes: #71360

Tests:

  • breeze --python 3.10 --backend postgres run pytest airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_assets.py -q
  • breeze --python 3.10 --backend postgres run pytest airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_dag_run.py airflow-core/tests/unit/api_fastapi/execution_api/versions/head/test_asset_events.py -q
  • breeze run --python 3.10 --backend sqlite pytest task-sdk/tests/task_sdk/api/test_client.py -q
  • breeze --python 3.10 --backend sqlite run pytest airflow-ctl/tests/airflow_ctl/api/test_operations.py::TestAssetsOperations::test_create_event -q
  • prek run --from-ref main --stage pre-commit --skip generate-openapi-spec --skip generate-tasksdk-datamodels --skip generate-airflowctl-datamodels

Was generative AI tooling used to co-author this PR?
  • Yes — Codex (GPT-5)

Generated-by: Codex (GPT-5) following the guidelines


Drafted-by: Codex (GPT-5) (no human review before posting)

@rino0601

rino0601 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

Hello, maintainers. Thank you, as always, for the project.

I saw that PR #71361 had been created for the issue I reported, but it felt like something was missing. So I checked out the project myself and gave it a try, taking care to follow the generative AI contribution guidelines.

Reading English is easy for me, but writing it is not, so I got some help from AI.

The changes allow null for the problematic part, and I also found all the parts with the same meaning and made them allow null as well. I passed all the static checks in the Breeze environment.

I wondered whether this might conflict with the original intent, so I used git blame on the places containing start_date and compared them with the intent of the previous PRs. At least, I found no intention in those PRs to make it required. That is why I opened this PR.

I live in the Asia/Seoul (+09:00) time zone, and I can contribute to open source every day between 22:00 and 00:00 in my local time. If I missed anything or if you need any help, please feel free to let me know :D

@rino0601
rino0601 force-pushed the fix-asset-event-null-start-date branch from f96d916 to 3a08434 Compare August 10, 2026 15:21
@bbovenzi bbovenzi added this to the Airflow 3.3.2 milestone Aug 11, 2026
@bbovenzi bbovenzi added the backport-to-v3-3-test Backport to v3-3-test label Aug 11, 2026
Comment thread uv.lock
@github-actions

Copy link
Copy Markdown
Contributor

uv.lock on main just moved via commit 1e1dc10 and this PR currently conflicts.

Quickest fix:

git fetch upstream main && git rebase upstream/main
rm uv.lock && uv lock
git add uv.lock && git rebase --continue
git push --force-with-lease

Automated nudge — ignore if you're not ready to rebase. This comment is updated in place on future uv.lock bumps.

Asset events should remain available when their created Dag Run has not started yet.
The regression coverage needs to retain started and empty association responses while exercising unstarted Dag Runs.
The nullable asset-event response must be represented in the generated supervisor schema, and CI requires the current dependency metadata in the lockfile.
Asset events can now reference an unstarted Dag Run, so TypeScript clients must accept a missing start date.
@rino0601
rino0601 force-pushed the fix-asset-event-null-start-date branch from 3a08434 to da2be87 Compare August 13, 2026 13:51

@choo121600 choo121600 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks! :)

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

Labels

area:airflow-ctl area:API Airflow's REST/HTTP API area:task-sdk area:UI Related to UI/UX. For Frontend Developers. backport-to-airflow-ctl/v0-1-test backport-to-v3-3-test Backport to v3-3-test

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

3 participants