From 957fcad34b0523c4994100de0333a6d130af59b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Honza=20Kr=C3=A1l?= Date: Tue, 18 Jul 2017 16:15:08 -0400 Subject: [PATCH] Do not serialize the data in bulk_data This can lead to multiple serializations when retrying with backoff helper --- elasticsearch/helpers/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/elasticsearch/helpers/__init__.py b/elasticsearch/helpers/__init__.py index 8bce65f6..8a349654 100644 --- a/elasticsearch/helpers/__init__.py +++ b/elasticsearch/helpers/__init__.py @@ -55,7 +55,7 @@ def _chunk_actions(actions, chunk_size, max_chunk_bytes, serializer): bulk_actions, bulk_data = [], [] size, action_count = 0, 0 for action, data in actions: - raw_action = action + raw_data, raw_action = action action = serializer.dumps(action) cur_size = len(action) + 1 @@ -72,7 +72,7 @@ def _chunk_actions(actions, chunk_size, max_chunk_bytes, serializer): bulk_actions.append(action) if data is not None: bulk_actions.append(data) - bulk_data.append((raw_action, data)) + bulk_data.append((raw_action, raw_data)) else: bulk_data.append((raw_action, ))