Skip to content

Commit

Permalink
fix(opensearch): bulk error without create key
Browse files Browse the repository at this point in the history
  • Loading branch information
lambda-science authored and silvanocerza committed Mar 18, 2024
1 parent 48fe102 commit f4459db
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ def write_documents(self, documents: List[Document], policy: DuplicatePolicy = D
duplicate_errors_ids = []
other_errors = []
for e in errors:
if "create" not in e:
other_errors.append(e)
continue
error_type = e["create"]["error"]["type"]
if policy == DuplicatePolicy.FAIL and error_type == "version_conflict_engine_exception":
duplicate_errors_ids.append(e["create"]["_id"])
Expand Down

0 comments on commit f4459db

Please sign in to comment.