Skip to content

How to: trigger materializing an asset's partition upon upstream asset partition materialization #7306

Answered by clairelin135
clairelin135 asked this question in Q&A
Discussion options

You must be logged in to vote

One possible way to do this is to define a sensor that checks for the existence of materializations for the upstream asset partitions:

from typing import Dict, Set

from dagster import (
    AssetGroup,
    AssetKey,
    AssetMaterialization,
    DagsterEventType,
    DailyPartitionsDefinition,
    EventRecordsFilter,
    Output,
    RunRequest,
    asset,
    job,
    op,
    repository,
    sensor,
)

daily_partitions_def = DailyPartitionsDefinition(start_date="2020-01-01")

@asset(partitions_def=daily_partitions_def)
def table_a(context):
    return 1

@asset(partitions_def=daily_partitions_def)
def table_b(context):
    return 1

@asset(partitions_def=daily_partitions_def)
def table_c…

Replies: 1 comment 11 replies

Comment options

You must be logged in to vote
11 replies
@clairelin135
Comment options

@simonvanderveldt
Comment options

@geoHeil
Comment options

@clairelin135
Comment options

@simonvanderveldt
Comment options

Answer selected by clairelin135
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants