This is an automated email from the ASF dual-hosted git repository.

ericphanson pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-julia.git


The following commit(s) were added to refs/heads/main by this push:
     new a31fcf9  fromarrow(::Type{Dates.Time}, x::Arrow.Time) (#527)
a31fcf9 is described below

commit a31fcf92c1dab6d8673dde70be53e2eaaffa365a
Author: Phillip Alday <[email protected]>
AuthorDate: Mon Oct 21 17:37:51 2024 +0000

    fromarrow(::Type{Dates.Time}, x::Arrow.Time) (#527)
    
    - closes #526
    - closes #363
---
 src/eltypes.jl   | 2 +-
 test/runtests.jl | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/eltypes.jl b/src/eltypes.jl
index ffc53c0..4b2fa98 100644
--- a/src/eltypes.jl
+++ b/src/eltypes.jl
@@ -251,7 +251,7 @@ ArrowTypes.toarrow(x::Dates.Time) = convert(TIME, x)
 const TIME_SYMBOL = Symbol("JuliaLang.Time")
 ArrowTypes.arrowname(::Type{Dates.Time}) = TIME_SYMBOL
 ArrowTypes.JuliaType(::Val{TIME_SYMBOL}, S) = Dates.Time
-ArrowTypes.fromarrow(::Type{Dates.Time}, x::TIME) = convert(Dates.Time, x)
+ArrowTypes.fromarrow(::Type{Dates.Time}, x::Arrow.Time) = convert(Dates.Time, 
x)
 ArrowTypes.default(::Type{Dates.Time}) = Dates.Time(1, 1, 1)
 
 struct Timestamp{U,TZ} <: ArrowTimeType
diff --git a/test/runtests.jl b/test/runtests.jl
index 6cf990a..d4e4a71 100644
--- a/test/runtests.jl
+++ b/test/runtests.jl
@@ -1061,5 +1061,13 @@ end
             t = Arrow.Table(io)
             @test Arrow.Tables.rowcount(t) == 6
         end
+
+        @testset "# 526: Arrow.Time" begin
+            tt = testtables[4]
+            # just to make sure we're grabbing the correct table
+            @test first(tt) == "arrow date/time types"
+            tbl = Arrow.Table(Arrow.tobuffer(tt[2]))
+            @test tbl.col16[1] == Dates.Time(0, 0, 0)
+        end
     end # @testset "misc"
 end

Reply via email to