Skip to content

Commit

Permalink
Fix Tables.istable
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf committed Feb 13, 2020
1 parent f3b7856 commit 8cad82e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/NoBang/singletoncontainers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ Tables.rowaccess(::Type{<:SingletonVector{<:NamedTuple{names}}}) where {names} =
Tables.columnaccess(::Type{<:SingletonVector{<:NamedTuple{names}}}) where {names} =
@isdefined(names)

# For backward compatibility (these were automatically `false` in Tables 0.2):
Tables.istable(::Type{SingletonVector{NamedTuple}}) = false
Tables.istable(::Type{SingletonVector{<:NamedTuple}}) = false

Tables.rows(x::SingletonVector{<:NamedTuple}) = [x.value]
Tables.columns(x::SingletonVector{<:NamedTuple{names}}) where {names} =
NamedTuple{names}(map(x -> [x], Tuple(x.value)))
Expand Down

0 comments on commit 8cad82e

Please sign in to comment.