Skip to content

Commit 35f9970

Browse files
authored
Merge pull request #421 from algolia/fix/chunk-issue-on-more-than-batch-size
Fixes chunk algorithm on batch size limit
2 parents 221a023 + b300240 commit 35f9970

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
66

77
# Release Notes
88

9+
## [Unreleased]
10+
11+
### Fixed
12+
- Batching algorithm when reaching the `batch_size`. ([#421](https://github.com/algolia/algoliasearch-client-python/pull/421))
13+
914
## [v2.0.0](https://github.com/algolia/algoliasearch-client-python/compare/1.20.0...2.0.0)
1015

1116
### Changed

algoliasearch/search_index.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -498,17 +498,17 @@ def _chunk(self, action, objects, request_options,
498498

499499
if len(batch) == batch_size:
500500
if validate_object_id:
501-
assert_object_id(objects)
501+
assert_object_id(batch)
502502

503-
requests = build_raw_response_batch(action, objects)
503+
requests = build_raw_response_batch(action, batch)
504504
raw_responses.append(
505505
self._raw_batch(requests, request_options))
506506
batch = []
507507

508508
if len(batch):
509509
if validate_object_id:
510-
assert_object_id(objects)
511-
requests = build_raw_response_batch(action, objects)
510+
assert_object_id(batch)
511+
requests = build_raw_response_batch(action, batch)
512512
raw_responses.append(self._raw_batch(requests, request_options))
513513

514514
return IndexingResponse(self, raw_responses)

0 commit comments

Comments
 (0)