From fcff4ca67c1792a355fe9e068aab12b496d7d5ba Mon Sep 17 00:00:00 2001 From: Preston Rasmussen <109292228+prasmussen15@users.noreply.github.com> Date: Tue, 17 Dec 2024 15:11:22 -0500 Subject: [PATCH] use default value for return exceptions (#246) --- graphiti_core/helpers.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/graphiti_core/helpers.py b/graphiti_core/helpers.py index fb330e67..0d46a2a0 100644 --- a/graphiti_core/helpers.py +++ b/graphiti_core/helpers.py @@ -86,16 +86,11 @@ def normalize_l2(embedding: list[float]) -> list[float]: # Use this instead of asyncio.gather() to bound coroutines -async def semaphore_gather( - *coroutines: Coroutine, max_coroutines: int = SEMAPHORE_LIMIT, return_exceptions=True -): +async def semaphore_gather(*coroutines: Coroutine, max_coroutines: int = SEMAPHORE_LIMIT): semaphore = asyncio.Semaphore(max_coroutines) async def _wrap_coroutine(coroutine): async with semaphore: return await coroutine - return await asyncio.gather( - *(_wrap_coroutine(coroutine) for coroutine in coroutines), - return_exceptions=return_exceptions, - ) + return await asyncio.gather(*(_wrap_coroutine(coroutine) for coroutine in coroutines))