Skip to content

WDFN-956 - Change IV data source to sensor things API

Bucknell, Mary S. requested to merge mbucknell/waterdataui:wdfn-956 into main

Before making a pull request

  • Put the appropriate EXEMPT flag if needed in the MR label (see https://practices.wma.chs.usgs.gov/practice/peer_code_review/)
  • Run all linters (make lint)
  • Run all tests (make test)
  • Update the changelog appropriately
  • If making a release, update code.json metadataLastUpdated and bump CHANGELOG.md to next version.

Description

Rather than fetch the data from the waterservices IV service, use sensor things API.

I opted to fetch each site individually to simplify what is already a fairly complicated query. Each site fetch is requested in parallel. I needed to handle that sensor things only returns 1000 observations at a time, so if there are more observations for a given site/parameterCode/isoDuration, the @iot.nextLink is used to fetch the remainder and the observations are appended to the original requests observations.

Another difference in the API handling is that sites that do not have data for the parameterCode return a 404, so no site meta data will be received for these sites.

The shape of the multi-site-store changed to mirror the data. Please note that we are not handling site/parameterCode combinations that have more than one Datastream (or methods in NWIS vocabulary). We will need to address this issue in a subsequent JIRA.

After making a pull request

  • If appropriate, put the link to the PR in the JIRA ticket
  • Assign someone to review unless the change is trivial
  • Check the accessibility CI step and fix or explain any issues.
Edited by Bucknell, Mary S.

Merge request reports