romainfrancois commented on a change in pull request #11751:
URL: https://github.com/apache/arrow/pull/11751#discussion_r754522878



##########
File path: r/R/type.R
##########
@@ -40,7 +40,8 @@ DataType <- R6Class("DataType",
     fields = function() {
       DataType__fields(self)
     },
-    export_to_c = function(ptr) ExportType(self, ptr)
+    export_to_c = function(ptr) ExportType(self, ptr),
+    code = function() call2("unknown_type", self$ToString())

Review comment:
       The bit we had previously with an artificial call to `unknown_type()` 
allowed to have almost all the schema, with just these as placeholders: 
   
   ``` r
   library(arrow, warn.conflicts = FALSE)
   #> See arrow_info() for available features
   
   try_ <- function(code) tryCatch(code, error = function(cnd) print(cnd, 
backtrace = FALSE))
   
   try_(
     schema(x = int32(), y = struct(a = 
arrow:::DayTimeInterval__initialize()))$code()
   )
   #> schema(x = int32(), y = struct(a = unknown_type("day_time_interval")))
   ```
   
   <sup>Created on 2021-11-22 by the [reprex 
package](https://reprex.tidyverse.org) (v2.0.1.9000)</sup>




-- 
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-unsubscr...@arrow.apache.org

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


Reply via email to