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

Issue ##438 - Add tests to check existing data.table functions work with data.frames #799

Merged
merged 2 commits into from May 12, 2024

Conversation

nikosbosse
Copy link
Contributor

Description

This PR closes #438.

This PR adds additional tests to make sure that all exported functions that accept a data.table also work with a data.frame. I simply went through a list of the functions and added tests.

I got the list of functions to check as such (thanks, GPT):

exported_functions <- ls("package:scoringutils")
functions_with_data_arg <- character(0) 
for (func_name in exported_functions) {
  func_args <- suppressWarnings(formals(get(func_name)))
  if (!is.null(names(func_args)) && names(func_args)[1] == "data") {
    functions_with_data_arg <- c(functions_with_data_arg, func_name)
  }
}
functions_with_data_arg

Checklist

  • My PR is based on a package issue and I have explicitly linked it.
  • I have included the target issue or issues in the PR title as follows: issue-number: PR title
  • I have tested my changes locally.
  • I have added or updated unit tests where necessary.
  • I have updated the documentation if required.
  • I have built the package locally and run rebuilt docs using roxygen2.
  • My code follows the established coding standards and I have run lintr::lint_package() to check for style issues introduced by my changes.
  • I have added a news item linked to this PR.
  • I have reviewed CI checks for this PR and addressed them as far as I am able.

@seabbs seabbs enabled auto-merge (squash) May 6, 2024 16:06
@seabbs seabbs merged commit 110502d into main May 12, 2024
9 checks passed
@seabbs seabbs deleted the check-df branch May 12, 2024 13:57
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.

Testing: Test everything that's user-facing with a data.frame instead of a data.table
2 participants