You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "hermanschaaf (via GitHub)" <gi...@apache.org> on 2024/08/30 01:48:26 UTC
[I] [Go] Date32 and Date64 String() methods return numbers instead of dates [arrow-go]
hermanschaaf opened a new issue, #63:
URL: https://github.com/apache/arrow-go/issues/63
### Describe the bug, including details regarding any error messages, version, and platform.
The String methods on the Go `array.Date32` and `array.Date64` types return strings formatted as the underlying integers, rather than strings formatted as dates as in other implementations.
For example, this code in Go:
```
package main
import (
"fmt"
"github.com/apache/arrow/go/v12/arrow"
"github.com/apache/arrow/go/v12/arrow/array"
"github.com/apache/arrow/go/v12/arrow/memory"
)
func main() {
db := array.NewDate32Builder(memory.DefaultAllocator)
defer db.Release()
db.AppendValues([]arrow.Date32{1, 2, 3}, nil)
arr := db.NewArray()
defer arr.Release()
fmt.Println(arr)
}
```
produces the following output:
```
[1 2 3]
```
More or less equivalent code in Python:
```
import pyarrow as pa
date_array = pa.array([1, 2, 3], type=pa.date32())
print(date_array)
```
produces:
```
[
1970-01-02,
1970-01-03,
1970-01-04
]
```
I think the Go implementation's dates should also return formatted dates?
### Component(s)
Go
--
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: issues-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org