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]>
Signed-off-by: Future Outlier <[email protected]>
  • Loading branch information
2 people authored and Future Outlier committed Nov 7, 2023
1 parent 31b4f0d commit 539bad1
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 539bad1

Please sign in to comment.