You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is that the stats function in the USGS RDB module is the only one that sends a base URL and a dict of parameters to Requests and lets that package construct the full URL. All of the other functions construct the full URL themselves.
The result is that the stats function is the only one that doesn't know the full URL until after Requests returns a response.
The basic fix is to initially print just the base URL; once the response is returned print the response.url.
If the USGS returns a non-200 code, it doesn't raise an error, hf just prints the error screen the the USGS sends, and then hf returns the response. So you can still print the response.url
So, change the end of line 641 to {response.url} instead of {url}.
Issue #118 the hf.stats function prints the incorrect url when it requests data. This fix will print the correct URL. None of the other functions in this module are affected.
Description
When I added the 'statYearType' parameter to a request for annual statistics, it printed the wrong URL but still returned something.
What I Did
Retrieved annual statistics for site #01542500 from https://waterservices.usgs.gov/nwis/stat//
Although it prints the wrong URL, it still seems to return the correct data.
The text was updated successfully, but these errors were encountered: