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

bump Observables compat #90

Merged
merged 3 commits into from
Nov 21, 2022
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
1 change: 0 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
fail-fast: false
matrix:
version:
- '1.0'
- '1'
- 'nightly'
os:
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ WebIO = "0f1e0344-ec1d-5b48-a673-e5cf874b6c29"
[compat]
JSExpr = "0.4, 0.5"
JSON = "0.18, 0.19, 0.20, 0.21"
Observables = "0.2, 0.3, 0.4"
Observables = "0.2, 0.3, 0.4, 0.5"
Tables = "1"
WebIO = "0.8"
julia = "0.7, 1"
Expand Down
15 changes: 9 additions & 6 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ end
@test showtable(nttable) isa WebIO.Scope
end
@testset "inf, nan, and missing serializing" begin
rows = Tables.table([NaN Inf -Inf 0 missing])
names = [:a, :b, :c, :d, :e]
rows = Tables.table([NaN Inf -Inf 0 missing]; header=names)
types = vcat([Float64 for _ in 1:4], [Missing])
Base.show(io::IO, x::Missing) = print(io, "test_missing")
json = TableView.table2json(Tables.Schema(names, types), rows, types)
schema = Tables.Schema(names, types)
json = TableView.table2json(schema, Tables.rows(rows), types)
firstrow = JSON.parse(json)[1]
@test firstrow["a"] == "NaN"
@test firstrow["b"] == "Inf"
Expand All @@ -33,20 +34,22 @@ end
@test firstrow["e"] == "test_missing"
end
@testset "large integers" begin
rows = Tables.table([2^52 2^53 2^54])
names = [:a, :b, :c]
rows = Tables.table([2^52 2^53 2^54]; header=names)
types = [Int64 for _ in 1:3]
json = TableView.table2json(Tables.Schema(names, types), rows, types)
schema = Tables.Schema(names, types)
json = TableView.table2json(schema, Tables.rows(rows), types)
firstrow = JSON.parse(json)[1]
@test firstrow["a"] == 4503599627370496
@test firstrow["b"] == "9007199254740992"
@test firstrow["c"] == "18014398509481984"
end
@testset "large floats" begin
rows = Tables.table([1.0e50 1.0e100])
names = [:a, :b]
rows = Tables.table([1.0e50 1.0e100]; header=names)
types = [Float64, Float64]
json = TableView.table2json(Tables.Schema(names, types), rows, types)
schema = Tables.Schema(names, types)
json = TableView.table2json(schema, Tables.rows(rows), types)
firstrow = JSON.parse(json)[1]
@test firstrow["a"] == "1.0e50"
@test firstrow["b"] == "1.0e100"
Expand Down