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

chore: R CMD check fixes #42

Merged
merged 14 commits into from
Sep 6, 2023
Merged

chore: R CMD check fixes #42

merged 14 commits into from
Sep 6, 2023

Conversation

maelle
Copy link
Collaborator

@maelle maelle commented Aug 28, 2023

Notes

## Errors

cynkra/constructive#224

## Warnings

method

weirdly this only happens on one system now?!

* checking S3 generic/method consistency ... WARNING
Warning: declared S3 method 'filter.duckplyr_df' not found
See sectionGeneric functions and methodsin theWriting R
Extensionsmanual.

I'm a bit surprised since I see the function, I'll compare with another one, select.

The NAMESPACE has S3method(filter,duckplyr_df) and S3method(select,duckplyr_df) so no difference there.

vctrs::s3_register("dplyr::select", "data.frame", duckplyr:::select.duckplyr_df)

vs

vctrs::s3_register("dplyr::filter", "data.frame", duckplyr:::filter.duckplyr_df)

nothing yet

@maelle
Copy link
Collaborator Author

maelle commented Aug 28, 2023

This does not work (tests start failing, although I define %:::% as :::

files <- fs::dir_ls("R", glob = "*.R")

fix_line <- function(line) {
  stringr::str_replace(
    line,
    "((?<=dplyr:::)[a-zA-Z\\_\\.]*)",
    "dplyr%:::%\\1"
  ) |>
    stringr::str_remove("dplyr:::")
}

re_write <- function(path) {
  lines <- brio::read_lines(path)
  lines <- purrr::map_chr(lines, fix_line)
  brio::write_lines(lines, path)
}

purrr::walk(files, re_write)

@@ -47,4 +47,4 @@ jobs:
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
error-on: '"warning"'
error-on: '"note"'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@krlmlr krlmlr marked this pull request as ready for review September 6, 2023 21:39
@krlmlr krlmlr changed the title R CMD check fixes chore: R CMD check fixes Sep 6, 2023
@krlmlr krlmlr merged commit dd53e6f into tidyverse:main Sep 6, 2023
5 checks passed
@krlmlr
Copy link
Member

krlmlr commented Sep 6, 2023

Thanks! The other changes come in separate PRs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants