Skip to content

Commit

Permalink
export AssetChecksDefinition (#17678)
Browse files Browse the repository at this point in the history
add to api docs etc.
  • Loading branch information
johannkm authored Nov 3, 2023
1 parent f837660 commit b6d44e1
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
12 changes: 10 additions & 2 deletions docs/content/concepts/assets/asset-checks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:

Expand Down
4 changes: 3 additions & 1 deletion docs/sphinx/sections/api/apidocs/asset-checks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
.. autofunction:: load_asset_checks_from_package_name

.. autoclass:: AssetChecksDefinition
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:

Expand Down
1 change: 1 addition & 0 deletions python_modules/dagster/dagster/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

1 comment on commit b6d44e1

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for dagster-docs ready!

✅ Preview
https://dagster-docs-5urp4cz95-elementl.vercel.app
https://master.dagster.dagster-docs.io

Built with commit b6d44e1.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.