Skip to content

Commit 0fc0de6

Browse files
authored
fix: cover import_bulk edge case
1 parent 06ee23e commit 0fc0de6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

arango/collection.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1992,12 +1992,16 @@ def import_bulk(
19921992
IMPORTANT NOTE: this parameter may go through breaking changes
19931993
in the future where the return type may not be a list of result
19941994
objects anymore. Use it at your own risk, and avoid
1995-
depending on the return value if possible.
1995+
depending on the return value if possible. Should not be used
1996+
if **overwrite** is set to true.
19961997
:type batch_size: int
19971998
:return: Result of the bulk import.
19981999
:rtype: dict | list[dict]
19992000
:raise arango.exceptions.DocumentInsertError: If import fails.
20002001
"""
2002+
if overwrite and batch_size:
2003+
raise ValueError("Cannot set **batch_size** if **overwrite** is true")
2004+
20012005
documents = [self._ensure_key_from_id(doc) for doc in documents]
20022006

20032007
params: Params = {"type": "array", "collection": self.name}

0 commit comments

Comments
 (0)