Skip to content

Commit

Permalink
Added yaml_dict.get call to add id to notebook and updated template.y…
Browse files Browse the repository at this point in the history
…aml to match Katalog. (#245)

Signed-off-by: JAulet <[email protected]>
  • Loading branch information
JAulet authored Oct 29, 2021
1 parent 34c3ba3 commit fa40119
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ def _upload_notebook_yaml(yaml_file_content: AnyStr, name=None, access_token=Non

template_metadata = yaml_dict.get("metadata") or dict()

notebook_id = existing_id or generate_id(name=name or yaml_dict["name"])
notebook_id = existing_id or yaml_dict.get("id") or generate_id(name=name or yaml_dict["name"])
created_at = datetime.now()
name = name or yaml_dict["name"]
description = yaml_dict["description"].strip()
Expand Down
6 changes: 4 additions & 2 deletions notebooks/template.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Copyright 2021 The MLX Contributors
#
# SPDX-License-Identifier: Apache-2.0
name: <notebook_name> # required

id: <notebook_id> # Required, must be DNS-1123 subdomain, lower case alphanumeric characters and '-'
name: <notebook_name> # Required
description: <notebook_description> # Optional
metadata: # Optional metadata
annotations:
platform: <notebook_platform>
implementation: # required
implementation: # Required
github:
source: <notebook_github_URL>

0 comments on commit fa40119

Please sign in to comment.