Closed lukasschwab closed 3 years ago
A design problem: the feeds for id_list
-only queries are ordinal matches for the IDs in the id_list
. If you want to see if the nth ID exists in arXiv, check if the nth entry in the feed is well-formed or empty. See, for example, this feed.
Returning None
from the generator would preserve this relationship, but forces clients to check whether entries are None
when processing them.
Skipping the partial entries breaks the ordinal relationship. There's a work-around: you can still check existence by looking up in the aggregate results.
Since this usage (testing ID existence) seems less likely, I'm inclined to require some dependents to do the latter rather than requiring all projects to do the former.
If this use case turns out to be common, we can parameterize an invalid-entry handler in the Client
options, e.g. lambda entry: None
, to. override the skipping.
Another risk with skipping partial results: doing so may confuse a dependent's length-checking pagination logic.
Final consideration:
Skipping the partial entries breaks the ordinal relationship. There's a work-around: you can still check existence by looking up in the aggregate results.
Since this usage (testing ID existence) seems less likely, I'm inclined to require some dependents to do the latter rather than requiring all projects to do the former.
No dependent of this package relies on the ordinal relationship, because any request that would be impacted by this change currently fails. Skipping the results is the least disruptive option.
Description
When a specified ID doesn't correspond to an arXiv paper, the results feed includes an
entry
element missing expected fields (id
).The status is 200, but
feedparser
chokes and the error-handling in this package tries to access the nonexistent ID, yielding a rawAttributeError
Steps to reproduce
Example API feed: http://export.arxiv.org/api/query?id_list=2208.05394
Expected behavior
This package's error handling should return a neatly handleable error.
Versions
python
version: 3.7.9arxiv.py
version: 1.4.1