diff --git a/docs/content/concepts/assets/asset-checks.mdx b/docs/content/concepts/assets/asset-checks.mdx index 11d150d8401ba..c2c8c2649ad35 100644 --- a/docs/content/concepts/assets/asset-checks.mdx +++ b/docs/content/concepts/assets/asset-checks.mdx @@ -165,7 +165,13 @@ If you want to define many checks that are similar, you can use the factory patt ```python file=/concepts/assets/asset_checks/factory.py from typing import Any, Mapping, Sequence -from dagster import AssetCheckResult, Definitions, asset, asset_check +from dagster import ( + AssetCheckResult, + AssetChecksDefinition, + Definitions, + asset, + asset_check, +) @asset @@ -178,7 +184,9 @@ def items(): ... -def make_checks(check_blobs: Sequence[Mapping[str, str]]): +def make_checks( + check_blobs: Sequence[Mapping[str, str]] +) -> Sequence[AssetChecksDefinition]: checks = [] for check_blob in check_blobs: diff --git a/docs/sphinx/sections/api/apidocs/asset-checks.rst b/docs/sphinx/sections/api/apidocs/asset-checks.rst index 89cf39797ece7..f085927305e0c 100644 --- a/docs/sphinx/sections/api/apidocs/asset-checks.rst +++ b/docs/sphinx/sections/api/apidocs/asset-checks.rst @@ -21,4 +21,6 @@ Dagster allows you to define and execute checks on your software-defined assets. .. autofunction:: load_asset_checks_from_package_module -.. autofunction:: load_asset_checks_from_package_name \ No newline at end of file +.. autofunction:: load_asset_checks_from_package_name + +.. autoclass:: AssetChecksDefinition \ No newline at end of file diff --git a/examples/docs_snippets/docs_snippets/concepts/assets/asset_checks/factory.py b/examples/docs_snippets/docs_snippets/concepts/assets/asset_checks/factory.py index 4a0704d1b00d7..2d62f6e4074a5 100644 --- a/examples/docs_snippets/docs_snippets/concepts/assets/asset_checks/factory.py +++ b/examples/docs_snippets/docs_snippets/concepts/assets/asset_checks/factory.py @@ -1,6 +1,12 @@ from typing import Any, Mapping, Sequence -from dagster import AssetCheckResult, Definitions, asset, asset_check +from dagster import ( + AssetCheckResult, + AssetChecksDefinition, + Definitions, + asset, + asset_check, +) @asset @@ -13,7 +19,9 @@ def items(): ... -def make_checks(check_blobs: Sequence[Mapping[str, str]]): +def make_checks( + check_blobs: Sequence[Mapping[str, str]] +) -> Sequence[AssetChecksDefinition]: checks = [] for check_blob in check_blobs: diff --git a/python_modules/dagster/dagster/__init__.py b/python_modules/dagster/dagster/__init__.py index 29af3039ade86..c0d5dfd1d97ca 100644 --- a/python_modules/dagster/dagster/__init__.py +++ b/python_modules/dagster/dagster/__init__.py @@ -116,6 +116,7 @@ AssetCheckSeverity as AssetCheckSeverity, AssetCheckSpec as AssetCheckSpec, ) +from dagster._core.definitions.asset_checks import AssetChecksDefinition as AssetChecksDefinition from dagster._core.definitions.asset_dep import AssetDep as AssetDep from dagster._core.definitions.asset_in import AssetIn as AssetIn from dagster._core.definitions.asset_out import AssetOut as AssetOut