-
Notifications
You must be signed in to change notification settings - Fork 10
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
Closes #219 Uses {withr}
to create temporary files and graceful handling of Suggests
#220
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #220 +/- ##
===========================================
- Coverage 100.00% 99.82% -0.18%
===========================================
Files 14 12 -2
Lines 665 583 -82
===========================================
- Hits 665 582 -83
- Misses 0 1 +1 ☔ View full report in Codecov by Sentry. |
withr::local_file
to create temporary files that are deletedwithr::local_file
to create temporary files
@@ -618,7 +618,9 @@ test_that("xportr_*: Domain is kept in between calls", { | |||
# Divert all messages to tempfile, instead of printing them | |||
# note: be aware as this should only be used in tests that don't track | |||
# messages | |||
withr::local_message_sink(tempfile()) | |||
if (requireNamespace("withr", quietly = TRUE)) { |
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.
ℹ️ Following CRAN guidelines: https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Suggested-packages
Although {withr} is a required secondary depencency, so (for now) it's very difficult to run tests without having {withr} installed
{vroom} and {tidyselect} import {withr}
withr::local_file
to create temporary files{withr}
to create temporary files
data_to_save(), | ||
domain = "data_to_save", | ||
path = withr::local_file("xyz.xpt"), | ||
metadata = data.frame( | ||
dataset = "data_to_save", | ||
label = "çtestç" | ||
) | ||
) | ||
), | ||
"`label` cannot contain any non-ASCII, symbol or special characters" |
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.
ℹ️ Problem detected with missing test coverage. (recursive call of xportr_write
)
ℹ️ Adds exact error that is expected (test was passing, but outputing the wrong error)
note: I can separate this from this PR, just let me know if this is too out of scope
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.
@EeethB was this the same as the testing issue in the other PR - with the lack of coverage?? or separate issue? IF not, @averissimo I think this can be handled in this PR.
I like the word graceful in the PR titile
{withr}
to create temporary files{withr}
to create temporary files and graceful handling of Suggests
Postponing until pending PRs are merged |
Should we address this comment about |
@averissimo I think we can finish this one off now that most of the function work is done. We got a few merge conflicts. @sadchla-codes is working on #223 so I think there might be some overlap between the two issues. |
* origin/main: (199 commits) [skip actions] Bump version to 0.3.1.9018 corrects typo chore: #221 update spelling ci: remove admiral string that was helping identifying action on UI revert deliberate errors Trigger CI ci: reusing workflows from admiralci [skip actions] Bump version to 0.3.1.9017 [skip actions] Bump version to 0.3.1.9016 Update pull_request_template.md chore: removed duplicated documentation section in news chore: breaking news - turn to channel 6! docs: #192 remove non-user functions from reference files docs: #230 #188 PR template tweaks [skip actions] Bump version to 0.3.1.9015 lint:reduce lenght of line Reduce line length less than 120 characters Update NEWS.md change argument name to length_source Change argument name to source_length in test-length ...
Thank you for your Pull Request!
We have developed a Pull Request template to aid you and our reviewers. Completing the below tasks helps to ensure our reviewers can maximize their time on your code as well as making sure the xportr codebase remains robust and consistent.
The scope of
{xportr}
{xportr}
's scope is to enable R users to write out submission compliantxpt
files that can be delivered to a Health Authority or to downstream validation software programs. We see labels, lengths, types, ordering and formats from a dataset specification object (SDTM and ADaM) as being our primary focus. We also see messaging and warnings to users around applying information from the specification file as a primary focus. Please make sure your Pull Request meets this scope of {xportr}. If your Pull Request moves beyond this scope, please get in touch with the{xportr}
team on slack or create an issue to discuss.Please check off each task box as an acknowledgment that you completed the task. This checklist is part of the Github Action workflows and the Pull Request will not be merged into the
devel
branch until you have checked off each task.Changes Description
tmpfile
andtmpdir
withr::local_file
/withr::local_tempfile
Task List
styler
package and functions to style files accordingly.devtools::document()
so all.Rd
files in theman
folder and theNAMESPACE
file in the project root are updated appropriatelypkgdown::build_site()
and check that all affected examples are displayed correctly and that all new/updated functions occur on the "Reference" page.vbump.yaml
CI.