subhramit commented on code in PR #73403:
URL: https://github.com/apache/airflow/pull/73403#discussion_r4057044400


##########
airflow-core/tests/unit/api_fastapi/execution_api/versions/head/test_assets.py:
##########
@@ -108,3 +113,27 @@ def test_asset_uri_not_found(self, client):
                 "reason": "not_found",
             }
         }
+
+
[email protected]("reconfigure_async_db_engine")
+class TestGetAssetAsyncQueries:

Review Comment:
   Not needed for every migrated endpoint. 
   Added it here inspired by https://github.com/apache/airflow/pull/73407 only 
for the simpler routes that do direct `AsyncSession` reads in the handler 
itself, where an awaited-call assertion gives clear extra signal with little 
test noise. 
   
   For example, `GET /execution/assets/by-name`, `GET 
/execution/assets/by-uri`, `GET /execution/dag-runs/count`, and `GET 
/execution/variables/keys` map very directly to `await session.scalar(...)` / 
`await session.scalars(...)`, so mocking those calls is straightforward. 
   
   For  endpoints like previous-successful-dagrun, previous task instance, or 
breadcrumbs, where the existing DB-backed contract tests already cover behavior 
well and additional async-session mocking would IMO add a lot more coupling 
than value.



-- 
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]

Reply via email to