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

Frontend - Show customized task display names #1463

Merged
Prev Previous commit
Next Next commit
Added test for op.set_display_name
  • Loading branch information
Ark-kun committed Jun 6, 2019
commit 7096c915392a7ea09e4019232879e72739a7c501
22 changes: 22 additions & 0 deletions sdk/python/tests/compiler/compiler_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import kfp
import kfp.compiler as compiler
import kfp.dsl as dsl
import os
Expand Down Expand Up @@ -497,6 +498,27 @@ def test_tolerations(self):

self._test_op_to_template_yaml(op1, file_base_name='tolerations')

def test_set_display_name(self):
"""Test a pipeline with a customized task names."""

import kfp
op1 = kfp.components.load_component_from_text(
'''
name: Component name
implementation:
container:
image: busybox
'''
)

@dsl.pipeline()
def some_pipeline():
op1().set_display_name('Custom name')

workflow_dict = kfp.compiler.Compiler()._compile(some_pipeline)
template = workflow_dict['spec']['templates'][0]
self.assertEqual(template['metadata']['annotations']['kubeflow.org/pipelines/task_display_name'], 'Custom name')

def test_op_transformers(self):
def some_op():
return dsl.ContainerOp(
Expand Down