Skip to content
Open
Changes from 1 commit
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
8 changes: 7 additions & 1 deletion notebooks/notebook_template_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ class ErrorCode(Enum):
# H1 heading required
# git, colab and workbench link required
# links must be valid links
# Storage migration rules
ERROR_GSUTIL_DEPRECATED = 103, # Warning for deprecated gsutil usage
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The error code ERROR_GSUTIL_DEPRECATED is defined but not used anywhere in the script. To properly implement this feature, you should add logic to one of the NotebookRule classes to detect gsutil usage and report this error.

ERROR_TITLE_HEADING = 1,
ERROR_HEADING_CASE = 2,
ERROR_HEADING_CAP = 3,
Expand Down Expand Up @@ -1300,6 +1302,8 @@ def replace_cl(text : str ) -> str:
'NAS': '{{vertex_nas_name_short}}',
'Vertex AI Neural Architectural Search': '{{vertex_nas_name}}',
'Neural Architectural Search': '{{vertex_nas_name_short}}',
'{{vertex_nas_name}}',
'Neural Architectural Search': '{{vertex_nas_name_short}}',
'Vertex Workbench': '{{vertex_workbench_name}}',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This change introduces a SyntaxError because line 1305 is a single string literal instead of a key-value pair within the dictionary. Additionally, line 1306 is a duplicate of line 1304. These lines should be removed.

Suggested change
'{{vertex_nas_name}}',
'Neural Architectural Search': '{{vertex_nas_name_short}}',
'Vertex Workbench': '{{vertex_workbench_name}}',
'Vertex Workbench': '{{vertex_workbench_name}}',

'Vertex AI Workbench': '{{vertex_workbench_name}}',
#'Vertex SDK': '{{vertex_sdk_name}}',
Expand All @@ -1309,12 +1313,14 @@ def replace_cl(text : str ) -> str:
'Vertex AI': '{{vertex_ai_name}}',
'Ray on Vertex AI': '{{ray_vertex_ai_name}}',
'Google Cloud console': '{{console_name}}',

'Cloud Storage': '{{storage_name}}',
'GCS': '{{storage_name}}',
'GCP': '{{gcp_name}}',
'TensorFlow Enterprise': '{{tf4gcp_name}}',
'TensorFlow': '{{tensorflow_name}}',
'gsutil ': 'gcloud storage ',
'!gsutil ': '!gcloud storage ',
'! gsutil ': '! gcloud storage ',
Comment on lines +1319 to +1321
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The replace_cl function is currently only used for generating the discoverability index (add_index) and does not affect the actual notebook content. If the goal is to automatically migrate gsutil commands in the notebooks, these substitutions need to be applied to the notebook cells during the validation/fix process. Also, consider if the trailing spaces in the keys (e.g., 'gsutil ') might miss cases where the command is followed by a newline or tab.

}

for key, value in substitutions.items():
Expand Down