In #31 we adjusted index-by to set a simple metadata key :index on the dataset to handle cases where it is not possible to detect the time column automatically (i.e. if there is one time column). But simply setting this metadata can lead to a problem if the index column is changed so that it becomes invalid. We need to check whether the index is invalid.
Proposed Solution
@daslu added a mechanism to check the validity in #5. This PR uses the add-validatable method to add the index metadata whe the user calls index-by. Then it changes the index-column-name fn to check the validity of the validatable index metadata.
Goal / Problem
In #31 we adjusted
index-by
to set a simple metadata key:index
on the dataset to handle cases where it is not possible to detect the time column automatically (i.e. if there is one time column). But simply setting this metadata can lead to a problem if the index column is changed so that it becomes invalid. We need to check whether the index is invalid.Proposed Solution
@daslu added a mechanism to check the validity in #5. This PR uses the
add-validatable
method to add the index metadata whe the user callsindex-by
. Then it changes theindex-column-name
fn to check the validity of the validatable index metadata.See the
tablecloth.time.utils.indexing-test
namespace for a bit more detail.Also in this PR
validatable
ns moved to be nested under the newtablecloth.time.utils
domainindex-by
function moved into thetablecloth.time.api
domain and exported to public APIrolling-window
exported to public API (cc: @rsiddharthan )