Terry Lines
02/14/2024, 7:19 PMScout
02/14/2024, 7:19 PMpython from dagster import asset, DailyPartitionsDefinition # This is the non-partitioned upstream asset @asset def non_partitioned_upstream_asset(): # ... logic for non-partitioned asset ... pass # This is the partitioned downstream asset @asset(partitions_def=DailyPartitionsDefinition(start_date="2023-01-01")) def partitioned_downstream_asset(non_partitioned_upstream_asset): # ... logic that depends on the non-partitioned asset ... pass
In this example, partitioned_downstream_asset
is a partitioned asset with daily partitions starting from January 1, 2023. It depends on the non_partitioned_upstream_asset
, which is not partitioned. Dagster will infer that each partition of partitioned_downstream_asset
depends on the non_partitioned_upstream_asset
. This setup allows you to define dependencies between partitioned and non-partitioned assets without the need for additional configuration or partition mappings.