Skip to content

How to schedule a job with a partitioned asset? #24531

Discussion options

You must be logged in to vote

There's a special purpose method for that: build_schedule_from_partitioned_job. There's a code example included in that documentation that I've copied below:

from dagster import (
    DailyPartitionsDefinition,
    asset,
    build_schedule_from_partitioned_job,
    define_asset_job,
    Definitions,
)

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

asset1_job = define_asset_job("asset1_job", selection=[asset1])

# The created schedule will fire daily
asset1_job_schedule = build_schedule_from_partitioned_job(asset1_job)

defs = Definitions(assets=[asset1], schedules=[asset1_job_schedule])

In the beloiw screenshot you can see when testing t…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@v1gnesh
Comment options

Answer selected by garethbrickman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
area: partitions Related to Partitions area: schedule Related to schedules
2 participants