Skip to content

Commit ae71567

Browse files
aclark4lifebruno-firnkes
authored andcommitted
ARROW-247 Fix BulkWriteError import error (mongodb-labs#234)
1 parent 624d7f9 commit ae71567

File tree

1 file changed

+1
-2
lines changed
  • bindings/python/pymongoarrow

1 file changed

+1
-2
lines changed

bindings/python/pymongoarrow/api.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
from pyarrow import Schema as ArrowSchema
3131
from pyarrow import Table, timestamp
3232
from pyarrow.types import is_date32, is_date64
33-
from pymongo.bulk import BulkWriteError
3433
from pymongo.common import MAX_WRITE_BATCH_SIZE
3534

3635
from pymongoarrow.context import PyMongoArrowContext
@@ -495,7 +494,7 @@ def write(collection, tabular, *, exclude_none: bool = False):
495494
i += 1
496495
try:
497496
collection.insert_many(cur_batch)
498-
except BulkWriteError as bwe:
497+
except pymongo.errors.BulkWriteError as bwe:
499498
raise ArrowWriteError(_transform_bwe(dict(bwe.details), cur_offset)) from bwe
500499
except pymongo.errors.PyMongoError as pme:
501500
raise ArrowWriteError(

0 commit comments

Comments
 (0)