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

   While I agree that it's not the best that `schema()` would do both 
construction and extraction here, the aim here was to come up with something 
intuitive for users that avoids having to use the `$` for extraction, and I 
don't think that any of the alternatives quite fit that; I agree that the 
`as_*` functions sound more conversion than extraction.  I just spent ~30 
minutes browsing through docs for other packages (mainly 
tidyverse/tidymodels/r-lib etc) to see how they handle this kind of thing, but 
there aren't any good analogous examples.
   
   I also considered whether there are other attributes we might want to 
implement extraction functions like this for, but I think schemas are the only 
case and so here's no general problem to solve.  Given that multiple people 
(Neal, myself, and also Francois on the original ticket) report having tried to 
use `schema()` to extract a schema despite knowing that `schema()` is (also) 
the function for creating schemas, it might be the best intuitive option we 
have right now?
    


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to