Skip to content

Commit

Permalink
minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
ablaom committed Aug 1, 2019
1 parent aea4f8d commit 3e472a7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/ScientificTypes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ Base.propertynames(sch::Schema) = (:names, :types, :scitypes)

_as_named_tuple(s::Schema) = NamedTuple{(:names, :types, :scitypes)}((s.names, s.types, s.scitypes))

function Base.show(io::IO, s::Schema)
show(io, _as_named_tuple(s))
function Base.show(io::IO, ::MIME"text/plain", s::Schema)
show(io, MIME("text/plain"), _as_named_tuple(s))
end


Expand Down
6 changes: 4 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ end
@testset "Tables" begin

X = (x=rand(5), y=rand(Int, 5),
z=categorical(collect("asdfa")), w=rand(5))
@test schema(X).scitypes == (Continuous, Count, Multiclass{4}, Continuous)
z=categorical(collect("asdfa")), w=rand(5))
s = schema(X)
@test s.scitypes == (Continuous, Count, Multiclass{4}, Continuous)
@test s.types == (Float64, Int64, CategoricalValue{Char,UInt32}, Float64)

@test_throws ArgumentError schema([:x, :y])

Expand Down

0 comments on commit 3e472a7

Please sign in to comment.