Skip to content

Commit

Permalink
add schedule gotcha (#15803)
Browse files Browse the repository at this point in the history
  • Loading branch information
zzstoatzz authored Oct 24, 2024
1 parent 4c4d08d commit 5e46373
Showing 1 changed file with 39 additions and 1 deletion.
40 changes: 39 additions & 1 deletion docs/3.0/resources/upgrade-to-prefect-3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -259,4 +259,42 @@ async def my_flow():
```
</CodeGroup>

See the [Futures interface section](#futures-interface) for more information on this particular gotcha.
See the [Futures interface section](#futures-interface) for more information on this particular gotcha.

#### `TypeError: Flow.deploy() got an unexpected keyword argument 'schedule'`

In Prefect 3.0, the `schedule` argument has been removed in favor of the `schedules` argument.

This applies to both the `Flow.serve` and `Flow.deploy` methods.

<CodeGroup>
```python Prefect 2.0 {11}
from datetime import timedelta
from prefect import flow
from prefect.client.schemas.schedules import IntervalSchedule

@flow
def my_flow():
pass

my_flow.serve(
name="my-flow",
schedule=IntervalSchedule(interval=timedelta(minutes=1))
)
```

```python Prefect 3.0 {11}
from datetime import timedelta
from prefect import flow
from prefect.client.schemas.schedules import IntervalSchedule

@flow
def my_flow():
pass

my_flow.serve(
name="my-flow",
schedules=[IntervalSchedule(interval=timedelta(minutes=1))]
)
```
</CodeGroup>

0 comments on commit 5e46373

Please sign in to comment.