Skip to content

Commit

Permalink
[Sparkjob] Fix termination time resolution (#1436)
Browse files Browse the repository at this point in the history
  • Loading branch information
urihoenig committed Oct 19, 2021
1 parent a5cd62c commit 7a04809
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions mlrun/runtimes/sparkjob/abstract.py
Expand Up @@ -626,11 +626,18 @@ def _resolve_crd_object_status_info(
)
completion_time = None
if in_terminal_state:
completion_time = datetime.fromisoformat(
crd_object.get("status", {})
.get("terminationTime")
.replace("Z", "+00:00")
)
if crd_object.get("status", {}).get("terminationTime"):
completion_time = datetime.fromisoformat(
crd_object.get("status", {})
.get("terminationTime")
.replace("Z", "+00:00")
)
else:
completion_time = datetime.fromisoformat(
crd_object.get("status", {})
.get("lastSubmissionAttemptTime")
.replace("Z", "+00:00")
)
return in_terminal_state, completion_time, desired_run_state

def _update_ui_url(
Expand Down

0 comments on commit 7a04809

Please sign in to comment.