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

TableOperations.transform() returns lazy table with no schema #32

Open
EssamWisam opened this issue Aug 5, 2023 · 0 comments
Open

TableOperations.transform() returns lazy table with no schema #32

EssamWisam opened this issue Aug 5, 2023 · 0 comments

Comments

@EssamWisam
Copy link

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.

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

1 participant