Skip to content

Commit

Permalink
add an optional name for dsl.Condition (#3210)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaohanhuang committed Mar 4, 2020
1 parent acb3d4d commit 18375e8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 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,19 @@ 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.
name (str): name of the condition
"""
super(Condition, self).__init__('condition')
super(Condition, self).__init__('condition', name)
self.condition = condition


Expand Down

0 comments on commit 18375e8

Please sign in to comment.