Skip to content
This repository was archived by the owner on Feb 20, 2025. It is now read-only.

Commit 4e40fdb

Browse files
authored
Merge pull request #3 from hatchet-dev/feat--more-typing-and-remove-v2
Feat: fixing all the mypy errors
2 parents b664ce5 + e5bf592 commit 4e40fdb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+392
-1257
lines changed

conftest.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import time
55
from io import BytesIO
66
from threading import Thread
7-
from typing import AsyncGenerator, Callable, cast
7+
from typing import AsyncGenerator, Callable, Generator, cast
88

99
import psutil
1010
import pytest
@@ -24,7 +24,9 @@ def hatchet() -> Hatchet:
2424

2525

2626
@pytest.fixture()
27-
def worker(request: pytest.FixtureRequest):
27+
def worker(
28+
request: pytest.FixtureRequest,
29+
) -> Generator[subprocess.Popen[bytes], None, None]:
2830
example = cast(str, request.param)
2931

3032
command = ["poetry", "run", example]

examples/__init__.py

Whitespace-only changes.

examples/_deprecated/README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/_deprecated/concurrency_limit_rr/event.py

Lines changed: 0 additions & 15 deletions
This file was deleted.

examples/_deprecated/concurrency_limit_rr/test_dep_concurrency_limit_rr.py

Lines changed: 0 additions & 58 deletions
This file was deleted.

examples/_deprecated/concurrency_limit_rr/worker.py

Lines changed: 0 additions & 38 deletions
This file was deleted.

examples/_deprecated/test_event_client.py

Lines changed: 0 additions & 26 deletions
This file was deleted.

examples/blocked_async/event.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66

77
client = new_client()
88

9-
# client.event.push("user:create", {"test": "test"})
109
client.event.push(
11-
"user:create", {"test": "test"}, options={"additional_metadata": {"hello": "moon"}}
10+
"user:create",
11+
{"test": "test"},
12+
options=PushEventOptions(additional_metadata={"hello": "moon"}),
1213
)

examples/bulk_fanout/bulk_trigger.py

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from dotenv import load_dotenv
88

99
from hatchet_sdk import new_client
10-
from hatchet_sdk.clients.admin import TriggerWorkflowOptions
10+
from hatchet_sdk.clients.admin import TriggerWorkflowOptions, WorkflowRunDict
1111
from hatchet_sdk.clients.rest.models.workflow_run import WorkflowRun
1212
from hatchet_sdk.clients.run_event_listener import StepRunEventType
1313

@@ -16,25 +16,22 @@ async def main() -> None:
1616
load_dotenv()
1717
hatchet = new_client()
1818

19-
workflowRuns: list[dict[str, Any]] = []
20-
21-
# we are going to run the BulkParent workflow 20 which will trigger the Child workflows n times for each n in range(20)
22-
for i in range(20):
23-
workflowRuns.append(
24-
{
25-
"workflow_name": "BulkParent",
26-
"input": {"n": i},
27-
"options": {
28-
"additional_metadata": {
29-
"bulk-trigger": i,
30-
"hello-{i}": "earth-{i}",
31-
},
32-
},
33-
}
19+
workflow_runs = [
20+
WorkflowRunDict(
21+
workflow_name="BulkParent",
22+
input={"n": i},
23+
options=TriggerWorkflowOptions(
24+
additional_metadata={
25+
"bulk-trigger": i,
26+
"hello-{i}": "earth-{i}",
27+
}
28+
),
3429
)
30+
for i in range(20)
31+
]
3532

3633
workflowRunRefs = hatchet.admin.run_workflows(
37-
workflowRuns,
34+
workflow_runs,
3835
)
3936

4037
results = await asyncio.gather(

examples/bulk_fanout/stream.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@
66

77
from dotenv import load_dotenv
88

9-
from hatchet_sdk import new_client
9+
from hatchet_sdk import Hatchet, new_client
1010
from hatchet_sdk.clients.admin import TriggerWorkflowOptions
1111
from hatchet_sdk.clients.run_event_listener import StepRunEventType
12-
from hatchet_sdk.v2.hatchet import Hatchet
1312

1413

1514
async def main() -> None:

0 commit comments

Comments
 (0)