Skip to content

Commit

Permalink
Fix ValueError not being raised
Browse files Browse the repository at this point in the history
  • Loading branch information
elikatsis committed Mar 10, 2020
1 parent 79c1315 commit cc26aed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sdk/python/kfp/dsl/_resource_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ def __init__(self,
])

if k8s_resource is None:
ValueError("You need to provide a k8s_resource.")
raise ValueError("You need to provide a k8s_resource.")

if merge_strategy and action != "apply":
ValueError("You can't set merge_strategy when action != 'apply'")
raise ValueError("You can't set merge_strategy when action != 'apply'")

# if action is delete, there should not be any outputs, success_condition, and failure_condition
if action == "delete" and (success_condition or failure_condition or attribute_outputs):
ValueError("You can't set success_condition, failure_condition, or attribute_outputs when action == 'delete'")
raise ValueError("You can't set success_condition, failure_condition, or attribute_outputs when action == 'delete'")

init_resource = {
"action": action,
Expand Down

0 comments on commit cc26aed

Please sign in to comment.