Is there a way to launch a job run for every parti...
# ask-community
n
Is there a way to launch a job run for every partition in a partition set at once for a non-time-based dynamcally generated partition config? And is it possible to do this on a schedule?
s
Hi @Nick Dellosa - if you want to kick this off manually, you can launch a backfill from the "Partitions" tab of a run page It's currently only possible to trigger one run at a time from a schedule. If you define a sensor, you can trigger multiple runs on the same tick. E.g.
Copy code
@dynamic_partitioned_config(...)
def my_partitioned_config(...):
    ...

@sensor(job=...)
def my_sensor():
    if ...:
        for partition_key in my_partioned_config.get_partition_keys():
            yield RunRequest(tags={"partition": partition_key}, run_config=my_partitioned_config.get_run_config(partition_key))
n
@sandy Any plans in the future to make scheduled backfills possible? Or is it a design decision for schedules to strictly be one run per tick?
s
@Nick Dellosa - I created an issue for it: https://github.com/dagster-io/dagster/issues/5714 (actually thought we had one already, but couldn't find it). I do think we'd like to enable this, though not sure on timeline
💯 1
actually wait, I think this is already possible:
Copy code
@dynamic_partitioned_config(...)
def my_partitioned_config(...):
    ...

def evaluate_tick():
    if ...:
        for partition_key in my_partioned_config.get_partition_keys():
            yield RunRequest(tags={"partition": partition_key}, run_config=my_partitioned_config.get_run_config(partition_key))

my_schedule = ScheduleDefinition(job=..., execution_fn=evaluate_tick)
n
!!! awesome, gonna try this now