Skip to content

Commit

Permalink
Merge pull request pandas-dev#754 from shashank88/exception_add
Browse files Browse the repository at this point in the history
Fixes 753: Add details to bulk write failures
  • Loading branch information
shashank88 committed Apr 30, 2019
2 parents 660fe03 + aaa6f50 commit 8bb3334
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions arctic/store/_ndarray_store.py
Expand Up @@ -5,7 +5,7 @@
import numpy as np
import pymongo
from bson.binary import Binary
from pymongo.errors import OperationFailure, DuplicateKeyError
from pymongo.errors import OperationFailure, DuplicateKeyError, BulkWriteError
from six.moves import xrange

from ._version_store_utils import checksum, version_base_or_id, _fast_check_corruption
Expand Down Expand Up @@ -699,7 +699,11 @@ def _do_write(self, collection, version, symbol, item, previous_version, segment
# This helps with performance as we update as less documents as necessary

if bulk:
collection.bulk_write(bulk, ordered=False)
try:
collection.bulk_write(bulk, ordered=False)
except BulkWriteError as bwe:
logger.error("Bulk write failed with details: %s (Exception: %s)" % (bwe.details, bwe))
raise

segment_index = self._segment_index(item, existing_index=existing_index, start=segment_offset,
new_segments=segment_index)
Expand Down

0 comments on commit 8bb3334

Please sign in to comment.