[FEAT]: Change auto_paginate
to return an enumerator instead of getting all pages
#1722
Open
1 task done
Labels
Type: Feature
New feature or request
Describe the need
It would be nice if
auto_paginate
would allow enumeration so that you could stop the request once you have reached your desired goal. Callingto_a
on the enumerator will give you the currentauto_paginate
behavior of just paging to the last page. This avoids wasted requests and memory bloat when potentially concat'ing 10's of thousands of objects with the current auto pagination.Sample code of how it would work
I'm not sure what to do about methods like this one that are returning the total count. This
total_count
is actually wrong when auto paginating since thetotal_count
already takes into account all of the pages. So maybe that should be removed since it is giving the wrong value anyways.SDK Version
No response
API Version
No response
Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: