JuliaData / JuliaData/TableOperations.jl
`TableOperations.transform()` returns lazy table with no schema
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 48
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
I'm attempting to perform transformations on a table and subsequently convert it into a matrix.
X = DataFrame(rand(10, 2), :auto) # also tried a matrix table
Xcat = X |> TableOperations.transform(Dict(0=> x -> x)) |> Tables.matrix
However, I get the error
type Nothing has no field types
Stacktrace:
[1] getproperty(x::Nothing, f::Symbol)
@ Base [./Base.jl:38](https://file+.vscode-resource.vscode-cdn.net/Users/essam/Documents/GitHub/Imbalance.jl/Base.jl:38)
[2] matrix(table::TableOperations.Transforms{true, Tables.MatrixTable{Matrix{Float64}}, Dict{Int64, var"#15#16"}}; transpose::Bool)
@ Tables [~/.julia/packages/Tables/AcRIE/src/matrix.jl:87](https://file+.vscode-resource.vscode-cdn.net/Users/essam/Documents/GitHub/Imbalance.jl/~/.julia/packages/Tables/AcRIE/src/matrix.jl:87)
[3] matrix(table::TableOperations.Transforms{true, Tables.MatrixTable{Matrix{Float64}}, Dict{Int64, var"#15#16"}})
@ Tables [~/.julia/packages/Tables/AcRIE/src/matrix.jl:84](https://file+.vscode-resource.vscode-cdn.net/Users/essam/Documents/GitHub/Imbalance.jl/~/.julia/packages/Tables/AcRIE/src/matrix.jl:84)
[4] |>(x::TableOperations.Transforms{true, Tables.MatrixTable{Matrix{Float64}}, Dict{Int64, var"#15#16"}}, f::typeof(Tables.matrix))
@ Base [./operators.jl:911](https://file+.vscode-resource.vscode-cdn.net/Users/essam/Documents/GitHub/Imbalance.jl/operators.jl:911)
[5] top-level scope
The underlying reason as far as I understand is that the following test passes
Xcat = X |> TableOperations.transform(Dict(0=> x -> x))
@test isnothing(Tables.schema(Xcat))
Note that we don't run into the same issue if we use TableTransforms.select(...). Also, on the other hands, converting to a columntable works but I am not sure how efficient that operation is if I were to follow it with a matrix conversion.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reproducer and the Tables.schema(Xcat) check, then inspect Tables' matrix.jl around line 87 and compare the behavior with TableOperations.select(...). Add a regression test for transforming a table and converting it with Tables.matrix; done means the transformed table has usable schema information and the conversion no longer raises the reported error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100