bkietz edited a comment on pull request #8256:
URL: https://github.com/apache/arrow/pull/8256#issuecomment-724985123


   @nealrichardson @romainfrancois I've refactored `r6_class_name` to a trait. 
For simple cases it's no longer necessary to declare the R6 class name- we 
correctly guess that `arrow::Field` corresponds to "Field". I've also added 
comments explaining why it's sometimes necessary to override this default and 
how, let me know if you'd like them more verbose.
   
   > How does it fail/error if you forget to add one
   
   For a new c++ function `shared_ptr<arrow::Widget> MakeWidget()`, the default 
R6 class name for the return value will be "Widget". If no such R6 class 
exists, we'll 
[`stop()`](https://github.com/apache/arrow/pull/8256/files#diff-ef920fdae5124d20b341b9710adf8a33367cd2d24e08510913419ead9c8bb40fR304-R306)
 anytime MakeWidget() is called (because we don't know how to box its return 
value). For example, when I tried to change the return type of 
`dataset___UnionDatasetFactory__Make` I got:
   
   ```
   ══ Failed 
══════════════════════════════════════════════════════════════════════
   ── 1. Error: Assembling multiple DatasetFactories with DatasetFactory 
(@test-dat
   No arrow R6 class named 'UnionDatasetFactory'
   Backtrace:
    1. DatasetFactory$create(list(factory1, factory2)) 
testthat/test-dataset.R:723:2
    2. arrow:::dataset___UnionDatasetFactory__Make(x)
   ```


----------------------------------------------------------------
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.

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


Reply via email to