diff --git a/python_modules/dagster/dagster/_core/definitions/asset_check_evaluation.py b/python_modules/dagster/dagster/_core/definitions/asset_check_evaluation.py index f3c7cd8f89a27..5df50ad9d453d 100644 --- a/python_modules/dagster/dagster/_core/definitions/asset_check_evaluation.py +++ b/python_modules/dagster/dagster/_core/definitions/asset_check_evaluation.py @@ -25,6 +25,10 @@ def __new__(cls, asset_key: AssetKey, check_name: str): check_name=check.str_param(check_name, "check_name"), ) + @property + def asset_check_handle(self) -> AssetCheckHandle: + return AssetCheckHandle(self.asset_key, self.check_name) + @whitelist_for_serdes class AssetCheckEvaluationTargetMaterializationData( diff --git a/python_modules/dagster/dagster/_core/events/__init__.py b/python_modules/dagster/dagster/_core/events/__init__.py index a16c724022b8c..30a98885eabfd 100644 --- a/python_modules/dagster/dagster/_core/events/__init__.py +++ b/python_modules/dagster/dagster/_core/events/__init__.py @@ -741,6 +741,15 @@ def asset_materialization_planned_data(self) -> "AssetMaterializationPlannedData ) return cast(AssetMaterializationPlannedData, self.event_specific_data) + @property + def asset_check_planned_data(self) -> "AssetCheckEvaluationPlanned": + _assert_type( + "asset_check_planned", + DagsterEventType.ASSET_CHECK_EVALUATION_PLANNED, + self.event_type, + ) + return cast(AssetCheckEvaluationPlanned, self.event_specific_data) + @property def step_expectation_result_data(self) -> "StepExpectationResultData": _assert_type( @@ -757,6 +766,13 @@ def materialization(self) -> AssetMaterialization: ) return cast(StepMaterializationData, self.event_specific_data).materialization + @property + def asset_check_evaluation_data(self) -> AssetCheckEvaluation: + _assert_type( + "asset_check_evaluation", DagsterEventType.ASSET_CHECK_EVALUATION, self.event_type + ) + return cast(AssetCheckEvaluation, self.event_specific_data) + @property def job_failure_data(self) -> "JobFailureData": _assert_type("job_failure_data", DagsterEventType.RUN_FAILURE, self.event_type)