-
Notifications
You must be signed in to change notification settings - Fork 50
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
fix: fixed an issue of a solitary NA as var_labels passed to analyze #965
Conversation
✅ All contributors have signed the CLA |
I have read the CLA Document and I hereby sign the CLA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @kpagacz for this! I think it makes sense to do it with one line at source instead of spreading it around, also considering that NA_character_ is fine. Could you just add a comment and a regression test for this? Also add NEWS, thanks!! ;)
Added the comment, test and the NEWS entry. Ready for re-review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @kpagacz! Great work
Hi @kpagacz , thanks a lot for the PR! great change! thanks a lot. no concerns from my side. I have a question to @pawelru , I was wondering if r-deps allow us to trigger downstream package checks before we merge?
i was wondering should we do the same by modifying the github action check.yml to trigger the downstream cicd tests? |
Please have a look at the revdepcheck GitHubAction and it's The goal was to allow devs to trigger the runs on request. Currently it's done like this: Actions -> Scheduled -> Run Workflow -> pick branch & pick "revdepcheck". I just noticed that for some reason I cannot pick the branch from fork / I cannot trigger the run from the fork. Hence I would suggest to run it interactively or run it in from CMD ( |
@pawelru , the job has failed in https://github.com/insightsengineering/rtables/actions/runs/12022262134/job/33514173793, due to scda.test would require tern to get a newer version, I m going to test another idea. see, https://github.com/insightsengineering/rtables/actions/runs/12022633473, updated scda.test, remotes to tern@main hi @kpagacz , sorry to keep this PR open, please let me know if this is a blocker for your work. thanks! |
I looked into the logs and everything looked good until
Can we remove this from |
This is not blocking for anyone on our team because we just work around it by assigning the labels to all the variables we pass to teal. So no rush! |
Signed-off-by: Joe Zhu <[email protected]>
Kpagacz main
I merged your PR. Thanks a lot for taking this up! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! thanks a lot @kpagacz
Here's an MRE of the issue:
which results in:
R treats a single NA as a logical vector, which fails the validation on the
Split
object, which requires the labels slot to be a character vector. This issue does not happen when the var_labels array contains other character values. The untyped NAs are cast to characters automatically in this case.This also does not happen in this scenario:
What prompted this is the investigation of what happens when launching the below teal application:
This application errors out with the above rtables error, because the application tries to evaluate the below:
This fails due to solitary NA in the
analyze_vars
call, passed directly tortables::analyze
.Unfortunately, trying to fix the issue on the
teal.modules.clinical
side is unsuccessful due to howsubstitute
treats such solitary NAs (basically casting them from the explicit NA_character_ to normal NA). The fix could be made on the level oftern
, but it seems silly not to go to the bottom, which isrtables::analyze
, and deeper - AnalyzeMultiVars, etc...Let me know if this makes sense for you or if you would like me to take a different route.