Skip to content

Commit

Permalink
add dl sched
Browse files Browse the repository at this point in the history
  • Loading branch information
cbini committed Sep 15, 2023
1 parent f42bf5b commit 2a64259
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 12 deletions.
19 changes: 15 additions & 4 deletions src/teamster/kippcamden/deanslist/schedules.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from dagster import build_schedule_from_partitioned_job, schedule
from dagster import ScheduleEvaluationContext, schedule
from dagster._core.definitions.partitioned_schedule import _get_schedule_evaluation_fn

from .. import CODE_LOCATION, LOCAL_TIMEZONE
from .assets import school_ids
Expand All @@ -20,11 +21,21 @@ def deanslist_static_partition_asset_job_schedule():
)


multi_partition_asset_job_schedule = build_schedule_from_partitioned_job(
job=multi_partition_asset_job, hour_of_day=0, minute_of_hour=0
@schedule(
cron_schedule=["0 0,14 * * *"],
execution_timezone=LOCAL_TIMEZONE.name,
job=multi_partition_asset_job,
)
def deanslist_multi_partition_asset_job_schedule(context: ScheduleEvaluationContext):
schedule_evaluation_fn = _get_schedule_evaluation_fn(
partitions_def=multi_partition_asset_job.partitions_def,
job=multi_partition_asset_job,
)

schedule_evaluation_fn(context)


__all__ = [
deanslist_static_partition_asset_job_schedule,
multi_partition_asset_job_schedule,
deanslist_multi_partition_asset_job_schedule,
]
19 changes: 15 additions & 4 deletions src/teamster/kippmiami/deanslist/schedules.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from dagster import build_schedule_from_partitioned_job, schedule
from dagster import ScheduleEvaluationContext, schedule
from dagster._core.definitions.partitioned_schedule import _get_schedule_evaluation_fn

from .. import CODE_LOCATION, LOCAL_TIMEZONE
from .assets import school_ids
Expand All @@ -20,11 +21,21 @@ def deanslist_static_partition_asset_job_schedule():
)


multi_partition_asset_job_schedule = build_schedule_from_partitioned_job(
job=multi_partition_asset_job, hour_of_day=0, minute_of_hour=0
@schedule(
cron_schedule=["0 0,14 * * *"],
execution_timezone=LOCAL_TIMEZONE.name,
job=multi_partition_asset_job,
)
def deanslist_multi_partition_asset_job_schedule(context: ScheduleEvaluationContext):
schedule_evaluation_fn = _get_schedule_evaluation_fn(
partitions_def=multi_partition_asset_job.partitions_def,
job=multi_partition_asset_job,
)

schedule_evaluation_fn(context)


__all__ = [
deanslist_static_partition_asset_job_schedule,
multi_partition_asset_job_schedule,
deanslist_multi_partition_asset_job_schedule,
]
19 changes: 15 additions & 4 deletions src/teamster/kippnewark/deanslist/schedules.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from dagster import build_schedule_from_partitioned_job, schedule
from dagster import ScheduleEvaluationContext, schedule
from dagster._core.definitions.partitioned_schedule import _get_schedule_evaluation_fn

from .. import CODE_LOCATION, LOCAL_TIMEZONE
from .assets import school_ids
Expand All @@ -20,11 +21,21 @@ def deanslist_static_partition_asset_job_schedule():
)


multi_partition_asset_job_schedule = build_schedule_from_partitioned_job(
job=multi_partition_asset_job, hour_of_day=0, minute_of_hour=0
@schedule(
cron_schedule=["0 0,14 * * *"],
execution_timezone=LOCAL_TIMEZONE.name,
job=multi_partition_asset_job,
)
def deanslist_multi_partition_asset_job_schedule(context: ScheduleEvaluationContext):
schedule_evaluation_fn = _get_schedule_evaluation_fn(
partitions_def=multi_partition_asset_job.partitions_def,
job=multi_partition_asset_job,
)

schedule_evaluation_fn(context)


__all__ = [
deanslist_static_partition_asset_job_schedule,
multi_partition_asset_job_schedule,
deanslist_multi_partition_asset_job_schedule,
]

0 comments on commit 2a64259

Please sign in to comment.