Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SDK] Fix Failed condition in wait Job API #2160

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions sdk/python/kubeflow/training/api/training_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,8 @@ def wait_for_job_conditions(
Raises:
ValueError: Invalid input parameters.
TimeoutError: Timeout to get Job.
RuntimeError: Failed to get Job or Job reaches unexpected Failed condition.
RuntimeError: Failed to get Job, or Job reaches Failed condition and
Failed is not in `expected_conditions` set.
"""

namespace = namespace or self.namespace
Expand Down Expand Up @@ -904,9 +905,9 @@ def wait_for_job_conditions(
if callback:
callback(job)

# Raise an exception if Job is Failed and Failed is not expected condition.
# Raise an exception if Job is Failed and Failed is not the expected condition.
if (
constants.JOB_CONDITION_FAILED not in conditions
constants.JOB_CONDITION_FAILED not in expected_conditions
and utils.has_condition(conditions, constants.JOB_CONDITION_FAILED)
):
raise RuntimeError(
Expand Down
Loading