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



##########
File path: r/R/type.R
##########
@@ -107,17 +111,48 @@ UInt32 <- R6Class("UInt32", inherit = FixedWidthType)
 UInt64 <- R6Class("UInt64", inherit = FixedWidthType)
 Float16 <- R6Class("Float16", inherit = FixedWidthType)
 Float32 <- R6Class("Float32", inherit = FixedWidthType)
-Float64 <- R6Class("Float64", inherit = FixedWidthType)
+Float64 <- R6Class("Float64",
+  inherit = FixedWidthType,
+  public = list(
+    code = function() call("float64")
+  )
+)

Review comment:
       Just wondering; because we support using `double()` to create `float64` 
objects, could this potentially lead to confusion for users, e.g. 
   
   ```
   s <- schema(x = double())
   s
   # Schema
   # x: double
   s$code()
   # schema(x = float64())
   ```
   
   I think this perhaps doesn't matter though, given in the docs we do say 
"When called inside an arrow function, such as schema() or cast(), double() 
also is supported as a way of creating a float64()"

##########
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:
       Just out of curiosity, what us this bit doing here with "unknown_type"?




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