lukasschwab / arxiv.py

Python wrapper for the arXiv API
MIT License
1.07k stars 120 forks source link

Handle missing title attribute: default to "0" #72

Closed lukasschwab closed 3 years ago

lukasschwab commented 3 years ago

Description

If we find this bug in other fields, we should add similar patches.

If we find other field values causing this API bug, we should default to None instead of defaulting to "0". Only defaulting to "0" for now because it seems we can infer it's the title.

Breaking changes

List any changes that break the API usage supported on master.

None.

Relevant issues

List GitHub issues relevant to this change.

Checklist

lukasschwab commented 3 years ago

A note for posterity: pdoc's output depends in part on the version of Python running. A diff between pdoc running on Python 3.9 and running on Python 3.7:

1519c1519
<     authors: list[<a href="#Result.Author">arxiv.arxiv.Result.Author</a>] = [],
---
>     authors: List[<a href="#Result.Author">arxiv.arxiv.Result.Author</a>] = [],
1526c1526
<     links: list[<a href="#Result.Link">arxiv.arxiv.Result.Link</a>] = [],
---
>     links: List[<a href="#Result.Link">arxiv.arxiv.Result.Link</a>] = [],

List versus list. Can use diff -i to ignore differences in case, but that work-around doesn't seem necessary at this point.