numberly / appnexus-client

:snake: General purpose Python client for the AppNexus API
https://appnexus-client.readthedocs.io
MIT License
39 stars 19 forks source link

Improvement/revamp cursor iteration #44

Open shnups opened 5 years ago

shnups commented 5 years ago

Address issue #41, #42 and #43.

I tried to work around the current design in master to fix all corner cases but was unable to do that and, at the same time, actually taking into account the skip/limit at the url level.

Most 'limited' fixes (changing as little code as possible) would have required some sort of duplication of code between cursor.__iter__ to cursor.iter_pages and shared responsibilities of the skip/limit logic. I felt that it was cleaner to centralize that logic in one place and that this place had to be the one closer to the api calls.

Therefore, the skip/limit logic has been moved from cursor.__iter__ to cursor.iter_pages so that query parameters used to query AppNexus are actually impacted by the user's configuration.

coveralls commented 5 years ago

Coverage Status

Coverage increased (+2.007%) to 89.153% when pulling 2deb232f1c80f1568b7cd9c41ce88b8a194648cc on shnups:improvement/revamp-cursor-iteration into 77784032b8bd3dee777fb7bc716de0fde08e7f43 on numberly:master.