finos / perspective

A data visualization and analytics component, especially well-suited for large and/or streaming datasets.
https://perspective.finos.org/
Apache License 2.0
7.72k stars 1.05k forks source link

Fix `split_by` with `date`/`datetime` columns #2545

Closed texodus closed 4 months ago

texodus commented 4 months ago

Fixes #2544 and fixes #2306.

When split_by with a column of type "date" or "datetime", the internal viewport data is returned with column paths helpfully formatted as strings (helpfully due to a legacy internal format which does not properly support mixed types in column paths just yet). However, the column_paths() methods still returns t_tscalar, which sometimes is the same as the string representation, but is not when the type is "date" or "datetime". This caused Datagrid column group headers to show up as POSIX timestamps, but also caused the column paths to fail lookup when populating the table itself, causing the column to appears as all null.

This PR changes the behavior of the column_paths() method to explicitly to_string() column path values, and adds a test for both the column_paths() API and a browser integration test for the Datagrid split_by with a "date" column

Before: test-failed-1 After: test-failed-1