From 3ebdb25e008d130c43372be9ed23d2c077439887 Mon Sep 17 00:00:00 2001 From: Tommy Smith Date: Thu, 18 Jul 2024 14:53:34 +0100 Subject: [PATCH] Fix logic for logging errors in batch --- weaviate/collections/batch/base.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/weaviate/collections/batch/base.py b/weaviate/collections/batch/base.py index 7ff7d1b53..766359a56 100644 --- a/weaviate/collections/batch/base.py +++ b/weaviate/collections/batch/base.py @@ -458,12 +458,6 @@ async def __send_batch( objects=objs, timeout=DEFAULT_REQUEST_TIMEOUT ) except Exception as e: - logger.warning( - { - "message": "Failed to insert objects in batch. Inspect client.batch.failed_objects or collection.batch.failed_objects for the failed objects.", - "error": repr(e), - } - ) errors_obj = { idx: ErrorObject(message=repr(e), object_=obj) for idx, obj in enumerate(objs) } @@ -552,7 +546,7 @@ async def __send_batch( ) self.__uuid_lookup_lock.release() - if (n_obj_errs := len(response_obj.errors)) > 0 and n_obj_errs < 30: + if (n_obj_errs := len(response_obj.errors)) > 0 and self.__objs_logs_count < 30: logger.error( { "message": f"Failed to send {n_obj_errs} objects in a batch of {n_objs}. Please inspect client.batch.failed_objects or collection.batch.failed_objects for the failed objects.", @@ -585,7 +579,7 @@ async def __send_batch( errors=errors_ref, has_errors=True, ) - if (n_ref_errs := len(response_ref.errors)) > 0 and n_ref_errs < 30: + if (n_ref_errs := len(response_ref.errors)) > 0 and self.__refs_logs_count < 30: logger.error( { "message": f"Failed to send {n_ref_errs} references in a batch of {n_refs}. Please inspect client.batch.failed_references or collection.batch.failed_references for the failed references.",