Skip to content

Commit d66786c

Browse files
committed
Added max duration
1 parent 5fee4b9 commit d66786c

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

apps/webapp/app/components/code/TSQLResultsTable.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,15 @@ function CellValue({
125125
);
126126
}
127127
return <span>{String(value)}</span>;
128+
case "durationSeconds":
129+
if (typeof value === "number") {
130+
return (
131+
<span className="tabular-nums">
132+
{formatDurationMilliseconds(value * 1000, { style: "short" })}
133+
</span>
134+
);
135+
}
136+
return <span>{String(value)}</span>;
128137
case "cost":
129138
if (typeof value === "number") {
130139
// Assume cost values are in cents
@@ -252,6 +261,7 @@ function isRightAlignedColumn(column: OutputColumnMetadata): boolean {
252261
// Check for custom render types that display numeric values
253262
if (
254263
column.customRenderType === "duration" ||
264+
column.customRenderType === "durationSeconds" ||
255265
column.customRenderType === "cost" ||
256266
column.customRenderType === "costInDollars"
257267
) {

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.query/route.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ export default function Page() {
249249
<PageBody scrollable={false}>
250250
<ResizablePanelGroup orientation="horizontal" className="max-h-full">
251251
<ResizablePanel id="query-main" className="max-h-full">
252-
<div className="grid max-h-full grid-rows-[auto_1fr] overflow-hidden">
252+
<div className="grid max-h-full grid-rows-[auto_1fr] overflow-hidden bg-charcoal-800">
253253
{/* Query editor */}
254254
<div className="flex flex-col gap-2 bg-charcoal-900 pb-2">
255255
<TSQLEditor

apps/webapp/app/v3/querySchemas.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,16 @@ export const runsSchema: TableSchema = {
375375
example: "user:1234567",
376376
}),
377377
},
378+
max_duration: {
379+
name: "max_duration",
380+
clickhouseName: "max_duration_in_seconds",
381+
...column("Nullable(UInt32)", {
382+
description:
383+
"The maximum allowed compute duration for this run in seconds. If the run exceeds this duration, the run will fail with an error. Can be set on an individual task, in the trigger.config, or per-run when triggering.",
384+
example: "300",
385+
customRenderType: "durationSeconds",
386+
}),
387+
},
378388
bulk_action_group_ids: {
379389
name: "bulk_action_group_ids",
380390
...column("Array(String)", {

0 commit comments

Comments
 (0)