Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix logic for logging errors in batch #1183

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions weaviate/collections/batch/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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.",
Expand Down Expand Up @@ -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.",
Expand Down