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

Bug: print_ard_condition() errors if message contains curly brackets #309

Closed
ddsjoberg opened this issue Aug 31, 2024 · 0 comments · Fixed by #310
Closed

Bug: print_ard_condition() errors if message contains curly brackets #309

ddsjoberg opened this issue Aug 31, 2024 · 0 comments · Fixed by #310
Labels

Comments

@ddsjoberg
Copy link
Collaborator

In the current implementation, whatever is in the curly brackets is trying to be glue evaluated.

library(cards)

# add a warning message that has curly brackets in it
ard <- ard_continuous(ADSL, variables = AGEGR1) |> 
  dplyr::mutate(warning = ifelse(dplyr::row_number() == 1L, list("warning with {curly} brackets"), warning))

ard |>
  print_ard_conditions()
#> The following warnings were returned during `print_ard_conditions()`:
#> Error in "lapply(text, glue_cmd, .envir = .envir)": ! Could not evaluate cli `{}` expression: `curly`.
#> Caused by error in `eval(expr, envir = envir)`:
#> ! object 'curly' not found

Created on 2024-08-31 with reprex v2.1.1

ddsjoberg added a commit that referenced this issue Sep 1, 2024
#310)

**What changes are proposed in this pull request?**
* Bug fix in `print_ard_conditions()` and we can now print condition
messages that contain curly brace pairs. (#309)

**Reference GitHub issue associated with pull request.** _e.g., 'closes
#<issue number>'_
closes #309


--------------------------------------------------------------------------------

Pre-review Checklist (if item does not apply, mark is as complete)
- [ ] **All** GitHub Action workflows pass with a ✅
- [ ] PR branch has pulled the most recent updates from master branch:
`usethis::pr_merge_main()`
- [ ] If a bug was fixed, a unit test was added.
- [ ] Code coverage is suitable for any new functions/features
(generally, 100% coverage for new code): `devtools::test_coverage()`
- [ ] Request a reviewer

Reviewer Checklist (if item does not apply, mark is as complete)

- [ ] If a bug was fixed, a unit test was added.
- [ ] Run `pkgdown::build_site()`. Check the R console for errors, and
review the rendered website.
- [ ] Code coverage is suitable for any new functions/features:
`devtools::test_coverage()`

When the branch is ready to be merged:
- [ ] Update `NEWS.md` with the changes from this pull request under the
heading "`# cards (development version)`". If there is an issue
associated with the pull request, reference it in parentheses at the end
update (see `NEWS.md` for examples).
- [ ] **All** GitHub Action workflows pass with a ✅
- [ ] Approve Pull Request
- [ ] Merge the PR. Please use "Squash and merge" or "Rebase and merge".
@shajoezhu shajoezhu added the sme label Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants