New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix handling of fq #36
Conversation
Currently fq is completely broken: 1. It requires start to be set for no reason 2. It fails because match.arg will always fail since no args are given in the function This fix does three things: 1. Test for fq rather than start 2. get rid of the match.arg -- since fq is super flexible, we can't use that here 3. enclose the fq query in I to prevent URL encoding (see r-lib/httr#540 (comment) ). Otherwise, httr encodes colons, square brackets and + and e.g. the [example for date range search](http://guides.dataverse.org/en/latest/api/search.html#date-range-search-example) breaks
@wibeasley let me know if you need anything else on this (no particular rush on my end, but FWIW, I've been running this successfully from my fork) |
thanks @adam3smith for the nudge.I like your fix and love that you included a test. Do you mind adding a few more tests, such as
I was planning to add them, but think you're a better fit. I've never used this parameter --and didn't even know what it was when I read your PR. I am anxious to incorporate your PR and other son, before changes to the master require the PRs to merge the master's changes into the branches before they can be merged back into the master. |
Will do -- might take me a couple of days, but shouldn't be a problem. |
@wibeasley working on this -- I've added the zero hits test but I'm actually not quite clear what you're referring to with the two 3+ queries. (Note that the dataverse API actually allows for multiple fq parameters in a single query, but the package (or maybe even R?) balks at having a parameter repeated. iIf that's OK I'd like to not address that for now since it may require more substantial code changes) |
@adam3smith, (I'm looking at Advanced Search Example docs now. I've never used this, so feel free to tell me that I not making sense.)
maybe:
ahh, I didn't know that, so scratch that 2nd checkbox. Thanks for correcting me.
Sure. And thanks for adding the zero-hits test. |
got it, done -- please take a look & let me know if anything else is missing. The way I understand fq, it's mostly used for the facets available on the left, but there are some additional options such as the |
@adam3smith, looks great. Thanks again. |
If it helps, "fq" is for "filter query". The idea is that first you do a query with "q". Under the covers we pass a "*" (wildcard) as "q" when you are browsing Dataverse. Then you use "fq" to refine or limit or narrow down your original "q". That is to say, there is always a "q" but the "fq" is optional. And as you have observed, you can have as many "fq"s as you want. You can only have one "q". I hope this makes sense. You can also use boolean operators and such in both "q" and "fq" if you want. And operators like "TO" that @adam3smith is using with |
Just a note in case this becomes a recurring problem. The two Ubuntu builds associated with this PR failed yesterday. I clicked 'Restart Job' on them today and they passed (one of them needed a 3rd try. Because I restarted it, I don't think that failing history is available anymore to insepct. It had nothing to do with any R code in our repo. Apparently just some server timeout with the gpg key. I'd been having similar trouble (with similar solutions) on another R package I've been developing today. But according to the Travis status, they've been 100% operational. https://www.traviscistatus.com/ https://travis-ci.org/IQSS/dataverse-client-r/jobs/633831998? Error thrown yesterday:
Error thrown today
|
@wibeasley @adam3smith when one of you has a minute can you please create an issue over at https://github.com/IQSS/dataverse-jenkins/issues to add a job for dataverse-client-r to https://jenkins.dataverse.org ? I love, love, love Travis but it would be nice to have another view into if tests are passing or not. Belt and suspenders. 😄 |
Currently fq is completely broken:
This fix does three things:
Please ensure the following before submitting a PR:
/R
not/man
and rundevtools::document()
to update documentation/tests
for any new functionality or bug fixR CMD check
runs without error before submitting the PR