-
Notifications
You must be signed in to change notification settings - Fork 9
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 #132 removing used SASlength from functions #216
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #216 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 14 13 -1
Lines 636 627 -9
=========================================
- Hits 636 627 -9 ☔ View full report in Codecov by Sentry. |
…s-research/xportr into 136-unused-xpt-validate-attributes
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 for implementing this. I've included a few comments for your review.
R/utils-xportr.R
Outdated
@@ -215,7 +215,7 @@ xpt_validate <- function(data) { | |||
} | |||
|
|||
# 3.0 VARIABLE TYPES ---- | |||
types <- tolower(extract_attr(data, attr = "SAStype")) | |||
types <- tolower(extract_attr(data, attr = "type")) |
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.
The xport_type()
function does not add any attributes, so I suggest to remove the type check.
@@ -17,11 +17,9 @@ | |||
#' @details | |||
#' * Variable and dataset labels are stored in the "label" attribute. | |||
#' |
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.
We can keep the lines for the SAS length and replace 'SASlength' by 'width' :
#' * SAS length are stored in the "width" attribute.
tests/testthat/test-utils-xportr.R
Outdated
attr(df$A, "SAStype") <- "integer" | ||
attr(df$B, "SAStype") <- "list" | ||
attr(df$A, "type") <- "integer" | ||
attr(df$B, "type") <- "list" |
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.
Test to be removed if xpt_validate()
is updated to remove type check
@@ -17,11 +17,9 @@ | |||
#' @details | |||
#' * Variable and dataset labels are stored in the "label" attribute. | |||
#' | |||
#' * SAS length are stored in the "SASlength" attribute. | |||
#' | |||
#' * SAS format are stored in the "SASformat" attribute. |
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.
The name for the SAS format attribute is 'format.sas'. Maybe we should also update 'SASformat' to 'format.sas', what do you think?
R/utils-xportr.R
Outdated
#' | ||
#' @return Character vector of attributes with column names assigned | ||
#' @noRd | ||
extract_attr <- function(data, attr = c("label", "format.sas", "SAStype", "SASlength")) { | ||
extract_attr <- function(data, attr = c("label", "format.sas", "type")) { |
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.
There is no "type" attribute added by the function xport_type()
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.
No further comments besides Celine's, thanks both for the work on this!
@sadchla-codes Are you able to take care of the rest of those comments? |
Yes |
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.
Looks good to me!
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
(descriptions of changes)
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.