diff --git a/examples/auto_retry.py b/examples/auto_retry.py index 069a3a5..5eff8bd 100644 --- a/examples/auto_retry.py +++ b/examples/auto_retry.py @@ -8,7 +8,7 @@ rng = random.Random(2) -def third_party_api_call(x: int) -> str: +def third_party_api_call(x): # Simulate a third-party API call that fails. print(f"Simulating third-party API call with {x}") if x < 3: @@ -19,7 +19,7 @@ def third_party_api_call(x: int) -> str: # Use the `dispatch.function` decorator to declare a stateful function. @dispatch.function -def application() -> str: +def application(): x = rng.randint(0, 5) return third_party_api_call(x) diff --git a/examples/getting_started.py b/examples/getting_started.py index be1b41f..38ad9cf 100644 --- a/examples/getting_started.py +++ b/examples/getting_started.py @@ -5,7 +5,7 @@ # Use the `dispatch.function` decorator declare a stateful function. @dispatch.function -def publish(url, payload) -> str: +def publish(url, payload): r = requests.post(url, data=payload) r.raise_for_status() return r.text diff --git a/examples/github_stats.py b/examples/github_stats.py index 2edc617..c1dc6db 100644 --- a/examples/github_stats.py +++ b/examples/github_stats.py @@ -31,21 +31,21 @@ def get_gh_api(url): @dispatch.function -async def get_repo_info(repo_owner: str, repo_name: str) -> dict: +async def get_repo_info(repo_owner, repo_name): url = f"https://api.github.com/repos/{repo_owner}/{repo_name}" repo_info = get_gh_api(url) return repo_info @dispatch.function -async def get_contributors(repo_info: dict) -> list[dict]: +async def get_contributors(repo_info): url = repo_info["contributors_url"] contributors = get_gh_api(url) return contributors @dispatch.function -async def main() -> list[dict]: +async def main(): repo_info = await get_repo_info("dispatchrun", "coroutine") print( f"""Repository: {repo_info['full_name']}