How to schedule a job with a partitioned asset? #24531
Answered
by
garethbrickman
garethbrickman
asked this question in
Q&A
-
I want to schedule an asset job for a partitioned asset so that the partition for the then current day can be materialized. |
Beta Was this translation helpful? Give feedback.
Answered by
garethbrickman
Sep 17, 2024
Replies: 1 comment 1 reply
-
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 the schedule evaluation for a given day in the future that the There's an additional example linked in our Partitioning assets documentation here. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
garethbrickman
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
In the beloiw screenshot you can see when testing t…