Skip to content

Commit

Permalink
Deprecate ExpectationResult (#16645)
Browse files Browse the repository at this point in the history
## Summary & Motivation

With real asset checks coming we can deprecate this old, useless class.

## How I Tested These Changes

BK
  • Loading branch information
schrockn authored Sep 20, 2023
1 parent 34acd9c commit 8c7e644
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
6 changes: 5 additions & 1 deletion python_modules/dagster/dagster/_core/definitions/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import dagster._check as check
import dagster._seven as seven
from dagster._annotations import PublicAttr, experimental_param, public
from dagster._annotations import PublicAttr, deprecated, experimental_param, public
from dagster._core.definitions.data_version import DataVersion
from dagster._core.storage.tags import MULTIDIMENSIONAL_PARTITION_PREFIX, SYSTEM_TAG_PREFIX
from dagster._serdes import whitelist_for_serdes
Expand Down Expand Up @@ -618,6 +618,10 @@ def file(
)


@deprecated(
breaking_version="1.7",
additional_warn_text="Please use AssetCheckResult and @asset_check instead.",
)
@whitelist_for_serdes(
storage_field_names={"metadata": "metadata_entries"},
field_serializers={"metadata": MetadataFieldSerializer},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
GraphDefinition,
op,
)
from dagster._annotations import get_deprecated_info, is_deprecated
from dagster._core.events import DagsterEvent
from dagster._core.execution.execution_result import ExecutionResult

Expand Down Expand Up @@ -85,3 +86,11 @@ def return_expectation_failure(_context):
),
):
job_def.execute_in_process()


def test_expectation_result_deprecated() -> None:
assert is_deprecated(ExpectationResult)
assert (
get_deprecated_info(ExpectationResult).additional_warn_text
== "Please use AssetCheckResult and @asset_check instead."
)

0 comments on commit 8c7e644

Please sign in to comment.