From d29694b1a2fdf30af1fae69c26dcbd9d8a95aa68 Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Fri, 8 Jul 2022 08:58:16 +0200 Subject: [PATCH] Update table --- great_ai/deploy/routes/dashboard/get_traces_table.py | 7 ++----- great_ai/views/trace.py | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/great_ai/deploy/routes/dashboard/get_traces_table.py b/great_ai/deploy/routes/dashboard/get_traces_table.py index 326afa0..bcf621e 100644 --- a/great_ai/deploy/routes/dashboard/get_traces_table.py +++ b/great_ai/deploy/routes/dashboard/get_traces_table.py @@ -18,8 +18,8 @@ def get_traces_table() -> dash_table.DataTable: "white-space": "normal", "height": "auto", "max-height": "300px", + "max-width": "500px", "overflow": "hidden", - "text-overflow": "ellipsis", }, style_cell={"padding": "5px"}, style_header={ @@ -27,8 +27,5 @@ def get_traces_table() -> dash_table.DataTable: "font-weight": "bold", }, merge_duplicate_headers=True, - style_cell_conditional=[ - {"if": {"column_id": "output"}, "width": 1500}, - ], - style_table={"overflow": "auto"}, + style_table={"overflow": "auto", "max-height": "80vh"}, ) diff --git a/great_ai/views/trace.py b/great_ai/views/trace.py index f952da2..1d11bd1 100644 --- a/great_ai/views/trace.py +++ b/great_ai/views/trace.py @@ -1,7 +1,7 @@ from pprint import pformat from typing import Any, Dict, Generic, List, Optional, TypeVar -from pydantic import BaseModel, Extra +from pydantic import Extra from ..helper import HashableBaseModel from .model import Model @@ -71,7 +71,7 @@ class Trace(Generic[T], HashableBaseModel): } ), **{ - k: v.dict() if isinstance(v, BaseModel) else v + k: pformat(v, indent=2, compact=True) for k, v in self.logged_values.items() }, "models_flat": self.models_flat,