Skip to content

Commit

Permalink
ARROW-247 Fix BulkWriteError import error (#234)
Browse files Browse the repository at this point in the history
  • Loading branch information
aclark4life committed Sep 23, 2024
1 parent bb5dc7e commit eeeb3bf
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions bindings/python/pymongoarrow/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
from pyarrow import Schema as ArrowSchema
from pyarrow import Table, timestamp
from pyarrow.types import is_date32, is_date64
from pymongo.bulk import BulkWriteError
from pymongo.common import MAX_WRITE_BATCH_SIZE

from pymongoarrow.context import PyMongoArrowContext
Expand Down Expand Up @@ -495,7 +494,7 @@ def write(collection, tabular, *, exclude_none: bool = False):
i += 1
try:
collection.insert_many(cur_batch)
except BulkWriteError as bwe:
except pymongo.errors.BulkWriteError as bwe:
raise ArrowWriteError(_transform_bwe(dict(bwe.details), cur_offset)) from bwe
except pymongo.errors.PyMongoError as pme:
raise ArrowWriteError(
Expand Down

0 comments on commit eeeb3bf

Please sign in to comment.