-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
GH-37994: [R] Create wrapper functions for the CSV*Options classes #37995
Conversation
|
@github-actions crossbow submit preview-docs |
Revision: 1182e24 Submitted crossbow builds: ursacomputing/crossbow @ actions-fca1748e2e
|
We should rebase this after #38001 merges and incorporate changes from that PR too |
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.
A few more thoughts!
r/R/csv.R
Outdated
#' - `skip_rows_after_names` is applied (if non-zero). | ||
#' | ||
#' @export | ||
csv_read_options <- CsvReadOptions$create |
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.
It may be worth considering doing this the other way around (include the body of the function here and assign CsvReadOptions$create <- csv_read_options
), although I know there is precedent for doing it this way elsewhere in the package.
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.
(reasoning being that if you change a constraint or some validation of an argument, it's more obvious that the docs should be updated too)
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.
That's a great idea, swapped now!
r/R/csv.R
Outdated
@@ -604,6 +647,22 @@ CsvParseOptions$create <- function(delimiter = ",", | |||
) | |||
} | |||
|
|||
#' CSV Parsing Options | |||
#' | |||
#' @param delimiter Field delimiting character (default `","`) |
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.
You might consider not putting the defaults here (because they are more likely to get out of sync with the code version of them below)?
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.
Good point, updated now!
@paleolimbot I've made some additional changes since your last review - the one I'm not sure whether I should be moving to another PR or leaving in this one is the addition of |
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.
I think it's fine to put that in this PR as long as you add a test to make sure that the value makes it through!
…th wrappers, reorganise what is mapped with what
3f6ff03
to
294ede4
Compare
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!
After merging your PR, Conbench analyzed the 6 benchmarking runs that have been run so far on merge-commit 293819c. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about 2 possible false positives for unstable benchmarks that are known to sometimes produce them. |
…ses (apache#37995) ### Rationale for this change It's hard to find the docs for the R6 objects for the CSV reading/writing etc options classes ### What changes are included in this PR? Create wrapper functions, which are more easily documented ### Are these changes tested? Yep, I've swapped some existing tests to using the wrappers ### Are there any user-facing changes? Yes * Closes: apache#37994 Authored-by: Nic Crane <[email protected]> Signed-off-by: Nic Crane <[email protected]>
…ses (apache#37995) ### Rationale for this change It's hard to find the docs for the R6 objects for the CSV reading/writing etc options classes ### What changes are included in this PR? Create wrapper functions, which are more easily documented ### Are these changes tested? Yep, I've swapped some existing tests to using the wrappers ### Are there any user-facing changes? Yes * Closes: apache#37994 Authored-by: Nic Crane <[email protected]> Signed-off-by: Nic Crane <[email protected]>
…ses (apache#37995) ### Rationale for this change It's hard to find the docs for the R6 objects for the CSV reading/writing etc options classes ### What changes are included in this PR? Create wrapper functions, which are more easily documented ### Are these changes tested? Yep, I've swapped some existing tests to using the wrappers ### Are there any user-facing changes? Yes * Closes: apache#37994 Authored-by: Nic Crane <[email protected]> Signed-off-by: Nic Crane <[email protected]>
Rationale for this change
It's hard to find the docs for the R6 objects for the CSV reading/writing etc options classes
What changes are included in this PR?
Create wrapper functions, which are more easily documented
Are these changes tested?
Yep, I've swapped some existing tests to using the wrappers
Are there any user-facing changes?
Yes