Skip to content

Commit 957fcad

Browse files
committed
Do not serialize the data in bulk_data
This can lead to multiple serializations when retrying with backoff helper
1 parent accb19a commit 957fcad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

elasticsearch/helpers/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def _chunk_actions(actions, chunk_size, max_chunk_bytes, serializer):
5555
bulk_actions, bulk_data = [], []
5656
size, action_count = 0, 0
5757
for action, data in actions:
58-
raw_action = action
58+
raw_data, raw_action = action
5959
action = serializer.dumps(action)
6060
cur_size = len(action) + 1
6161

@@ -72,7 +72,7 @@ def _chunk_actions(actions, chunk_size, max_chunk_bytes, serializer):
7272
bulk_actions.append(action)
7373
if data is not None:
7474
bulk_actions.append(data)
75-
bulk_data.append((raw_action, data))
75+
bulk_data.append((raw_action, raw_data))
7676
else:
7777
bulk_data.append((raw_action, ))
7878

0 commit comments

Comments
 (0)