Skip to content

Commit

Permalink
add snapshot_id and fingerprint to customdata
Browse files Browse the repository at this point in the history
  • Loading branch information
mike0sv committed Dec 4, 2024
1 parent c7e90e2 commit 7c05f36
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
13 changes: 9 additions & 4 deletions src/evidently/ui/dashboards/test_suites.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def get(self, test_suite: TestSuite) -> Dict[Test, TestInfo]:
if self.test_matched(test):
try:
result = test.get_result()
results[test] = TestInfo(result.status, result.description)
results[test] = TestInfo(test_suite.id, result.status, result.description)
except AttributeError:
pass
return results
Expand Down Expand Up @@ -138,10 +138,15 @@ def _create_detailed_fig(self, points: TestResultPoints):
tests = list(all_tests)
hover_params = _get_hover_params(all_tests)

def get_description(test, date):
description = points[date][test].description
def get_description(test: Test, date):
test_info = points[date][test]
description = test_info.description
description, _ = descr_re.subn(r".<br>\g<1>", description)
return description
return {
"description": description,
"test_fingerprint": test.get_fingerprint(),
"snapshot_id": str(test_info.snapshot_id),
}

def get_color(test, date) -> Optional[str]:
ti = points[date].get(test)
Expand Down
2 changes: 1 addition & 1 deletion src/evidently/ui/dashboards/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,5 +158,5 @@ def _get_hover_params(items: Set[TMT]) -> Dict[TMT, List[str]]:

def _get_test_hover(test_name: str, params: List[str]):
params_join = "<br>".join(params)
hover = f"<b>Timestamp: %{{x}}</b><br><b>{test_name}</b><br>{params_join}<br>%{{customdata}}<br>"
hover = f"<b>Timestamp: %{{x}}</b><br><b>{test_name}</b><br>{params_join}<br>%{{customdata.description}}<br>"
return hover
1 change: 1 addition & 0 deletions src/evidently/ui/type_aliases.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@


class TestInfo(NamedTuple):
snapshot_id: SnapshotID
status: TestStatus
description: str

Expand Down

0 comments on commit 7c05f36

Please sign in to comment.