Conversation
| name = "Tables" | ||
| uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" | ||
| authors = ["quinnj <quinn.jacobd@gmail.com>"] | ||
| version = "1.10.1" |
There was a problem hiding this comment.
Also DataAPI.jl version requirement needs to be changed below.
|
Can you please add tests for all 5 types? |
|
Hoo, when making the tests I did realise I was completely misinterpreting the row argument, it was not an index, but the actual data of the row... That's why tests are so valuable ^^. So I don't think we can get the row number without adding it as a field of the rows structures for: There's two choices from here, either we add a field for the row index into these structures, or we don't define I made an example implementation of a row number in |
Let us wait for @quinnj to decide on this. My thinking is that:
so I would be OK to add it. The only downside could be that in some cases these objects could be generated from sources that do not have a proper row numbering. However, I am not sure if this is possible. @quinnj should know. |
Now using the newly proposed
DataAPI.rownumberinterface (JuliaData/DataAPI.jl#60). We add an implementation for:Tables.ColumnsRow,Tables.DictRow,Tables.IteratorRowandTables.MatrixRow.Note: a similar function (
getrow) existed already forColumnsRowandIteratorRow. These functions were not removed as a precaution, but rather used for implementingDataAPI.rownumber(i.e.rownumber(c::ColumnsRow) = getrow(c))The implementation for
Tables.Rowis justrownumber(x::Row) = rownumber(x.x). Maybe we should add a fallback or throw an explicit error if the row type does not implementrownumber?