https://dagster.io/ logo
#ask-community
Title
# ask-community
a

Aaron T

03/20/2023, 4:30 AM
If I have 2 assets, one a daily partitioned asset (asset1), and the other a daily partitioned Time Window asset (asset2) with a start date of -1, and end date of 0, dependent on asset1. How would I get the return data from the 2 upstream partitions on asset1?
j

jamie

03/20/2023, 2:44 PM
Hey @Aaron T assuming you want to get the previous two days of data from asset1 as input to asset2, you can do something similar to this example but instead of
Copy code
partition_mapping=TimeWindowPartitionMapping(
                start_offset=-1, end_offset=-1
            ),
you could do
Copy code
partition_mapping=TimeWindowPartitionMapping(
                start_offset=-2, end_offset=-1 # start_offset is modified
            ),
to specify the previous 2 days of data
a

Aaron T

03/20/2023, 2:57 PM
What would the
events
input for
yesterday_event_stats
look like? How would I specify getting the different partitions data?
If I am returning a dataframe from the
events
asset
j

jamie

03/20/2023, 4:50 PM
it depends on the io manager you are using. If you are using the default io manager, i believe it will be a list of dataframes. If you are using something like the snowflake io manager it would be a single dataframe with all of the data
a

Aaron T

03/20/2023, 5:24 PM
Thanks @jamie! that clears it up. I am just having trouble organizing my partitions. Is there a such thing as
JobIn
like
AssetIn
? I setup my partition as a job because I wanted to view ops to track the progress of each partition. But now how would I add a
TimeWindowPartitionMapping
an analytics job? I could change my partition to an asset, but I don't need every op to be an asset, which is why I like the job partition.
2 Views