|
14 | 14 | # See the License for the specific language governing permissions and
|
15 | 15 | # limitations under the License.
|
16 | 16 |
|
17 |
| -using Test, Arrow, ArrowTypes, Tables, Dates, PooledArrays, TimeZones, UUIDs, Sockets, |
18 |
| - CategoricalArrays, DataAPI, FilePathsBase, DataFrames |
19 |
| -using Random: randstring |
20 |
| - |
21 |
| -# Compat shim for pre-julia 1.9 |
22 |
| -if !@isdefined(pkgversion) |
23 |
| - using TOML |
24 |
| - function pkgversion(m::Module) |
25 |
| - toml = TOML.parsefile(joinpath(pkgdir(m), "Project.toml")) |
26 |
| - return VersionNumber(toml["version"]) |
27 |
| - end |
28 |
| -end |
| 17 | +using Test |
| 18 | +using Arrow |
| 19 | +using ArrowTypes |
| 20 | +using Tables |
| 21 | +using Dates |
| 22 | +using PooledArrays |
| 23 | +using TimeZones |
| 24 | +using UUIDs |
| 25 | +using Sockets |
| 26 | +using CategoricalArrays |
| 27 | +using DataAPI |
| 28 | +using FilePathsBase |
| 29 | +using DataFrames |
| 30 | +import Random: randstring |
29 | 31 |
|
30 | 32 | include(joinpath(dirname(pathof(ArrowTypes)), "../test/tests.jl"))
|
31 | 33 | include(joinpath(dirname(pathof(Arrow)), "../test/testtables.jl"))
|
@@ -72,11 +74,12 @@ end # @testset "table append"
|
72 | 74 |
|
73 | 75 | for file in readdir(joinpath(dirname(pathof(Arrow)), "../test/arrowjson"))
|
74 | 76 | jsonfile = joinpath(joinpath(dirname(pathof(Arrow)), "../test/arrowjson"), file)
|
75 |
| - println("integration test for $jsonfile") |
| 77 | + @testset "integration test for $jsonfile" begin |
76 | 78 | df = ArrowJSON.parsefile(jsonfile);
|
77 | 79 | io = Arrow.tobuffer(df)
|
78 | 80 | tbl = Arrow.Table(io; convert=false);
|
79 | 81 | @test isequal(df, tbl)
|
| 82 | + end |
80 | 83 | end
|
81 | 84 |
|
82 | 85 | end # @testset "arrow json integration tests"
|
@@ -605,21 +608,15 @@ table = Arrow.Table(joinpath(@__DIR__, "old_zdt.arrow"))
|
605 | 608 | end
|
606 | 609 |
|
607 | 610 | @testset "# 243" begin
|
608 |
| -if pkgversion(ArrowTypes) >= v"2.0.1" # need the ArrowTypes bugfix to pass this test |
609 |
| - # https://github.com/apache/arrow-julia/issues/243 |
610 |
| - table = (; col = [(; v=v"1"), (; v=v"2"), missing]) |
611 |
| - @test isequal(Arrow.Table(Arrow.tobuffer(table)).col, table.col) |
612 |
| -end |
| 611 | +table = (; col = [(; v=v"1"), (; v=v"2"), missing]) |
| 612 | +@test isequal(Arrow.Table(Arrow.tobuffer(table)).col, table.col) |
613 | 613 | end
|
614 | 614 |
|
615 | 615 | @testset "# 367" begin
|
616 |
| -# https://github.com/apache/arrow-julia/issues/367 |
617 |
| -if pkgversion(ArrowTypes) >= v"2.0.2" |
618 |
| - t = (; x=Union{ZonedDateTime,Missing}[missing]) |
619 |
| - a = Arrow.Table(Arrow.tobuffer(t)) |
620 |
| - @test Tables.schema(a) == Tables.schema(t) |
621 |
| - @test isequal(a.x, t.x) |
622 |
| -end |
| 616 | +t = (; x=Union{ZonedDateTime,Missing}[missing]) |
| 617 | +a = Arrow.Table(Arrow.tobuffer(t)) |
| 618 | +@test Tables.schema(a) == Tables.schema(t) |
| 619 | +@test isequal(a.x, t.x) |
623 | 620 | end
|
624 | 621 |
|
625 | 622 | # https://github.com/apache/arrow-julia/issues/414
|
@@ -707,14 +704,14 @@ t = Arrow.Table(buf)
|
707 | 704 |
|
708 | 705 | end
|
709 | 706 |
|
710 |
| -# @testset "# 456" begin |
| 707 | +@testset "# 456" begin |
711 | 708 |
|
712 |
| -# NT = @NamedTuple{x::Int, y::Union{Missing,Int}} |
713 |
| -# data = NT[(x=1,y=2), (x=2,y=missing), (x=3,y=4), (x=4,y=5)] |
714 |
| -# t = [(a=1,b=view(data,1:2)), (a=2,b=view(data,3:4)), missing] |
715 |
| -# @test Arrow.toarrowvector(t) isa Arrow.Struct |
| 709 | +NT = @NamedTuple{x::Int, y::Union{Missing,Int}} |
| 710 | +data = NT[(x=1,y=2), (x=2,y=missing), (x=3,y=4), (x=4,y=5)] |
| 711 | +t = [(a=1,b=view(data,1:2)), (a=2,b=view(data,3:4)), missing] |
| 712 | +@test Arrow.toarrowvector(t) isa Arrow.Struct |
716 | 713 |
|
717 |
| -# end |
| 714 | +end |
718 | 715 |
|
719 | 716 | end # @testset "misc"
|
720 | 717 |
|
|
0 commit comments