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+Frontend - Fixed the task display name annotation key #1526

Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion frontend/src/lib/WorkflowParser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ describe('WorkflowParser', () => {
{
metadata: {
annotations: {
'kubeflow.org/pipelines/task_display_name': 'Customized name',
'pipelines.kubeflow.org/task_display_name': 'Customized name',
}
},
name: 'some-template',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/WorkflowParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export default class WorkflowParser {
if (workflow.spec && workflow.spec.templates) {
const tmpl = workflow.spec.templates.find(t => !!t && !!t.name && t.name === node.templateName);
if (tmpl && tmpl.metadata && tmpl.metadata.annotations) {
const displayName = tmpl.metadata.annotations['kubeflow.org/pipelines/task_display_name'];
const displayName = tmpl.metadata.annotations['pipelines.kubeflow.org/task_display_name'];
if (displayName) {
nodeLabel = displayName;
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/kfp/compiler/_op_to_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,6 @@ def _op_to_template(op: BaseOp):

# Display name
if processed_op.display_name:
template.setdefault('metadata', {}).setdefault('annotations', {})['kubeflow.org/pipelines/task_display_name'] = processed_op.display_name
template.setdefault('metadata', {}).setdefault('annotations', {})['pipelines.kubeflow.org/task_display_name'] = processed_op.display_name

return template
2 changes: 1 addition & 1 deletion sdk/python/tests/compiler/compiler_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ def some_pipeline():

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')
self.assertEqual(template['metadata']['annotations']['pipelines.kubeflow.org/task_display_name'], 'Custom name')

def test_op_transformers(self):
def some_op():
Expand Down