Modernise
This commit is contained in:
parent
4c6441182b
commit
8faee98ec6
44 changed files with 214 additions and 201 deletions
|
|
@ -31,7 +31,7 @@ def bootstrap_feedback_endpoints(app: FastAPI) -> None:
|
|||
return trace.feedback
|
||||
|
||||
@router.delete("/", status_code=status.HTTP_204_NO_CONTENT)
|
||||
def delete_feedback(trace_id: str) -> Any:
|
||||
def delete_feedback(trace_id: str) -> Response:
|
||||
trace = get_context().tracing_database.get(trace_id)
|
||||
if trace is None:
|
||||
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND)
|
||||
|
|
|
|||
|
|
@ -22,10 +22,10 @@ def bootstrap_prediction_endpoint(
|
|||
try:
|
||||
if inspect.iscoroutinefunction(func):
|
||||
return await cast(Callable[..., Awaitable[Trace]], func)(
|
||||
**cast(BaseModel, input_value).dict()
|
||||
**cast(BaseModel, input_value).model_dump()
|
||||
)
|
||||
return cast(Callable[..., Trace], func)(
|
||||
**cast(BaseModel, input_value).dict()
|
||||
**cast(BaseModel, input_value).model_dump()
|
||||
)
|
||||
except Exception as e:
|
||||
raise HTTPException(
|
||||
|
|
|
|||
|
|
@ -26,9 +26,9 @@ def create_dash_app(function_name: str, version: str, function_docs: str) -> Fla
|
|||
app = Dash(
|
||||
function_name,
|
||||
requests_pathname_prefix=DASHBOARD_PATH + "/",
|
||||
server=Flask(__name__),
|
||||
server=Flask(__name__), # type: ignore[arg-type]
|
||||
title=function_name,
|
||||
update_title=None,
|
||||
update_title=None, # type: ignore[arg-type]
|
||||
external_stylesheets=[
|
||||
"/assets/index.css",
|
||||
],
|
||||
|
|
@ -64,9 +64,9 @@ def create_dash_app(function_name: str, version: str, function_docs: str) -> Fla
|
|||
interval = dcc.Interval(
|
||||
interval=2 * 1000, # in milliseconds
|
||||
n_intervals=0,
|
||||
max_intervals=1
|
||||
if get_context().is_production
|
||||
else -1, # will be incremented in production upon each successful request
|
||||
max_intervals=(
|
||||
1 if get_context().is_production else -1
|
||||
), # will be incremented in production upon each successful request
|
||||
)
|
||||
|
||||
app.layout = html.Main(
|
||||
|
|
@ -159,7 +159,7 @@ def create_dash_app(function_name: str, version: str, function_docs: str) -> Fla
|
|||
take=page_size,
|
||||
conjunctive_filters=non_null_conjunctive_filters,
|
||||
conjunctive_tags=[ONLINE_TAG_NAME],
|
||||
sort_by=[SortBy.parse_obj(s) for s in sort_by],
|
||||
sort_by=[SortBy.model_validate(s) for s in sort_by],
|
||||
)
|
||||
|
||||
if non_null_conjunctive_filters:
|
||||
|
|
@ -244,7 +244,7 @@ def update_charts(
|
|||
fig.update_layout(
|
||||
margin=dict(l=0, r=0, b=0, t=0, pad=0),
|
||||
)
|
||||
execution_time_histogram.figure = fig
|
||||
execution_time_histogram.figure = fig # type: ignore[attr-defined]
|
||||
|
||||
parallel_coords_fig = go.Figure(
|
||||
go.Parcoords(
|
||||
|
|
|
|||
|
|
@ -16,8 +16,7 @@ def get_description(
|
|||
style={"color": accent_color},
|
||||
),
|
||||
dcc.Markdown(
|
||||
strip_lines(
|
||||
f"""
|
||||
strip_lines(f"""
|
||||
> View the live data of your deployment here.
|
||||
|
||||
## Using the API
|
||||
|
|
@ -27,8 +26,7 @@ def get_description(
|
|||
## Details
|
||||
|
||||
{function_docs}
|
||||
"""
|
||||
),
|
||||
"""),
|
||||
className="description",
|
||||
),
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
from typing import Any
|
||||
|
||||
from dash import dash_table
|
||||
|
||||
from ....context import get_context
|
||||
|
||||
|
||||
def get_traces_table() -> dash_table.DataTable:
|
||||
return dash_table.DataTable(
|
||||
def get_traces_table() -> Any:
|
||||
return dash_table.DataTable( # type: ignore[attr-defined]
|
||||
page_current=0,
|
||||
page_size=get_context().dashboard_table_size,
|
||||
page_action="custom",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue