You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "nealrichardson (via GitHub)" <gi...@apache.org> on 2023/05/12 14:05:48 UTC

[GitHub] [arrow] nealrichardson commented on pull request #35543: GH-35542 : [R] Impement schema extraction function

nealrichardson commented on PR #35543:
URL: https://github.com/apache/arrow/pull/35543#issuecomment-1545804115

   > > I am wondering if the function name schema is too generic and how about to be changed to something like arrow_schmea?
   > 
   > I think that's a good point...particularly since it's an S3 method. `infer_schema()` or `extract_schema()` might also be good choices...we already have `as_schema()` for converting a schema-like object to a Schema. (FWIW I use `infer_nanoarrow_schema()` to do this kind of thing in nanoarrow).
   
   `schema()` exists as a function now (and has since the beginning of the package), this PR seems to be adding additional cases for using it to extract the `$schema` attribute from Arrow objects, and it's doing it via S3 methods rather than `if`s.  If we're worried about the name "schema" colliding with other packages, we would have already seen it already--has anyone?
   
   For what it's worth, I'm personally not a fan of renaming to `verb_schema()`: it's pulling an attribute of the object, so it feels natural that the accessor have the same name as the attribute, as we have e.g. `length.ArrowDatum <- function(x) x$length()`. As a (👴) developer, I don't want to have to remember what `verb_` goes in front, I'd rather just `$schema`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org