-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Changes - Load events with `retry` instead of `setTimeout` - Better handle cancellation - Show spinning icon for more DLT states - Merge Event Log and Run Status tree sections - Remove run "cause" item, since the same thing is visible in one of the events <img width="602" alt="Screenshot 2024-11-28 at 16 24 04" src="https://github.com/user-attachments/assets/0481ca7e-d00d-4256-99ff-192fd59f696a"> ## Tests <!-- How is this tested? -->
- Loading branch information
Showing
11 changed files
with
186 additions
and
264 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ export type RunState = | |
| "unknown" | ||
| "error" | ||
| "timeout" | ||
| "cancelling" | ||
| "cancelled"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
packages/databricks-vscode/src/ui/bundle-resource-explorer/PipelineEventTreeNode.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import {ThemeColor, ThemeIcon} from "vscode"; | ||
import {ContextUtils} from "./utils"; | ||
import {TreeItemTreeNode} from "../TreeItemTreeNode"; | ||
import { | ||
EventLevel, | ||
PipelineEvent, | ||
} from "@databricks/databricks-sdk/dist/apis/pipelines"; | ||
|
||
export class PipelineEventTreeNode<T> extends TreeItemTreeNode<T> { | ||
constructor( | ||
public event: PipelineEvent, | ||
parent: T | ||
) { | ||
super( | ||
{ | ||
label: event.message ?? event.event_type ?? "unknown", | ||
iconPath: getEventIcon(event.level), | ||
tooltip: event.message, | ||
contextValue: ContextUtils.getContextString({ | ||
nodeType: "pipeline_run_event", | ||
hasPipelineDetails: hasDetails(event), | ||
}), | ||
}, | ||
parent | ||
); | ||
} | ||
} | ||
|
||
function hasDetails(event: PipelineEvent): boolean { | ||
return ( | ||
event.error?.exceptions !== undefined && | ||
event.error.exceptions.length > 0 | ||
); | ||
} | ||
|
||
function getEventIcon(level: EventLevel | undefined): ThemeIcon { | ||
switch (level) { | ||
case "ERROR": | ||
return new ThemeIcon( | ||
"error", | ||
new ThemeColor("list.errorForeground") | ||
); | ||
case "INFO": | ||
return new ThemeIcon("info"); | ||
case "METRICS": | ||
return new ThemeIcon("dashboard"); | ||
case "WARN": | ||
return new ThemeIcon( | ||
"warning", | ||
new ThemeColor("list.warningForeground") | ||
); | ||
default: | ||
return new ThemeIcon("question"); | ||
} | ||
} |
Oops, something went wrong.