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

Who is responsible for data quality? App dev or app user? #198

Open
chlebowa opened this issue Nov 28, 2022 · 2 comments
Open

Who is responsible for data quality? App dev or app user? #198

chlebowa opened this issue Nov 28, 2022 · 2 comments

Comments

@chlebowa
Copy link
Contributor

chlebowa commented Nov 28, 2022

These validation statements in tm_g_ae_oview prevent the plot from being displayed.

validate(need(is.factor(ANL[[input$arm_var]]), "Selected arm variable must be a factor." ))
validate(need(nlevels(ANL[[input$arm_var]]) > 1, "Arm needs to have at least 2 levels"))
validate_has_data(ANL, min_nrow = 10)

An app user may not even know what a factor or a level is. They don't know the data types of variables (at least in the example app). If the app doesn't work because there is not enough rows in ANL, they can't change anything to obtain their desired visualization.

Are these safeguards not the responsibility of the app/module developer?

@BLAZEWIM
Copy link
Contributor

BLAZEWIM commented Nov 28, 2022

I would say that in this particular case:

validate(need(is.factor(ANL[[input$arm_var]]), "Selected arm variable must be a factor." )) - agree, this depends on an app developer + the info could be more user-friendly

validate(need(nlevels(ANL[[input$arm_var]]) > 1, "Arm needs to have at least 2 levels")) - ok, someone could filter out one level and be surprised why the output is not appearing

validate_has_data(ANL, min_nrow = 10) - again one might filter out too much, but why 10 is minimum, not 1?

So while introducing shinyvalidate, we could do a re-evaluation why some tests are needed in the first place. On the other hand, some of them might have some history that we are not aware of, so some supervision on the process would be needed. Anyway, we do like reducing the number of lines of code.

@chlebowa chlebowa changed the title Whose is responsible for data quality? App dev or app user? Who is responsible for data quality? App dev or app user? Nov 29, 2022
@gogonzo
Copy link
Contributor

gogonzo commented Dec 14, 2022

This is a good issue. I thought I know the answer and I was sure of my opinion but not anymore. Since module can be included in any app, where user could have a control over various thing (imagine something like a teal). Then nobody can be sure what kind of data will be passed reactively to the module. What we can assume:

  • App developer knows the data
  • App developer knows that in teal, user might use filter-panel.
  • Filter panel filters rows only, doesn't do any changes in column classes not it doesn't drop factor levels.
  • Unique character/numeric values might be different than expectations of the app-developer as app-user might use any filter.
  • What about other than teal "frameworks"?

Considering above, I'm not necessary sure whether we can use stopifnot() in the tlg-modules or should we stick to the validate always.

I'd like to continue this discusssion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants