This is an automated email from the ASF dual-hosted git repository.

hussein-awala pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new ae54b2be5ee Fix asset events test for Dag runs without start date 
(#71799)
ae54b2be5ee is described below

commit ae54b2be5ee4572a8336da6f0f419194ce294966
Author: Vincent <[email protected]>
AuthorDate: Tue Aug 18 17:52:11 2026 -0400

    Fix asset events test for Dag runs without start date (#71799)
    
    The /assets/events endpoint scopes returned events to the Dags the caller
    may read, resolving against DagModel. The test creates an event whose
    source Dag is never registered, so the scoping filter excludes it and the
    asset_events list comes back empty, tripping an IndexError. Register the
    source Dag as a real deployment would.
---
 .../tests/unit/api_fastapi/core_api/routes/public/test_assets.py         | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_assets.py 
b/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_assets.py
index 80fa977ee0b..d15a18d2d1f 100644
--- a/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_assets.py
+++ b/airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_assets.py
@@ -1041,6 +1041,7 @@ class TestGetAssetEvents(TestAssets):
 
     def test_should_return_created_dag_run_without_start_date(self, 
test_client, session):
         self.create_assets(num=1, session=session)
+        _ensure_dags(session, "producer_dag")
         asset_event = AssetEvent(
             asset_id=1,
             source_dag_id="producer_dag",

Reply via email to