pydantic-graph 1.27.0__py3-none-any.whl → 1.29.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.
@@ -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
- if isinstance(result, _GraphTaskAsyncIterable):
752
- async for new_tasks in result.iterable:
753
- await self.iter_stream_sender.send(_GraphTaskResult(t_, new_tasks, False))
754
- await self.iter_stream_sender.send(_GraphTaskResult(t_, []))
755
- else:
756
- await self.iter_stream_sender.send(_GraphTaskResult(t_, result))
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,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pydantic-graph
3
- Version: 1.27.0
3
+ Version: 1.29.0
4
4
  Summary: Graph and state machine library
5
5
  Project-URL: Homepage, https://ai.pydantic.dev/graph/tree/main/pydantic_graph
6
6
  Project-URL: Source, https://github.com/pydantic/pydantic-ai
@@ -7,7 +7,7 @@ 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=-T-HbVyBC3qgg_-dXURnCbI6K_mqj25jDVh_RMlVsS8,42811
10
+ pydantic_graph/beta/graph.py,sha256=_es8lxne3cntZBTlMqRdULl3AjPAoHuWa7whOT3CWLA,43044
11
11
  pydantic_graph/beta/graph_builder.py,sha256=2sD7TR8oGg4Gatrms0jE17NXzQN7drzUvaJKs5BvILU,43329
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
@@ -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.27.0.dist-info/METADATA,sha256=8_NuPVx_PRMOeNjr3mHwbK69k1tYpxW8McLVTz8GM08,3895
26
- pydantic_graph-1.27.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
27
- pydantic_graph-1.27.0.dist-info/licenses/LICENSE,sha256=vA6Jc482lEyBBuGUfD1pYx-cM7jxvLYOxPidZ30t_PQ,1100
28
- pydantic_graph-1.27.0.dist-info/RECORD,,
25
+ pydantic_graph-1.29.0.dist-info/METADATA,sha256=bUNJyeRTstnXlNAonI4iYvywKEGNz-N75EnQOINqyxU,3895
26
+ pydantic_graph-1.29.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
27
+ pydantic_graph-1.29.0.dist-info/licenses/LICENSE,sha256=vA6Jc482lEyBBuGUfD1pYx-cM7jxvLYOxPidZ30t_PQ,1100
28
+ pydantic_graph-1.29.0.dist-info/RECORD,,