Skip to content
Discussion options

You must be logged in to vote

Yeah, the event-log route from #14723 is the right instinct, it just isn't partition-aware. get_input_asset_record hands you the latest observation for the whole key. For a partitioned source you want to filter down to the current partition, which fetch_observations does:

from dagster import asset, AssetRecordsFilter

@dg.asset(partitions_def=codes, deps=[code_partitions])
def downstream(context):
    pk = context.partition_key

    records = context.instance.fetch_observations(
        AssetRecordsFilter(asset_key=code_partitions.key, asset_partitions=[pk]),
        limit=1,  # defaults to newest-first
    ).records

    commit = records[0].event_log_entry.tags.get("dagster/data_version")…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@AbhinavPraveen
Comment options

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