lukasschwab / arxiv.py

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

v0.5.4 broke tags #65

Closed impredicative closed 3 years ago

impredicative commented 3 years ago

Is there any reason why the tags key is not returned in a result in v0.5.4? This works fine in v0.5.3.

lukasschwab commented 3 years ago

You know, this is actually an interesting one.

I certainly didn't intend to break tags in 0.5.4; in that sense, this is a valid bug report.

The interesting thing is that the only change in 0.5.4 was a bug fix to make the v0 client's "prune" behavior work as expected: https://github.com/lukasschwab/arxiv.py/commit/3d5e66b8546da2eaa7a8d32290bdd7a61de490c7

That change is validly a bug fix. But 'tags' is among the prune_keys (i.e. the fields to be culled during pruning). That I don't know how to explain; 'tags' was among the prune_keys in the very first version of this client., and it just didn't cause a problem because the pruning implementation was always broken.

In any case, I highly recommend upgrading to a 1.x.x client. I know it's a pain to deal with such a major breaking change, but odd behaviors like this in the v0 clients are really what motivated the rewrite.

I won't push a patched v0.x client, but if you want to get the v0.5.3 behavior (where tags weren't pruned out because pruning didn't work) in v0.5.4, I'd recommend setting prune=False in your query parameters. That should do the trick.