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

Closes #132 removing used SASlength from functions #216

Merged
merged 9 commits into from
Feb 5, 2024

Conversation

sadchla-codes
Copy link
Collaborator

@sadchla-codes sadchla-codes commented Jan 11, 2024

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 compliant xpt 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

  • The spirit of xportr is met in your Pull Request
  • Place Closes #<insert_issue_number> into the beginning of your Pull Request Title (Use Edit button in top-right if you need to update)
  • Summary of changes filled out in the above Changes Description. Can be removed or left blank if changes are minor/self-explanatory.
  • Code is formatted according to the tidyverse style guide. Use styler package and functions to style files accordingly.
  • Updated relevant unit tests or have written new unit tests. See our Wiki for conventions used in this package.
  • Creation/updated relevant roxygen headers and examples. See our Wiki for conventions used in this package.
  • Run devtools::document() so all .Rd files in the man folder and the NAMESPACE file in the project root are updated appropriately
  • Run pkgdown::build_site() and check that all affected examples are displayed correctly and that all new/updated functions occur on the "Reference" page.
  • Update NEWS.md if the changes pertain to a user-facing function (i.e. it has an @export tag) or documentation aimed at users (rather than developers)
  • Make sure that the pacakge version in the NEWS.md and DESCRIPTION file is same. Don't worry about updating the version because it will be auto-updated using the vbump.yaml CI.
  • Address any updates needed for vignettes and/or templates
  • Link the issue Development Panel so that it closes after successful merging.
  • Fix merge conflicts
  • Pat yourself on the back for a job well done! Much love to your accomplishment!

@sadchla-codes sadchla-codes marked this pull request as draft January 11, 2024 16:46
@sadchla-codes sadchla-codes linked an issue Jan 11, 2024 that may be closed by this pull request
@sadchla-codes sadchla-codes changed the title Closes #136 removing used SASlength from functions Closes #132 removing used SASlength from functions Jan 11, 2024
Copy link

codecov bot commented Jan 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (8f5fc66) 100.00% compared to head (d9f7417) 100.00%.
Report is 2 commits behind head on main.

❗ Current head d9f7417 differs from pull request most recent head 4905c62. Consider uploading reports for the commit 4905c62 to get more accurate results

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.
📢 Have feedback on the report? Share it here.

@sadchla-codes sadchla-codes marked this pull request as ready for review January 16, 2024 17:20
Copy link
Collaborator

@cpiraux cpiraux left a 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/length.R Show resolved Hide resolved
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"))
Copy link
Collaborator

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.
#'
Copy link
Collaborator

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.

attr(df$A, "SAStype") <- "integer"
attr(df$B, "SAStype") <- "list"
attr(df$A, "type") <- "integer"
attr(df$B, "type") <- "list"
Copy link
Collaborator

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.
Copy link
Collaborator

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")) {
Copy link
Collaborator

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()

Copy link
Collaborator

@EeethB EeethB left a 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!

@elimillera
Copy link
Member

@sadchla-codes Are you able to take care of the rest of those comments?

@sadchla-codes
Copy link
Collaborator Author

@sadchla-codes Are you able to take care of the rest of those comments?

Yes

Copy link
Collaborator

@cpiraux cpiraux left a 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!

@bms63 bms63 merged commit efdae82 into main Feb 5, 2024
11 checks passed
@bms63 bms63 deleted the 136-unused-xpt-validate-attributes branch February 5, 2024 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

xpt_validate attributes not used
5 participants