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

Fatal error when uploading a 'Progress File' #181

Open
5 tasks
JamesBisese opened this issue Nov 27, 2024 · 1 comment
Open
5 tasks

Fatal error when uploading a 'Progress File' #181

JamesBisese opened this issue Nov 27, 2024 · 1 comment
Assignees

Comments

@JamesBisese
Copy link
Collaborator

JamesBisese commented Nov 27, 2024

Describe the bug

When a user loads a Progress file and then changes tabs to 'Filter' a fatal error occurs "Input object must be of class 'data.frame'"

To Reproduce

Steps to reproduce the behavior:

1. Load excel data file ()
tada_output_utah_10rows.xlsx
, then download 'Working Dataset' zip file.

2. Uncompress zip file on local disk

3. Open TADAShiny and go to the Load tab panel. Scroll down to the " Optional: Upload Progress File" section of the panel

4. Load the progress file (the .RData file that was in the zip file)

5. In TADAShiny, click the tab '4. Filter'

6. See error
In the users browser the screen is grey and the app is unresponsive (the error condition when the app stops)
image

In the RStudio console there is this error

Error: (converted from warning) Error in TADA_CheckType: Input object must be of class 'data.frame'

Please include your Water Quality Portal data query inputs from the Load
data tab:

The error is occurring because the argument being tested is not a 'data.frame'

library(EPATADA)
file: Utilies.R

TADA_CheckType <- function(arg, type, paramName) {
  if ((type %in% class(arg)) == FALSE) {
    # if optional parameter name not specified use arg in errorMessage
    if (missing(paramName)) {
      paramName <- arg
    }
    errorMessage <- paste(paramName, " must be of class '", type, "'", sep = "")
    return(stop(errorMessage))
  }
}

Debugging (by inserting a browser() statement in the function above and then running 
document("C:/Data_and_Tools/tada/working/app/canonical/EPATADA"))

Called from: TADA_CheckType(.data, "data.frame", "Input object")
Browse[1]> typeof(arg)
[1] "list"

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

Reminders for TADA contributors addressing this issue

Bug fixes should include the following work:

  • Create or edit the code.

  • Document all code using line/inline and/or multi-line/block comments
    to describe what is does.

  • Create or edit tests in tests/testthat folder to help prevent and/or
    troubleshoot potential future issues.

  • If your code edits impact other functionality in the shiny
    app, ensure those are updated as well.

  • Run styler::style_pkg(), devtools::document(), and devtools::check()
    and address any new notes or issues before creating a pull request.

@JamesBisese
Copy link
Collaborator Author

Now I'm not so sure I understand the error condition. I got it to work correctly using the Utak 15k record example data. (Which must be loading from a .RData file or similar in the backend).
I need to rework the test case. It probably has something to do with the 'Excel' uploads rather that the way the .RData file is generated. Something isn't the same in the way they are processed.

@JamesBisese JamesBisese self-assigned this Dec 5, 2024
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