GH-38376 [R]: Add dimnames method to Dataset class #38377
Merged
Merged
Conversation
jonkeane
commented
Oct 20, 2023
| dim.Dataset <- function(x) c(x$num_rows, x$num_cols) | ||
|
|
||
| #' @export | ||
| dimnames.Dataset <- function(x) list(NULL, names(x)) |
Member
Author
There was a problem hiding this comment.
We might consider a message here that tells folks that the NULL doesn't mean there are none. But then again dbplyr doesn't do that!
Member
There was a problem hiding this comment.
I think copying dbplyr's behaviour is the best route. Is this already handled for Table?
Member
Author
There was a problem hiding this comment.
Yeah, it's not immediately obvious, but Tables all inherit ArrowTabular which has dimnames.ArrowTabular defined already
thisisnic
approved these changes
Oct 22, 2023
|
After merging your PR, Conbench analyzed the 6 benchmarking runs that have been run so far on merge-commit f489996. There was 1 benchmark result indicating a performance regression:
The full Conbench report has more details. |
loicalleyne
pushed a commit
to loicalleyne/arrow
that referenced
this pull request
Nov 13, 2023
…38377) ### Rationale for this change Add `dimnames` method so that things like `colnames(ds)` work out of the box on datasets. Inspired by dbplyr's lazy tbl implementation ### What changes are included in this PR? An additional `dimnames` method for Dataset objects ### Are these changes tested? Yes ### Are there any user-facing changes? Yes * Closes: apache#38376 Authored-by: Jonathan Keane <jkeane@gmail.com> Signed-off-by: Nic Crane <thisisnic@gmail.com>
dgreiss
pushed a commit
to dgreiss/arrow
that referenced
this pull request
Feb 19, 2024
…38377) ### Rationale for this change Add `dimnames` method so that things like `colnames(ds)` work out of the box on datasets. Inspired by dbplyr's lazy tbl implementation ### What changes are included in this PR? An additional `dimnames` method for Dataset objects ### Are these changes tested? Yes ### Are there any user-facing changes? Yes * Closes: apache#38376 Authored-by: Jonathan Keane <jkeane@gmail.com> Signed-off-by: Nic Crane <thisisnic@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for this change
Add
dimnamesmethod so that things likecolnames(ds)work out of the box on datasets. Inspired by dbplyr's lazy tbl implementationWhat changes are included in this PR?
An additional
dimnamesmethod for Dataset objectsAre these changes tested?
Yes
Are there any user-facing changes?
Yes
dimnamesmethod to Dataset class #38376