From 9ae78b6634d343b1769e7f8174daac427fd41851 Mon Sep 17 00:00:00 2001 From: Nick Schrock Date: Sat, 8 Jun 2024 06:19:54 -0400 Subject: [PATCH] asset check decorator --- .../decorators/asset_check_decorator.py | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/python_modules/dagster/dagster/_core/definitions/decorators/asset_check_decorator.py b/python_modules/dagster/dagster/_core/definitions/decorators/asset_check_decorator.py index 83b9dc5b05be8..8ef4065a0d053 100644 --- a/python_modules/dagster/dagster/_core/definitions/decorators/asset_check_decorator.py +++ b/python_modules/dagster/dagster/_core/definitions/decorators/asset_check_decorator.py @@ -324,6 +324,47 @@ def checks(): def inner(fn: MultiAssetCheckFunction) -> AssetChecksDefinition: op_name = name or fn.__name__ + # # upstream_asset_deps= {spec.asset_key for spec in specs} | {dep.asset_key for spec in specs for dep in spec.additional_deps or []}, + # upstream_asset_deps: List[AssetDep] = [] + # for check_spec in specs: + # upstream_asset_deps.extend(check_spec.additional_deps) + + # builder = DecoratorAssetsDefinitionBuilder( + # fn=fn, + # op_name=op_name, + # internal_deps={}, + # named_ins_by_asset_key={}, + # named_outs_by_asset_key={}, + # args=DecoratorAssetsDefinitionBuilderArgs( + # decorator_name="@multi_asset_check", + # name=None, + # description=description, + # required_resource_keys=required_resource_keys, + # config_schema=config_schema, + # retry_policy=retry_policy, + # specs=[], + # check_specs=specs, + # can_subset=can_subset, + # compute_kind=compute_kind, + # op_tags=op_tags, + # op_def_resource_defs=resource_defs, + # assets_def_resource_defs=resource_defs, + # upstream_asset_deps=upstream_asset_deps, + # # unsupported capabiltiies in asset checks + # partitions_def=None, + # code_version=None, + # backfill_policy=None, + # group_name=None, + # # non-sensical args in this context + # asset_deps={}, + # asset_in_map={}, + # asset_out_map={}, + # ), + # ) + + # builder = DecoratorAssetsDefinitionBuilder.from_specs() + # return builder.create_assets_checks_definition() + op_required_resource_keys = compute_required_resource_keys( required_resource_keys, resource_defs, fn=fn, decorator_name="@multi_asset_check" )