From 5fd25f01d6e325b29688c8d7919377b955779d44 Mon Sep 17 00:00:00 2001 From: gibsondan Date: Wed, 4 Sep 2024 12:54:13 -0500 Subject: [PATCH] add a test case that fails if you forget to filter asset check executions by asset key (#24216) Test Plan: BK ## Summary & Motivation ## How I Tested These Changes ## Changelog [New | Bug | Docs] > Replace this message with a changelog entry, or `NOCHANGELOG` --- .../storage_tests/utils/event_log_storage.py | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/python_modules/dagster/dagster_tests/storage_tests/utils/event_log_storage.py b/python_modules/dagster/dagster_tests/storage_tests/utils/event_log_storage.py index ea4712b24d17c..8a730d56706c6 100644 --- a/python_modules/dagster/dagster_tests/storage_tests/utils/event_log_storage.py +++ b/python_modules/dagster/dagster_tests/storage_tests/utils/event_log_storage.py @@ -5193,22 +5193,23 @@ def test_asset_checks( check_key_1 = AssetCheckKey(AssetKey(["my_asset"]), "my_check") check_key_2 = AssetCheckKey(AssetKey(["my_asset"]), "my_check_2") - storage.store_event( - EventLogEntry( - error_info=None, - user_message="", - level="debug", - run_id=run_id_1, - timestamp=time.time(), - dagster_event=DagsterEvent( - DagsterEventType.ASSET_CHECK_EVALUATION_PLANNED.value, - "nonce", - event_specific_data=AssetCheckEvaluationPlanned( - asset_key=AssetKey(["my_asset"]), check_name="my_check" + for asset_key in {AssetKey(["my_asset"]), AssetKey(["my_other_asset"])}: + storage.store_event( + EventLogEntry( + error_info=None, + user_message="", + level="debug", + run_id=run_id_1, + timestamp=time.time(), + dagster_event=DagsterEvent( + DagsterEventType.ASSET_CHECK_EVALUATION_PLANNED.value, + "nonce", + event_specific_data=AssetCheckEvaluationPlanned( + asset_key=asset_key, check_name="my_check" + ), ), - ), + ) ) - ) checks = storage.get_asset_check_execution_history(check_key_1, limit=10) assert len(checks) == 1