pydantic-graph 1.28.0__tar.gz → 1.29.0__tar.gz

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.
Files changed (29) hide show
  1. {pydantic_graph-1.28.0 → pydantic_graph-1.29.0}/PKG-INFO +1 -1
  2. {pydantic_graph-1.28.0 → pydantic_graph-1.29.0}/pydantic_graph/beta/graph.py +10 -7
  3. {pydantic_graph-1.28.0 → pydantic_graph-1.29.0}/.gitignore +0 -0
  4. {pydantic_graph-1.28.0 → pydantic_graph-1.29.0}/LICENSE +0 -0
  5. {pydantic_graph-1.28.0 → pydantic_graph-1.29.0}/README.md +0 -0
  6. {pydantic_graph-1.28.0 → pydantic_graph-1.29.0}/pydantic_graph/__init__.py +0 -0
  7. {pydantic_graph-1.28.0 → pydantic_graph-1.29.0}/pydantic_graph/_utils.py +0 -0
  8. {pydantic_graph-1.28.0 → pydantic_graph-1.29.0}/pydantic_graph/beta/__init__.py +0 -0
  9. {pydantic_graph-1.28.0 → pydantic_graph-1.29.0}/pydantic_graph/beta/decision.py +0 -0
  10. {pydantic_graph-1.28.0 → pydantic_graph-1.29.0}/pydantic_graph/beta/graph_builder.py +0 -0
  11. {pydantic_graph-1.28.0 → pydantic_graph-1.29.0}/pydantic_graph/beta/id_types.py +0 -0
  12. {pydantic_graph-1.28.0 → pydantic_graph-1.29.0}/pydantic_graph/beta/join.py +0 -0
  13. {pydantic_graph-1.28.0 → pydantic_graph-1.29.0}/pydantic_graph/beta/mermaid.py +0 -0
  14. {pydantic_graph-1.28.0 → pydantic_graph-1.29.0}/pydantic_graph/beta/node.py +0 -0
  15. {pydantic_graph-1.28.0 → pydantic_graph-1.29.0}/pydantic_graph/beta/node_types.py +0 -0
  16. {pydantic_graph-1.28.0 → pydantic_graph-1.29.0}/pydantic_graph/beta/parent_forks.py +0 -0
  17. {pydantic_graph-1.28.0 → pydantic_graph-1.29.0}/pydantic_graph/beta/paths.py +0 -0
  18. {pydantic_graph-1.28.0 → pydantic_graph-1.29.0}/pydantic_graph/beta/step.py +0 -0
  19. {pydantic_graph-1.28.0 → pydantic_graph-1.29.0}/pydantic_graph/beta/util.py +0 -0
  20. {pydantic_graph-1.28.0 → pydantic_graph-1.29.0}/pydantic_graph/exceptions.py +0 -0
  21. {pydantic_graph-1.28.0 → pydantic_graph-1.29.0}/pydantic_graph/graph.py +0 -0
  22. {pydantic_graph-1.28.0 → pydantic_graph-1.29.0}/pydantic_graph/mermaid.py +0 -0
  23. {pydantic_graph-1.28.0 → pydantic_graph-1.29.0}/pydantic_graph/nodes.py +0 -0
  24. {pydantic_graph-1.28.0 → pydantic_graph-1.29.0}/pydantic_graph/persistence/__init__.py +0 -0
  25. {pydantic_graph-1.28.0 → pydantic_graph-1.29.0}/pydantic_graph/persistence/_utils.py +0 -0
  26. {pydantic_graph-1.28.0 → pydantic_graph-1.29.0}/pydantic_graph/persistence/file.py +0 -0
  27. {pydantic_graph-1.28.0 → pydantic_graph-1.29.0}/pydantic_graph/persistence/in_mem.py +0 -0
  28. {pydantic_graph-1.28.0 → pydantic_graph-1.29.0}/pydantic_graph/py.typed +0 -0
  29. {pydantic_graph-1.28.0 → pydantic_graph-1.29.0}/pyproject.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pydantic-graph
3
- Version: 1.28.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
@@ -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,
File without changes