Skip to content
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

Users cannot enter multiple HUCs or projects on import tab #190

Closed
cristinamullin opened this issue Dec 5, 2024 · 5 comments · Fixed by #193
Closed

Users cannot enter multiple HUCs or projects on import tab #190

cristinamullin opened this issue Dec 5, 2024 · 5 comments · Fixed by #193
Assignees

Comments

@cristinamullin
Copy link
Collaborator

Describe the bug

On the import tab, users should be able to enter more than one HUC (separated by a semicolon, for example: "03010201; 02070010") . Currently, only one can be entered and if multiple are it will crash the application.

In theory, the WQP accepts multiple with each separated by a semicolon ; in the WQP UI, but I couldn't it to work there either. Example: https://www.waterqualitydata.us/#huc=03010201%3B%2002070010&startDateLo=01-01-2022&startDateHi=01-01-2023&mimeType=csv&dataProfile=resultPhysChem&providers=NWIS&providers=STORET

Expected behavior

Users should be able to enter multiple HUC's.

@JamesBisese JamesBisese self-assigned this Dec 5, 2024
@JamesBisese
Copy link
Collaborator

I will need to

  1. Confirm that multiple HUCS work on WQP
  2. if they do work, debug error in TShiny
  3. Trap the error that is occurring and display message to user
    -- LOE 2 to 8 hours depending on how complex the error is.

@JamesBisese
Copy link
Collaborator

JamesBisese commented Dec 5, 2024

I am able to pull data using multiple HUCS. I tested using

$huc
[1] "02080203;02080205"

$startDate
[1] "2024-10-01"

$sampleMedia
[1] "Water" "water"

$providers
[1] "NWIS"   "STORET"

$endDate
[1] "2024-12-01"

I also cut-and-pasted your attempt - trying to use your 2 HUC codes, and found the fatal error. I think it has to do with the space in your list of HUCS. You have a space in there and that is crashing WQP.

We can clean the user input by stripping spaces from the user input.

$huc
[1] "03010201; 02070010"

$startDate
[1] "2024-10-01"

$sampleMedia
[1] "Water" "water"

$providers
[1] "NWIS"   "STORET"

$endDate
[1] "2024-12-01"

GET: https://www.waterqualitydata.us/data/Result/search?huc=03010201%3B%2002070010&startDateLo=10-01-2024&sampleMedia=Water%3Bwater&providers=NWIS%3BSTORET&startDateHi=12-01-2024&dataProfile=resultPhysChem&mimeType=csv
Request failed [400]. Retrying in 1 seconds...
Request failed [400]. Retrying in 1.4 seconds...
Bad Request (HTTP 400).299 WQP "The value of huc= 02070010 must match the format (?:[0-9]{12})|(?:[0-9]{10})|(?:[0-9]{8})|(?:(?:[0-9]{2}){1,3}\*?)"
Error: (converted from warning) Error in if: argument is of length zero

@cristinamullin
Copy link
Collaborator Author

A similar issue is occurring with project but the comma is the problem here. Not sure yet if this one should be a semicolon "AK164406;AK538329" or separated "AK164406" "AK538329. I think the latter.

$project
[1] "AK164406,AK538329"

Note: there was also an issue with entering multiple Characteristic and CharacteristicType but these have been resolved the same way as samplemedia and sitetype:
6804bbe
ad04a79

@cristinamullin cristinamullin changed the title Users cannot enter multiple HUCs on import tab Users cannot enter multiple HUCs or projects on import tab Dec 5, 2024
@cristinamullin
Copy link
Collaborator Author

@JamesBisese resolved the huc space issue (line 420 in mod_query_data_server: https://github.com/USEPA/TADAShiny/pull/191/files).

@cristinamullin
Copy link
Collaborator Author

I addressed the issue with projects here: #193

This issue can now be closed

@cristinamullin cristinamullin linked a pull request Dec 6, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants