westonpace commented on code in PR #15211:
URL: https://github.com/apache/arrow/pull/15211#discussion_r1067341465
##########
r/tests/testthat/test-Array.R:
##########
@@ -1321,3 +1321,19 @@ test_that("Array to C-interface", {
delete_arrow_schema(schema_ptr)
delete_arrow_array(array_ptr)
})
+
+test_that("direct creation of Decimal Arrays (ARROW-11631)", {
Review Comment:
Well, in python it would be something like:
```
# create an array of python decimals
x = [decimal.Decimal('12.34'), decimal.Decimal('23.45')]
# convert to an array of arrow decimals
arr = pa.array(x)
# arr
# <pyarrow.lib.Decimal128Array object at 0x7fd6a40dd120>
# [
# 12.34,
# 23.45
# ]
```
It looks like there are tests like this in `test-Array.R`:
```
test_that("Integer Array", {
ints <- c(1:10, 1:10, 1:5)
x <- expect_array_roundtrip(ints, int32())
})
```
Also in`test-Array.R` I see something like...
```
expect_error(
Array$create(as.double(1:10), type = decimal(4, 2)),
"You might want to try casting manually"
)
```
Shouldn't this work 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]