Skip to content
This repository has been archived by the owner on Sep 24, 2020. It is now read-only.

[Bugfix] Remove index check for API objects #175

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nbardy
Copy link
Contributor

@nbardy nbardy commented Sep 1, 2020

I don't think we need to make this check here. Let the python stdlib make the checks on index.

This fixes the -1 issue you get on first lookup.

@nbardy nbardy requested a review from raubitsj September 1, 2020 00:33
@@ -562,7 +562,7 @@ def _load_page(self):

def __getitem__(self, index):
loaded = True
while loaded and index > len(self.objects) - 1:
while loaded:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isnt the right fix... I think this will defeat the entire pagination system and will load everything rather than loading the page up to the index needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not clear on what the check is doing here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like pagination always started at 0. And we grow the list infinitely?

Copy link
Member

@raubitsj raubitsj Sep 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

index is the element of the list we are looking for. and we keep reading pages until we get a list of items that includes that index.

at least that is how i read it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants