Skip to content

Commit

Permalink
add an optional name for dsl.Condition (kubeflow#3210)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaohanhuang authored and Xiaohan Huang committed Mar 4, 2020
1 parent acb3d4d commit a3897f8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sdk/python/kfp/dsl/_ops_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,18 +137,18 @@ class Condition(OpsGroup):
Example usage:
```python
with Condition(param1=='pizza'):
with Condition(param1=='pizza', '[param1 is pizza]'):
op1 = ContainerOp(...)
op2 = ContainerOp(...)
```
"""

def __init__(self, condition):
def __init__(self, condition, name = None):
"""Create a new instance of Condition.
Args:
condition (ConditionOperator): the condition.
"""
super(Condition, self).__init__('condition')
super(Condition, self).__init__('condition', name)
self.condition = condition


Expand Down

0 comments on commit a3897f8

Please sign in to comment.