Open arvi1000 opened 1 month ago
I see failing tests, but it appears to failing on this line, which asserts that the following should return 50 rows:
a <- epmc_db("12368864", db = "uniprot", limit = 50)
However in the current cran version, it seems to only return 10 rows:
> library(europepmc)
> epmc_db("12368864", db = "uniprot", limit = 50)
10 records found. Returning 10
So perhaps this test needs an update and the change in the PR is not the issue? I welcome a reviewer's comments, thanks
Looking at the API directly, 10 does seem to be the current correct number of hits returned. Using source = 'med' as that's the default and nothing explicit is passed in the test line
I'm happy to update the test as part of this PR if that suits (e.g. limit = 7 and then test that 7 records come back)
I changed the test mentioned in the comment above. I also updated the test relating to zero result queries, since they now return blank tibbles with hit_count attr = 0 instead of NULL. So now all tests pass
This addresses issue 56, and now sets the hit_count attribute even when no results found. Note that we can't return a NULL result anymore, since NULL can't have attributes, so instead we return an empty tibble