Open hermanschaaf opened 1 year ago
I can submit a patch for this: just want to check that you agree this is a bug first.
So, the arrow.Date32
and arrow.Date64
types have FormattedString
methods which return the actual date instead of the numeric value. I'm not opposed to just renaming them as String()
so that it becomes the default string representation for those types and it should be pretty easy to do.
Alternately, the String()
method of those arrays could be modified to call FormattedString
instead of just writing the numbers to the buffer.
Honestly, I'd probably label this as an enhancement rather than a bug, because the current behavior is the intended behavior.
@zeroshade Great, thanks for the context! Yeah, I think the Go implementation here should probably match the C++/Python ones, and print the formatted string, so that when you print the array you get the actual dates. But if it was intended to work the way it is now then maybe it's fine. It's good to know there is at least a FormattedString
function that could be used.
@hermanschaaf I think that bringing them into alignment is a perfectly reasonable thing to do, and if you want to file a PR to implement one of the suggestions I made, I'd happily review and support such a thing. (or if you have a better idea than my off the cuff suggestions). Let's mark this as an enhancement request for now and just ping me if you decide to file the PR.
Describe the bug, including details regarding any error messages, version, and platform.
The String methods on the Go
array.Date32
andarray.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:
produces the following output:
More or less equivalent code in Python:
produces:
I think the Go implementation's dates should also return formatted dates?
Component(s)
Go