pydantic-graph 1.28.0__py3-none-any.whl → 1.30.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pydantic_graph/beta/graph.py +10 -7
- pydantic_graph/beta/graph_builder.py +2 -0
- {pydantic_graph-1.28.0.dist-info → pydantic_graph-1.30.0.dist-info}/METADATA +1 -1
- {pydantic_graph-1.28.0.dist-info → pydantic_graph-1.30.0.dist-info}/RECORD +6 -6
- {pydantic_graph-1.28.0.dist-info → pydantic_graph-1.30.0.dist-info}/WHEEL +0 -0
- {pydantic_graph-1.28.0.dist-info → pydantic_graph-1.30.0.dist-info}/licenses/LICENSE +0 -0
pydantic_graph/beta/graph.py
CHANGED
|
@@ -13,7 +13,7 @@ from contextlib import AbstractContextManager, AsyncExitStack, ExitStack, asyncc
|
|
|
13
13
|
from dataclasses import dataclass, field
|
|
14
14
|
from typing import TYPE_CHECKING, Any, Generic, Literal, TypeGuard, cast, get_args, get_origin, overload
|
|
15
15
|
|
|
16
|
-
from anyio import CancelScope, create_memory_object_stream, create_task_group
|
|
16
|
+
from anyio import BrokenResourceError, CancelScope, create_memory_object_stream, create_task_group
|
|
17
17
|
from anyio.abc import TaskGroup
|
|
18
18
|
from anyio.streams.memory import MemoryObjectReceiveStream, MemoryObjectSendStream
|
|
19
19
|
from typing_extensions import TypeVar, assert_never
|
|
@@ -748,12 +748,15 @@ class _GraphIterator(Generic[StateT, DepsT, OutputT]):
|
|
|
748
748
|
with CancelScope() as scope:
|
|
749
749
|
self.cancel_scopes[t_.task_id] = scope
|
|
750
750
|
result = await self._run_task(t_)
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
751
|
+
try:
|
|
752
|
+
if isinstance(result, _GraphTaskAsyncIterable):
|
|
753
|
+
async for new_tasks in result.iterable:
|
|
754
|
+
await self.iter_stream_sender.send(_GraphTaskResult(t_, new_tasks, False))
|
|
755
|
+
await self.iter_stream_sender.send(_GraphTaskResult(t_, []))
|
|
756
|
+
else:
|
|
757
|
+
await self.iter_stream_sender.send(_GraphTaskResult(t_, result))
|
|
758
|
+
except BrokenResourceError:
|
|
759
|
+
pass # pragma: no cover # This can happen in difficult-to-reproduce circumstances when cancelling an asyncio task
|
|
757
760
|
|
|
758
761
|
async def _run_task(
|
|
759
762
|
self,
|
|
@@ -284,6 +284,8 @@ class GraphBuilder(Generic[StateT, DepsT, GraphInputT, GraphOutputT]):
|
|
|
284
284
|
async def wrapper(ctx: StepContext[StateT, DepsT, InputT]):
|
|
285
285
|
return call(ctx)
|
|
286
286
|
|
|
287
|
+
node_id = node_id or get_callable_name(call)
|
|
288
|
+
|
|
287
289
|
return self.step(call=wrapper, node_id=node_id, label=label)
|
|
288
290
|
|
|
289
291
|
@overload
|
|
@@ -7,8 +7,8 @@ pydantic_graph/nodes.py,sha256=CkY3lrC6jqZtzwhSRjFzmM69TdFFFrr58XSDU4THKHA,7450
|
|
|
7
7
|
pydantic_graph/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
8
|
pydantic_graph/beta/__init__.py,sha256=VVmbEFaCSXYHwXqS4pANg4B3cn_c86tT62tW_EXcuyw,751
|
|
9
9
|
pydantic_graph/beta/decision.py,sha256=x-Ta549b-j5hyBPUWFdwRQDRaJqnBHF1pfBP9L8I3vI,11239
|
|
10
|
-
pydantic_graph/beta/graph.py,sha256
|
|
11
|
-
pydantic_graph/beta/graph_builder.py,sha256=
|
|
10
|
+
pydantic_graph/beta/graph.py,sha256=_es8lxne3cntZBTlMqRdULl3AjPAoHuWa7whOT3CWLA,43044
|
|
11
|
+
pydantic_graph/beta/graph_builder.py,sha256=BV_eQDloVMddWjvL_EGP0JmjbQZMJcc0YqGQ6SwuS-k,43383
|
|
12
12
|
pydantic_graph/beta/id_types.py,sha256=FZ3rYSubF6g_Ocv0faL3yJsy1lNN9AGZl9f_izvORUg,2814
|
|
13
13
|
pydantic_graph/beta/join.py,sha256=rzCumDX_YgaU_a5bisfbjbbOuI3IwSZsCZs9TC0T9E4,8002
|
|
14
14
|
pydantic_graph/beta/mermaid.py,sha256=vpB9laZeTaS-P6BJplyN7DLFz0ppRVafGjBfqRiTh-s,7128
|
|
@@ -22,7 +22,7 @@ pydantic_graph/persistence/__init__.py,sha256=NLBGvUWhem23EdMHHxtX0XgTS2vyixmuWt
|
|
|
22
22
|
pydantic_graph/persistence/_utils.py,sha256=6ySxCc1lFz7bbLUwDLkoZWNqi8VNLBVU4xxJbKI23fQ,2264
|
|
23
23
|
pydantic_graph/persistence/file.py,sha256=XZy295cGc86HfUl_KuB-e7cECZW3bubiEdyJMVQ1OD0,6906
|
|
24
24
|
pydantic_graph/persistence/in_mem.py,sha256=MmahaVpdzmDB30Dm3ZfSCZBqgmx6vH4HXdBaWwVF0K0,6799
|
|
25
|
-
pydantic_graph-1.
|
|
26
|
-
pydantic_graph-1.
|
|
27
|
-
pydantic_graph-1.
|
|
28
|
-
pydantic_graph-1.
|
|
25
|
+
pydantic_graph-1.30.0.dist-info/METADATA,sha256=KwthIeCOWavsFRZXGIYKtPLcXwgZnc1pz0MKSRQ1MFk,3895
|
|
26
|
+
pydantic_graph-1.30.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
27
|
+
pydantic_graph-1.30.0.dist-info/licenses/LICENSE,sha256=vA6Jc482lEyBBuGUfD1pYx-cM7jxvLYOxPidZ30t_PQ,1100
|
|
28
|
+
pydantic_graph-1.30.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|