Skip to content

Commit 48e363b

Browse files
authored
Fix bug in Tables.getcolumn(t::TableSelection, i::Int) (#150)
1 parent 3c2141c commit 48e363b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/tableselection.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Tables.columnnames(t::TableSelection) = t.names
4343

4444
function Tables.getcolumn(t::TableSelection, i::Int)
4545
i > t.ncols && error("Table has no column with index $i.")
46-
Tables.getcolumn(t.cols, t.names[i])
46+
Tables.getcolumn(t.cols, t.mapnames[t.names[i]])
4747
end
4848

4949
function Tables.getcolumn(t::TableSelection, nm::Symbol)

test/tableselection.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
@test Tables.getcolumn(s, :x) == t.c
3737
@test Tables.getcolumn(s, :y) == t.d
3838
@test Tables.getcolumn(s, :z) == t.f
39+
@test Tables.getcolumn(s, 1) == t.c
40+
@test Tables.getcolumn(s, 2) == t.d
41+
@test Tables.getcolumn(s, 3) == t.f
3942

4043
# row table
4144
select = [:a, :b, :e]

0 commit comments

Comments
 (0)