Skip to content

Commit

Permalink
3.9 compat for debug.mdx tutorial (#16296)
Browse files Browse the repository at this point in the history
  • Loading branch information
zzstoatzz authored Dec 9, 2024
1 parent 4f203b1 commit 5d1c88e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions docs/v3/tutorials/debug.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,16 @@ Now that you've found the failure, the next step is to fix the underlying code.
Open the `simulate_failures.py` file and look at line 12.

```python simulate_failures.py {12}
from prefect import flow, task
import argparse
import asyncio
from typing import Optional

from prefect import flow, task
from prefect.client.orchestration import get_client


@task
def process_data(run: int, fail_at_run: int | None = None) -> bool:
def process_data(run: int, fail_at_run: Optional[int] = None) -> bool:
"""Simulate data processing with failures"""

# Simulate persistent failures
Expand All @@ -73,13 +75,14 @@ Remove the `if` statement to fix this failure.
We added this statement to give you something to fix. :)

```python simulate_failures.py
from prefect import flow, task
import argparse
import asyncio
from typing import Optional
from prefect import flow, task
from prefect.client.orchestration import get_client

@task
def process_data(run: int, fail_at_run: int | None = None) -> bool:
def process_data(run: int, fail_at_run: Optional[int] = None) -> bool:
"""Simulate data processing with failures"""

return True
Expand Down

0 comments on commit 5d1c88e

Please sign in to comment.