Skip to content

Commit 6c6612c

Browse files
committed
Add scheduler migration guide
Summary: title Test Plan: preview Reviewers: schrockn, prha, max, alangenfeld, nate Reviewed By: alangenfeld, nate Subscribers: alangenfeld Differential Revision: https://dagster.phacility.com/D2034
1 parent 613ac12 commit 6c6612c

1 file changed

Lines changed: 60 additions & 0 deletions

File tree

070_MIGRATION.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,3 +159,63 @@ Replace all references to `context.run_config` with `context.pipeline_run`. The
159159
on the pipeline execution context has been removed and replaced with `pipeline_run`, a `PipelineRun`
160160
instance. Along with the fields previously on `RunConfig`, this also includes the pipeline run
161161
status.
162+
163+
## Scheduler
164+
165+
Scheduler configuration has been moved to the `dagster.yaml`. After upgrading, the previous schedule
166+
history is no longer compatible with the new storage.
167+
168+
Make sure you delete your existing `$DAGSTER_HOME/schedules` directory, then run:
169+
170+
```
171+
dagster schedule wipe && dagster schedule up
172+
```
173+
174+
Error:
175+
176+
`TypeError: schedules() got an unexpected keyword argument 'scheduler'`
177+
178+
Fix:
179+
180+
The `@schedules` decorator no longer takes a `scheduler` argument. Remove the argument and instead
181+
configure the scheduler on the instance.
182+
183+
Instead of:
184+
185+
```
186+
@schedules(scheduler=SystemCronScheduler)
187+
def define_schedules():
188+
...
189+
```
190+
191+
Remove the `scheduler` argument:
192+
193+
```
194+
@schedules
195+
def define_schedules():
196+
...
197+
```
198+
199+
Configure the scheduler on your instance by adding the following to `$DAGSTER_HOME/dagster.yaml`:
200+
201+
```
202+
scheduler:
203+
module: dagster_cron.cron_scheduler
204+
class: SystemCronScheduler
205+
```
206+
207+
Error:
208+
209+
`TypeError: <lambda>() takes 0 positional arguments but 1 was given"`
210+
211+
Stack Trace:
212+
213+
```
214+
File ".../dagster/python_modules/dagster/dagster/core/definitions/schedule.py", line 171, in should_execute
215+
return self._should_execute(context)
216+
```
217+
218+
Fix:
219+
220+
The `should_execute` and `environment_dict_fn` argument to `ScheduleDefinition` now has a required
221+
first argument `context`, representing the `ScheduleExecutionContext`.

0 commit comments

Comments
 (0)