google / google/apitools

list_pager.YieldFromList should prevent batchSize > limit

Open
#164 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
157
Forks
131
PR merge metrics
No merged PRs in 30d

Description

If a limit is provided, YieldFromList should enforce that the requested batch size is less than the remaining limit. Otherwise, more data will be requested from the service than requested by the user.

This should apply to the limit as it decreases, for example:
Request 1: limit: 90, batch_size: 50 --> request with batch_size: 50
Request 2: limit: 40, batch_size: 50 --> request with batch_size: 40

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.