Closed jsowder closed 4 years ago
Sorry about the force push, I was just cleaning up the history a bit
@jsowder, I am getting one failure when running tests. The error message from the test is not that informative, but when I try to run the function on it's own:
get_electronic_filing_byDate(2016, 2016, '01', '10', '31')
I get
Error in page - 1 : non-numeric argument to binary operator
The reason the test fails is that it expects a 500-code warning, not an error.
Can you reproduce?
Also the function
get_congressional_statement_by_member
already has a offset parameter (for some reason...), we should unify the two approaches. (I am fine with "pages").
@jsowder, I am getting one failure when running tests. The error message from the test is not that informative, but when I try to run the function on it's own:
get_electronic_filing_byDate(2016, 2016, '01', '10', '31')
I get
Error in page - 1 : non-numeric argument to binary operator
The reason the test fails is that it expects a 500-code warning, not an error.
Can you reproduce?
Yes, I was able to reproduce and I just committed to a change in the test. The final argument was meant to be an erroneous API Key, but instead was being passed to page.
And just removed the old offset parameter! I had already adjusted the function, but hadn't removed the parameter definition above.
Adds page = 1 as an argument to all relevant functions, which is passed as an argument to pp_query.
pp_query then calculates the offset and appends it to the URL. This appending accounts for whether there is an existing query in the URL.
pages are increments of 20 as accepted by the ProPublica APIs.
page = 1 means offset of 0. Nothing is appended to the URL.
page = 2 means offset of 20
page = 3 means offset of 40
etc.