I am wondering how I would trigger 1 RunRequest fo...
# ask-community
I am wondering how I would trigger 1 RunRequest for a MultiPartitioned asset running on a schedule built from that MultiPartition composed of a time window partition and a static partition definition. The code below triggers 3 run requests (1 for each static partition), and I'd only like to trigger 1 RunRequest for the date tick, with the partition_key_range returning the
start=a|start_date, end=c|end_date
. It doesn't look like there's native support, but I'd appreciate if anyone has done a quick workaround before. I'd like to keep the asset multi-partitioned so I can trigger backfills on specific static partitions, and I do not wish to trigger a job run for each partition because I'm running on Spark. Example code below:
Copy code
daily_multi_partitions_definition = MultiPartitionsDefinition(
        "static": StaticPartitionsDefinition(["a", "b", "c"]),
        "date": DailyPartitionsDefinition(start_date=TEST_DATE),

def daily_multi_partitions_asset(context: AssetExecutionContext) -> int:
    return 3

daily_multi_partitions_job = define_asset_job(

daily_multi_partitions_job_schedule = build_schedule_from_partitioned_job(
🤖 1
Hi Daniel, you can skip
and use the lower-level
Copy code
date_partitions = daily_multi_partitions_definition.partitions_defs[1]

def daily_multi_partitions_job_schedule(context):
    ... return desired run request
Thanks @sean! Let me try this out in a little bit.