From 9902e6eb2b233d7e2528379def3e86d2c4ad0b9e Mon Sep 17 00:00:00 2001 From: Cameron Prybol Date: Fri, 24 Feb 2017 06:08:00 -0800 Subject: [PATCH] Fix hcat ambiguity errors on Julia 0.6 (#20) --- src/abstractdatatable/abstractdatatable.jl | 2 ++ src/datatable/datatable.jl | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/abstractdatatable/abstractdatatable.jl b/src/abstractdatatable/abstractdatatable.jl index 57e8f08..e616338 100644 --- a/src/abstractdatatable/abstractdatatable.jl +++ b/src/abstractdatatable/abstractdatatable.jl @@ -704,8 +704,10 @@ without(dt::AbstractDataTable, c::Any) = without(dt, index(dt)[c]) # catch-all to cover cases where indexing returns a DataTable and copy doesn't Base.hcat(dt::AbstractDataTable, x) = hcat!(dt[:, :], x) +Base.hcat(dt1::AbstractDataTable, dt2::AbstractDataTable) = hcat!(dt[:, :], dt2) Base.hcat(dt::AbstractDataTable, x, y...) = hcat!(hcat(dt, x), y...) +Base.hcat(dt1::AbstractDataTable, dt2::AbstractDataTable, dtn::AbstractDataTable...) = hcat!(hcat(dt1, dt2), dtn...) # vcat only accepts DataTables. Finds union of columns, maintaining order # of first dt. Missing data become null values. diff --git a/src/datatable/datatable.jl b/src/datatable/datatable.jl index f5ad85c..1ebac92 100644 --- a/src/datatable/datatable.jl +++ b/src/datatable/datatable.jl @@ -766,6 +766,8 @@ hcat!(a::DataTable, b, c...) = hcat!(hcat!(a, b), c...) # hcat Base.hcat(dt::DataTable, x) = hcat!(copy(dt), x) +Base.hcat(dt1::DataTable, dt2::AbstractDataTable) = hcat!(copy(dt1), dt2) +Base.hcat(dt1::DataTable, dt2::AbstractDataTable, dtn::AbstractDataTable...) = hcat!(hcat(dt1, dt2), dtn...) ############################################################################## ##