@@ -120,45 +120,6 @@ test_that("cast_table works as expected", {
120
120
})
121
121
```
122
122
123
- ### Discussion {#no-compat-type}
124
-
125
- There are some Arrow data types which do not have any R equivalent. Attempting
126
- to cast to these data types or using a schema which contains them will result in
127
- an error.
128
-
129
- ``` {r, float_16_conversion, error=TRUE, eval=FALSE}
130
- # Set up a tibble to use in this example
131
- oscars <- tibble::tibble(
132
- actor = c("Katharine Hepburn", "Meryl Streep", "Jack Nicholson"),
133
- num_awards = c(4, 3, 3)
134
- )
135
-
136
- # Convert tibble to an Arrow table
137
- oscars_arrow <- arrow_table(oscars)
138
-
139
- # Set up schema with "num_awards" as float16 which doesn't have an R equivalent
140
- oscars_schema_invalid <- schema(actor = string(), num_awards = float16())
141
-
142
- # The default mapping from numeric column "num_awards" is to a double
143
- oscars_arrow$cast(target_schema = oscars_schema_invalid)
144
- ```
145
-
146
- ``` {r}
147
- ## Error: NotImplemented: Unsupported cast from double to halffloat using function cast_half_float
148
- ```
149
-
150
- ``` {r, test_float_16_conversion, opts.label = "test"}
151
- test_that("float_16_conversion works as expected", {
152
-
153
- oscars_schema_invalid <- schema(actor = string(), num_awards = float16())
154
-
155
- expect_error(
156
- oscars_arrow$cast(target_schema = oscars_schema_invalid),
157
- "NotImplemented: Unsupported cast from double to halffloat using function cast_half_float"
158
- )
159
- })
160
- ```
161
-
162
123
## Specify data types when creating an Arrow table from an R object
163
124
164
125
You want to manually specify Arrow data types when converting an object from a
0 commit comments