The goal is to support row.GetValue "header name" in the same way that row.GetValue columnIndex is currently supported.
I wasn't sure what should happen if an invalid header name was supplied. I wanted to be consistent with an invalid column index being supplied, but found no explicit handling or tests around that scenario. I did find that if a row index was out-of-range, null was returned. Based on this, I decided to:
Fail explicitly when a negative column index is supplied,
Return null when a positive column index is supplied, but it is outside the range of used columns,
Fail explicitly when a column name (header) is supplied and it does not match an existing column header, and
Implement column-header-lookup in a case-sensitive manner. If a header is not found, perform a case-insensitive key search, solely for the purpose of providing a more helpful message (Column "foo" was not found. Did you mean "Foo"?).
Added tests for each of these and updated "cells" doc.
The goal is to support
row.GetValue "header name"
in the same way thatrow.GetValue columnIndex
is currently supported.I wasn't sure what should happen if an invalid header name was supplied. I wanted to be consistent with an invalid column index being supplied, but found no explicit handling or tests around that scenario. I did find that if a row index was out-of-range,
null
was returned. Based on this, I decided to:null
when a positive column index is supplied, but it is outside the range of used columns,Column "foo" was not found. Did you mean "Foo"?
).Added tests for each of these and updated "cells" doc.