Skip to content

Commit

Permalink
Update plugins/flytekit-spark/flytekitplugins/spark/agent.py
Browse files Browse the repository at this point in the history
Co-authored-by: Kevin Su <[email protected]>
  • Loading branch information
Future-Outlier and pingsutw authored Nov 7, 2023
1 parent 31b4f0d commit dad3e3d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions plugins/flytekit-spark/flytekitplugins/spark/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,12 @@ async def async_get(self, context: grpc.ServicerContext, resource_meta: bytes) -

cur_state = PENDING
message = ""
if response.get("state"):
if response["state"].get("result_state"):
cur_state = convert_to_flyte_state(response["state"]["result_state"])
if response["state"].get("state_message"):
message = response["state"]["state_message"]
state = response.get("state")
if state:
if state.get("result_state"):
cur_state = convert_to_flyte_state(state["result_state"])
if state.get("state_message"):
message = state["state_message"]

return GetTaskResponse(resource=Resource(state=cur_state, message=message))

Expand Down

0 comments on commit dad3e3d

Please sign in to comment.