Miguel Rodriguez
06/28/2023, 12:03 AMmonthly_assets_schedule = build_schedule_from_partitioned_job(
define_asset_job(
"monthly_assets_job", selection=AssetSelection.groups("core_monthly")
)
)
Miguel Rodriguez
06/28/2023, 3:31 AMmonthly_partitions_def = MonthlyPartitionsDefinition(start_date="2023-01-01")
monthly_assets_job = define_asset_job(
"monthly_assets_job", selection=AssetSelection.groups("core_monthly")
)
@schedule(cron_schedule="@daily", job=monthly_assets_job)
def monthly_assets_schedule():
return RunRequest(partition_key=monthly_partitions_def.get_last_partition_key())
sean
06/28/2023, 12:30 PMbuild_schedule_from_partitioned_job
is just sugar to create a schedule with the same cadence as a partitions def you’ve already defined, but if you need a different cadence you should just fall back to @schedule
.Miguel Rodriguez
06/28/2023, 3:41 PM