Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fromarrow(::Type{Dates.Time}, x::Arrow.Time) #527

Merged
merged 2 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/eltypes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading