Skip to content

How to set up a rolling window partition dependency between assets? #14636

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

You must be logged in to vote

You can accomplish this with the start_offset argument on TimeWindowPartitionMapping:

from dagster import AssetIn, DailyPartitionsDefinition, TimeWindowPartitionMapping, asset


@asset(partitions_def=DailyPartitionsDefinition(start_date="2020-01-01"))
def asset1():
    ...


@asset(
    partitions_def=DailyPartitionsDefinition(start_date="2020-01-01"),
    ins={"asset1": AssetIn(partition_mapping=TimeWindowPartitionMapping(start_offset=-2))},
)
def asset2(asset1):
    ...

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by sryza
Comment options

You must be logged in to vote
0 replies
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