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

NA MeasureQualifierCode #182

Open
cristinamullin opened this issue Dec 2, 2024 · 2 comments
Open

NA MeasureQualifierCode #182

cristinamullin opened this issue Dec 2, 2024 · 2 comments
Assignees

Comments

@cristinamullin
Copy link
Collaborator

Test if this is now resolved by USEPA/EPATADA#548


There is a bug where the .data$MeasureQualifierCode 'NA' values are created as 'logicals' rather than 'character'. I am struggling with that in the Upload dataset and Upload Progress File functionality. Data imported into TADAShiny via the Run Query is successful, but from either Upload path it crashing around the handling of the 'MeasureQualifierCode'.

I think it is caused by the values being 'logicals' using the Upload paths, but 'character' using the Run Query path.
Then the 'strsplit()' function crashes because there is no way to 'split' a logical.

Here is my console showing the difference

> TADAShiny::run_app()

Listening on http://127.0.0.1:4811
[1] "Loading user excel data file: C:\\Users\\JAMES~1.BIS\\AppData\\Local\\Temp\\RtmpekUeWE/05a406c9a22e3b45742b867f/0.xlsx"
Called from: EPATADA::TADA_AutoClean(tadat$uploaded_excel_df)
Browse[1]> typeof(.data$MeasureQualifierCode)
[1] "logical"
Browse[1]> Q
> TADAShiny::run_app()

Listening on http://127.0.0.1:4811
[1] "Downloading WQP query results. This may take some time depending upon the query size."
$statecode
[1] "US:01"

$startDate
[1] "2024-09-26"

$sampleMedia
[1] "Water" "water"

$providers
[1] "STORET"

$endDate
[1] "2024-10-26"

GET: https://www.waterqualitydata.us/data/Result/search?statecode=US%3A01&startDateLo=09-26-2024&sampleMedia=Water%3Bwater&providers=STORET&startDateHi=10-26-2024&dataProfile=resultPhysChem&mimeType=csv
NEWS: Data does not include USGS data newer than March 11, 2024. More details:                                                                                              
https://doi-usgs.github.io/dataRetrieval/articles/Status.html
GET: https://www.waterqualitydata.us/data/Station/search?statecode=US%3A01&startDateLo=09-26-2024&sampleMedia=Water%3Bwater&providers=STORET&startDateHi=10-26-2024&mimeType=csv
GET: https://www.waterqualitydata.us/data/Project/search?statecode=US%3A01&startDateLo=09-26-2024&sampleMedia=Water%3Bwater&providers=STORET&startDateHi=10-26-2024&mimeType=csv
NEWS: Data does not include USGS data newer than March 11, 2024. More details:                                                                                              
https://doi-usgs.github.io/dataRetrieval/articles/Status.html
[1] "Data successfully downloaded. Running TADA_AutoClean function."
Called from: TADA_AutoClean(TADAprofile)
Browse[1]> typeof(.data$MeasureQualifierCode)
[1] "character"
Browse[1]> 
@JamesBisese JamesBisese self-assigned this Dec 5, 2024
@JamesBisese
Copy link
Collaborator

JamesBisese commented Dec 5, 2024

I found and made a different fix during other work. I need to understand Christina's work and see if it is the same fix. 2 hours

@JamesBisese
Copy link
Collaborator

JamesBisese commented Dec 27, 2024

The initial error is no longer occurring. Now a new error and fatal condition happens further along.

I created a new issue

Fatal error when uploading XLSX file "object 'TADA.MultipleOrgDupGroupID' not found"
#199

Load a dataset created from TADA Shiny using the export function.

Click on tab 1. Load

Scroll down to Option C: Upload dataset and load dataset

(use file attached)
tada_output_ts241223103324.xlsx

Data loads without error

Click on tab 3. Flag

Click on button 'Run Tests'. Screen is frozen and application dies

Error: (converted from warning) Error in dplyr::mutate: ℹ In argument: `TADA.MultipleOrgDuplicate = ifelse(is.na(TADA.MultipleOrgDupGroupID), "N", "Y")`.
Caused by error:
! object 'TADA.MultipleOrgDupGroupID' not found

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

No branches or pull requests

2 participants