Skip to content

Schedules

Dagster’s ScheduleDefinition is fully sufficient for scheduled Rocky runs without any Rocky-specific glue. dagster-rocky 0.4 ships build_rocky_schedule() as a thin convenience that bakes in sensible defaults and accepts the same target= shape as rocky_source_sensor() for symmetry.

import dagster as dg
from dagster_rocky import (
RockyResource,
build_rocky_schedule,
load_rocky_assets,
)
rocky = RockyResource(config_path="rocky.toml")
rocky_assets = load_rocky_assets(rocky)
daily_marts = build_rocky_schedule(
name="daily_marts",
cron_schedule="0 6 * * *", # 6 AM
target=dg.AssetSelection.assets(*[s.key for s in rocky_assets]),
timezone="America/Los_Angeles",
)
defs = dg.Definitions(
assets=rocky_assets,
schedules=[daily_marts],
resources={"rocky": rocky},
)

build_rocky_schedule(name, cron_schedule, target, ...)

Section titled “build_rocky_schedule(name, cron_schedule, target, ...)”

Returns a ScheduleDefinition with sensible defaults.

ParameterTypeDefaultDescription
namestrrequiredSchedule name. Must be unique within the code location.
cron_schedulestrrequiredStandard cron string (e.g. "0 6 * * *").
targetCoercibleToAssetSelection | AssetsDefinitionrequiredAsset selection to materialize.
timezonestr"UTC"IANA timezone for cron evaluation.
tagsdict[str, str] | NoneNoneRun tags. rocky/schedule is added automatically.
descriptionstr | NoneNoneHuman-readable description.
default_statusDefaultScheduleStatusSTOPPEDWhether the schedule is enabled on deployment.

Every schedule built via build_rocky_schedule automatically adds a rocky/schedule=<name> tag to runs it triggers, so you can filter the run history view by Rocky-driven schedules.

User-supplied tags merge on top of the namespace tag, so a user explicitly setting rocky/schedule=<other> wins. This is intentional — advanced users may want different schedule-tag values for grouping.

Schedules and sensors complement each other:

  • Schedules fire at fixed times regardless of upstream state — useful for reports that should run every morning.
  • Sensors fire when upstream state changes — useful for pipelines that should kick off as soon as Fivetran completes a sync.

Both can target the same asset selection. Dagster will deduplicate materializations via run_key so simultaneous triggers don’t double-execute.