Is there a way to end a graph early if a step prod...
# ask-community
Is there a way to end a graph early if a step produces no data (and do a dynamic map otherwise)?
y you can conditionally skip downstream when the upstream output is set as optional and you don’t yield it
I don't think this does what I want. If I do that, the runs succeed, but the asset does not actual show as materialized for that partition (and so things like select missing partitions redo a lot of computation for nothing). Toy example:
Copy code
from dagster import HourlyPartitionsDefinition, op, asset, graph_asset, DynamicOut, DynamicOutput, Definitions, OpExecutionContext

@op(out=DynamicOut(int, is_required=False))
def splay(context: OpExecutionContext):
    if not '22' in context.partition_key:
        yield DynamicOutput(1, mapping_key='1')
def op2(o1):
    return o1+1

def g1():
    s = splay()
    a =
    return a

defs = Definitions(
Picture in dagit overall and for the 2200 run below