Skip to content

Commit

Permalink
fix: gen
Browse files Browse the repository at this point in the history
  • Loading branch information
grutt committed Sep 10, 2024
1 parent 86fa189 commit fc55ace
Show file tree
Hide file tree
Showing 6 changed files with 607 additions and 7 deletions.
18 changes: 14 additions & 4 deletions examples/programatic_replay/script.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import asyncio

from dotenv import load_dotenv

from hatchet_sdk import Hatchet, WorkflowRunStatus
Expand All @@ -6,9 +8,17 @@

hatchet = Hatchet(debug=True)

if __name__ == "__main__":
# Look up the failed workflow runs
failed = hatchet.rest.events_list(statuses=[WorkflowRunStatus.FAILED], limit=3)

async def main():
# Look up the failed workflow runs
failed = await hatchet.rest.aio.workflow_run_list(
statuses=[WorkflowRunStatus.FAILED], limit=3
)
# Replay the failed workflow runs
retried = hatchet.rest.events_replay(failed)
retried = await hatchet.rest.aio.workflow_run_replay(
workflow_run_ids=[run.metadata.id for run in failed.rows]
)


if __name__ == "__main__":
asyncio.run(main())
1 change: 0 additions & 1 deletion hatchet_sdk/clients/rest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
from hatchet_sdk.clients.rest.api.worker_api import WorkerApi
from hatchet_sdk.clients.rest.api.workflow_api import WorkflowApi
from hatchet_sdk.clients.rest.api.workflow_run_api import WorkflowRunApi
from hatchet_sdk.clients.rest.api.workflow_runs_api import WorkflowRunsApi
from hatchet_sdk.clients.rest.api_client import ApiClient

# import ApiClient
Expand Down
1 change: 0 additions & 1 deletion hatchet_sdk/clients/rest/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@
from hatchet_sdk.clients.rest.api.worker_api import WorkerApi
from hatchet_sdk.clients.rest.api.workflow_api import WorkflowApi
from hatchet_sdk.clients.rest.api.workflow_run_api import WorkflowRunApi
from hatchet_sdk.clients.rest.api.workflow_runs_api import WorkflowRunsApi
Loading

0 comments on commit fc55ace

Please sign in to comment.