From 735cc4016220b3d1e79db4078fa9e09145fd50a9 Mon Sep 17 00:00:00 2001 From: Max Fitton Date: Thu, 6 Aug 2020 12:59:52 -0700 Subject: [PATCH] The required resources field is not always present, leading the logical view to crash when it is not present. (#9959) Co-authored-by: Max Fitton --- python/ray/dashboard/client/src/api.ts | 2 +- .../dashboard/client/src/pages/dashboard/logical-view/Actor.tsx | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/python/ray/dashboard/client/src/api.ts b/python/ray/dashboard/client/src/api.ts index c708bb918..835188911 100644 --- a/python/ray/dashboard/client/src/api.ts +++ b/python/ray/dashboard/client/src/api.ts @@ -189,7 +189,7 @@ export type FullActorInfo = { export type PartialActorInfo = { actorId: string; actorTitle: string; - requiredResources: { [key: string]: number }; + requiredResources?: { [key: string]: number }; state: ActorState.Invalid; invalidStateType?: InvalidStateType; }; diff --git a/python/ray/dashboard/client/src/pages/dashboard/logical-view/Actor.tsx b/python/ray/dashboard/client/src/pages/dashboard/logical-view/Actor.tsx index c0f8f266d..f8d9fa539 100644 --- a/python/ray/dashboard/client/src/pages/dashboard/logical-view/Actor.tsx +++ b/python/ray/dashboard/client/src/pages/dashboard/logical-view/Actor.tsx @@ -192,6 +192,7 @@ class Actor extends React.Component, State> { { label: "Required resources", value: + actor.requiredResources && Object.entries(actor.requiredResources).length > 0 && Object.entries(actor.requiredResources) .sort((a, b) => a[0].localeCompare(b[0]))