Lee-W commented on code in PR #65367:
URL: https://github.com/apache/airflow/pull/65367#discussion_r3473063352
##########
airflow-core/tests/unit/models/test_trigger.py:
##########
@@ -234,6 +235,38 @@ def test_submit_event(mock_callback_handle_event, session,
create_task_instance)
mock_callback_handle_event.assert_called_once_with(event, session)
+@patch("airflow.models.trigger.AssetManager.register_asset_change")
+def test_submit_event_no_n_plus_one_for_assets(_, session):
+ """Ensure asset notifications do not trigger per-asset lazy-load
queries."""
+
+ def _create_trigger_with_assets(asset_count: int) -> int:
Review Comment:
Yep, making it a nested function gives us limited gain here.
--
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]