I was using Video.find_all to retrieve a set of videos and when I specified a page number and page size I was expecting to just get that set of results back but the logic of the iterator will continue through ALL pages of data. Does it not make sense to provide a way to retrieve a specified slice of the search results?
For example, I was hoping to get back the top 5 results with a call similar to:
I was using Video.find_all to retrieve a set of videos and when I specified a page number and page size I was expecting to just get that set of results back but the logic of the iterator will continue through ALL pages of data. Does it not make sense to provide a way to retrieve a specified slice of the search results?
For example, I was hoping to get back the top 5 results with a call similar to:
But the iterator will keep requesting more pages once the first page of data is exhausted. https://github.com/studionow/pybrightcove/blob/master/pybrightcove/connection.py#L303 This is not ideal if you have thousands of records (or in any situation really where you don't want unnecessary data returned)
I worked around this by wrapping the result from Video.find_all in itertools.islice()