Conversation
…-documentation Polish function documentation
* Annotate code; flag 3 pre-existing bugs (not fixed) * Fix 3 bugs flagged in PR #30 review - read.simple.ssv(): add missing `asTibble` parameter (was referenced but never defined, erroring whenever wRownames = TRUE, the default). - write.simple.xlsx(): assignRownames() now uses its own argument `x` instead of the undefined `df`, fixing has_row_names = FALSE. - qs.2.table(): fix `qs:qread` -> `qs::qread`, use the real `stringi::stri_detect_regex` function, and define `base_filename`/ `out_path` on every branch so the function actually runs. Also adds `stringi` to Imports/NAMESPACE since it's now genuinely used. Co-authored-by: Abel Vertesy <5101911+vertesy@users.noreply.github.com> * Fix qs.2.table()'s excel branch crashing on a bare data.frame write.simple.xlsx() requires a list of sheets; qs.2.table() was passing the loaded table directly, which fails its is.data.frame(x)-per-element assertion. Wrap it in a list first. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Abel Vertesy <5101911+vertesy@users.noreply.github.com> Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
# Conflicts: # DESCRIPTION # R/ReadWriter.R # R/list.of.functions.in.ReadWriter.md # README.md # man/column.2.row.names.Rd # man/read.simple.csv.named.vector.Rd # man/read.simple.ssv.Rd Co-authored-by: vertesy <5101911+vertesy@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e43ad13b4b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| importFrom(readr,read_csv2) | ||
| importFrom(readr,read_delim) | ||
| importFrom(readr,read_tsv) | ||
| importFrom(stringi,stri_detect_regex) |
There was a problem hiding this comment.
Declare stringi in DESCRIPTION
Adding this namespace import makes stringi a direct package dependency, but DESCRIPTION still omits it from Imports. Consequently, clean installations do not guarantee that stringi is installed and R CMD check can reject the undeclared namespace dependency; add stringi to DESCRIPTION as required for new dependencies.
AGENTS.md reference: AGENTS.md:L13-L19
Useful? React with 👍 / 👎.
| assignRownames <- function(x) column.2.row.names(x, rowname_column = rowname_column, make_names = TRUE) | ||
| named_list <- lapply(named_list, assignRownames) |
There was a problem hiding this comment.
Preserve converted row names in the workbook
When has_row_names = FALSE, this now-working branch calls column.2.row.names(), which removes the selected identifier column and stores it as row names. The subsequent openxlsx::write.xlsx(..., rowNames = has_row_names) still passes FALSE, so those row names are also omitted and every identifier in the selected column is silently lost from the workbook; the converted row names need to be enabled for writing on this path.
Useful? React with 👍 / 👎.
|
could you please address the Codex code review suggestions in this PR? 1 When has_row_names = FALSE, this now-working branch calls column.2.row.names(), which removes the selected identifier column and stores it as row names. The subsequent openxlsx::write.xlsx(..., rowNames = has_row_names) still passes FALSE, so those row names are also omitted and every identifier in the selected column is silently lost from the workbook; the converted row names need to be enabled for writing on this path." I have to say, I I'm not fully confident about this suggestion because these functions have been working very robustly and reliably for years. I'm not sure if simply Codex is misunderstanding something about the operation of these functions, so please be careful when reviewing this comment. Consider the context and the intended output. If you decide to change, then please make it explicitly clear with simple English and examples what and how the output will change. 2 Adding this namespace import makes stringi a direct package dependency, but DESCRIPTION still omits it from Imports. Consequently, clean installations do not guarantee that stringi is installed and R CMD check can reject the undeclared namespace dependency; add stringi to DESCRIPTION as required for new dependencies." |
|
Claude finished @vertesy's task in 3m 16s —— View job Addressed both Codex review suggestions
1.
|
…on xlsx export - DESCRIPTION: add stringi to Imports, since R/ReadWriter.R now calls stringi::stri_detect_regex() and NAMESPACE already declares the importFrom. - write.simple.xlsx(): when has_row_names = FALSE, the identifier column is moved into row names via column.2.row.names() before writing. The final write.xlsx() call still passed the original has_row_names (FALSE) as rowNames, so those converted identifiers were dropped from the workbook. Track the post-conversion state separately (write_row_names) and pass that to write.xlsx() instead. Co-authored-by: Abel Vertesy <5101911+vertesy@users.noreply.github.com>
No description provided.