Skip to content

How to incrementally update an asset without using partitions #14733

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

You must be logged in to vote

Basically, you can handle this with a vanilla Dagster asset. You're responsible for writing the logic that finds out what records in the source table have changed and updates the relevant records in the target table.

You generally shouldn't use IO managers when using this pattern. The built-in IO managers assume that every time you materialize an asset, you're overwriting the full asset or a full partition of the asset.

from dagster import asset

@asset
def my_derived_table(context) -> None:
    added_records, deleted_records, updated_records = find_changed_records()

    transformed_added_records = transform_records(added_records)
    transformed_updated_records = transform_records(updat…

Replies: 1 comment 1 reply

Comment options

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

Answer selected by sryza
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
area: asset Related to Software-Defined Assets
2 participants