From 5299f248e06b55a0f245e70029b2ba3a94f54fe6 Mon Sep 17 00:00:00 2001 From: Johann Miller Date: Fri, 3 Nov 2023 09:01:54 -0400 Subject: [PATCH] export AssetChecksDefinition --- docs/sphinx/sections/api/apidocs/asset-checks.rst | 4 +++- .../concepts/assets/asset_checks/factory.py | 12 ++++++++++-- python_modules/dagster/dagster/__init__.py | 1 + 3 files changed, 14 insertions(+), 3 deletions(-) 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