zeroshade commented on code in PR #1503:
URL: https://github.com/apache/arrow-go/pull/1503#discussion_r4528022595


##########
arrow/compute/cast_test.go:
##########
@@ -1003,6 +1014,17 @@ func (c *CastSuite) TestDecimal256ToInt() {
                defer beyondBounds.Release()
                checkCastFails(c.T(), beyondBounds, *opts)
        })
+
+       c.Run("int16", func() {
+               opts := compute.SafeCastOptions(arrow.PrimitiveTypes.Int16)
+               dt := &arrow.Decimal256Type{Precision: 10, Scale: 0}
+
+               c.checkCastOpts(dt, arrow.PrimitiveTypes.Int16,
+                       `["1", "2", "3", "4", null]`, `[1, 2, 3, 4, null]`, 
*opts)

Review Comment:
   nit: same as the decimal128 case, this is covered by the next check.



##########
arrow/compute/cast_test.go:
##########
@@ -880,6 +880,17 @@ func (c *CastSuite) TestDecimal128ToInt() {
                defer beyondBounds.Release()
                checkCastFails(c.T(), beyondBounds, *opts)
        })
+
+       c.Run("int16", func() {
+               opts := compute.SafeCastOptions(arrow.PrimitiveTypes.Int16)
+               dt := &arrow.Decimal128Type{Precision: 10, Scale: 0}
+
+               c.checkCastOpts(dt, arrow.PrimitiveTypes.Int16,
+                       `["1", "2", "3", "4", null]`, `[1, 2, 3, 4, null]`, 
*opts)

Review Comment:
   nit: the next check (`[200, -300, 32767, -32768, null]`) already covers the 
success path, so this one adds nothing and could be dropped.



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