Keep dashboard category identity separate from shortened labels
This commit is contained in:
parent
0b676ddc7c
commit
774546a2c4
1 changed files with 15 additions and 4 deletions
|
|
@ -1,7 +1,8 @@
|
|||
from typing import Any
|
||||
|
||||
import pandas as pd
|
||||
import pytest
|
||||
|
||||
from great_ai.deploy.routes.dashboard.create_dash_app import get_dimension_descriptor
|
||||
from great_ai.deploy.routes.dashboard.get_filter_from_datatable import (
|
||||
get_filter_from_datatable,
|
||||
)
|
||||
|
|
@ -30,3 +31,13 @@ def test_dashboard_filter_grammar(expression: str, operator: str, value: Any) ->
|
|||
)
|
||||
def test_incomplete_filters_are_ignored(expression: str) -> None:
|
||||
assert get_filter_from_datatable(expression) is None
|
||||
|
||||
|
||||
def test_long_category_labels_keep_distinct_coordinates() -> None:
|
||||
prefix = "a" * 40
|
||||
dimension = get_dimension_descriptor(
|
||||
pd.DataFrame({"category": [prefix + "1", prefix + "2"]}), "category"
|
||||
)
|
||||
assert dimension["values"] == [0, 1]
|
||||
assert dimension["tickvals"] == [0, 1]
|
||||
assert dimension["ticktext"] == [prefix, prefix]
|
||||
|
|
|
|||
Loading…
Reference in a new issue