Add HTML5 object runtime context
This commit is contained in:
@@ -1747,8 +1747,9 @@ async def html5_project_object_context(project_id: str, object_name: str) -> Res
|
||||
impact = await get_object_impact(project_id, object_name)
|
||||
access = await get_object_access(project_id, object_name)
|
||||
ui = await get_object_ui(project_id, object_name)
|
||||
runtime = _runtime_for_object_context(project_id, impact)
|
||||
return Response(
|
||||
render_html5_object_context(project_id, schema, impact, access, ui),
|
||||
render_html5_object_context(project_id, schema, impact, access, ui, runtime),
|
||||
media_type="text/html; charset=utf-8",
|
||||
)
|
||||
|
||||
@@ -8112,6 +8113,35 @@ def _html5_metadata_tabular_sections(raw: str) -> list[dict]:
|
||||
return sections
|
||||
|
||||
|
||||
def _runtime_for_object_context(project_id: str, impact: ObjectImpactResponse) -> list[RuntimeSummaryResponse]:
|
||||
lineages = {
|
||||
item.lineage_id
|
||||
for group in [
|
||||
[impact.object],
|
||||
impact.modules,
|
||||
impact.routines,
|
||||
impact.forms,
|
||||
impact.commands,
|
||||
impact.jobs,
|
||||
impact.writes,
|
||||
]
|
||||
for item in group
|
||||
if item is not None
|
||||
}
|
||||
snapshot = _project_snapshot_or_404(project_id)
|
||||
overlay = _overlays.get(project_id, RuntimeOverlay(project_id=project_id))
|
||||
return [
|
||||
RuntimeSummaryResponse(
|
||||
node=_named_node(item.node),
|
||||
signal_count=item.signal_count,
|
||||
error_count=item.error_count,
|
||||
max_duration_ms=item.max_duration_ms,
|
||||
)
|
||||
for item in summarize_runtime(snapshot, overlay)
|
||||
if item.node.lineage_id in lineages
|
||||
]
|
||||
|
||||
|
||||
def _current_import_source(project_id: str) -> ImportSourceKind:
|
||||
setup = _project_setup_response(project_id)
|
||||
if setup.current_source is not None:
|
||||
|
||||
Reference in New Issue
Block a user