Skip to content

IndexError: list index out of range #135

@JohannesBuchner

Description

@JohannesBuchner

I am getting the following error:

Traceback (most recent call last):
  File "/home/user/.local/lib/python3.12/site-packages/ads/search.py", line 515, in __next__
    cur = self._articles[self.__iter_counter]
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
    ....
    results = list(ads.SearchQuery(q=query, fl=fields, sort="date", max_pages=100)) #[::-1]
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.local/lib/python3.12/site-packages/ads/search.py", line 532, in __next__
    cur = self._articles[self.__iter_counter]
          ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range

Reading the code, ads seems to try .execute() to extend the list, but it did not help.

I am wondering whether there might be an error on the page (such as limit exceeded?). Not sure how to print that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions