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

Implement schema for views of row-tables #130

Closed
ablaom opened this issue Jan 26, 2020 · 1 comment
Closed

Implement schema for views of row-tables #130

ablaom opened this issue Jan 26, 2020 · 1 comment

Comments

@ablaom
Copy link
Contributor

ablaom commented Jan 26, 2020

The view of a row table is a table. Row tables implement schema but views do not:

julia> X = Tables.rowtable((x1=rand(5), x2=rand(5)))
5-element Array{NamedTuple{(:x1, :x2),Tuple{Float64,Float64}},1}:
 (x1 = 0.27375482813550467, x2 = 0.7965469426066094) 
 (x1 = 0.11736823853641631, x2 = 0.48949447732525453)
 (x1 = 0.8471399766657528, x2 = 0.48589918772440677) 
 (x1 = 0.5059709917983557, x2 = 0.5492304956299647)  
 (x1 = 0.17045879351929716, x2 = 0.4099462711742099) 

julia> Tables.istable(X)
true

julia> Tables.schema(X)
Tables.Schema:
 :x1  Float64
 :x2  Float64

julia> Xv = view(X, 1:2)
2-element view(::Array{NamedTuple{(:x1, :x2),Tuple{Float64,Float64}},1}, 1:2) with eltype NamedTuple{(:x1, :x2),Tuple{Float64,Float64}}:
 (x1 = 0.27375482813550467, x2 = 0.7965469426066094) 
 (x1 = 0.11736823853641631, x2 = 0.48949447732525453)

julia> Tables.istable(Xv)
true

julia> Tables.schema(Xv) === nothing
true
@quinnj
Copy link
Member

quinnj commented Feb 8, 2020

Implemented in #131

@quinnj quinnj closed this as completed Feb 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants