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

GH-37994: [R] Create wrapper functions for the CSV*Options classes #37995

Merged
merged 15 commits into from
Oct 9, 2023

Conversation

thisisnic
Copy link
Member

@thisisnic thisisnic commented Oct 3, 2023

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

@thisisnic thisisnic requested a review from paleolimbot as a code owner October 3, 2023 16:06
@github-actions
Copy link

github-actions bot commented Oct 3, 2023

⚠️ GitHub issue #37994 has been automatically assigned in GitHub to PR creator.

@github-actions github-actions bot added Component: R awaiting committer review Awaiting committer review labels Oct 3, 2023
@thisisnic
Copy link
Member Author

@github-actions crossbow submit preview-docs

@github-actions
Copy link

github-actions bot commented Oct 3, 2023

Revision: 1182e24

Submitted crossbow builds: ursacomputing/crossbow @ actions-fca1748e2e

Task Status
preview-docs Github Actions

@thisisnic
Copy link
Member Author

thisisnic commented Oct 4, 2023

We should rebase this after #38001 merges and incorporate changes from that PR too

r/R/csv.R Outdated Show resolved Hide resolved
@github-actions github-actions bot added awaiting changes Awaiting changes awaiting change review Awaiting change review and removed awaiting committer review Awaiting committer review awaiting changes Awaiting changes labels Oct 4, 2023
Copy link
Member

@paleolimbot paleolimbot left a 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
Copy link
Member

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.

Copy link
Member

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)

Copy link
Member Author

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 `","`)
Copy link
Member

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, updated now!

@github-actions github-actions bot added awaiting changes Awaiting changes awaiting change review Awaiting change review and removed awaiting change review Awaiting change review awaiting changes Awaiting changes labels Oct 6, 2023
@thisisnic
Copy link
Member Author

@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 parse_options to open_*_dataset() functions - I needed it for my examples here and noticed it was missing.

Copy link
Member

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

r/R/csv.R Show resolved Hide resolved
@github-actions github-actions bot added awaiting changes Awaiting changes awaiting review Awaiting review and removed awaiting change review Awaiting change review labels Oct 7, 2023
@thisisnic thisisnic force-pushed the GH-37994_csv_options branch from 3f6ff03 to 294ede4 Compare October 8, 2023 15:15
@github-actions github-actions bot added awaiting review Awaiting review and removed awaiting review Awaiting review awaiting changes Awaiting changes labels Oct 8, 2023
Copy link
Member

@paleolimbot paleolimbot 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!

@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting review Awaiting review labels Oct 9, 2023
@thisisnic thisisnic merged commit 293819c into apache:main Oct 9, 2023
10 of 11 checks passed
@thisisnic thisisnic removed the awaiting merge Awaiting merge label Oct 9, 2023
@conbench-apache-arrow
Copy link

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.

JerAguilon pushed a commit to JerAguilon/arrow that referenced this pull request Oct 23, 2023
…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]>
loicalleyne pushed a commit to loicalleyne/arrow that referenced this pull request Nov 13, 2023
…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]>
dgreiss pushed a commit to dgreiss/arrow that referenced this pull request Feb 19, 2024
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[R] Create wrapper functions for the CSV*Options classes
3 participants