Skip to content

Commit 25417af

Browse files
authored
vdk-notebook: [bug fix] ignore missing id field in cell (#2717)
Currently, when the cells of an IPython notebook are loaded, it is assumed that each cell has an `id` field. However, this is true only for vdk specific notebooks, not regular ones that users may use to execute vdk commands like create, deploy, etc. In cases, where the notebook is a regular one, the job execution fails abruptly at the plugin loading stage without any meaningful message, because only json-specific errors are being handled. Example job termination logs: ```bash 2023-09-28 19:55:51,215 [VDK] test-job [ERROR] vdk.internal.builtin_plugins.r cli_run.py:172 create_and_run_d[id:510b0034-2249-4840-8589-1c9a3f58bc59-1695920149-24c96]- Failed executing job. 'id' The provided Data Job will not be executed. Terminating application. See contents of the exception and fix the problem that causes it. Most likely a prerequisite or plugin of one of the key VDK components failed, see logs for details and ensure the prerequisite for the failed component (details in stacktrace). Process finished with exit code 1 ``` This change makes the `id` field not required, so that regular notebooks can be ignored and not fail job executions. Testing Done: Locally with a test data job that contained a regular IPython notebook and other regular python steps. Signed-off-by: Andon Andonov <[email protected]>
1 parent abffdf8 commit 25417af

File tree

1 file changed

+1
-1
lines changed
  • projects/vdk-plugins/vdk-notebook/src/vdk/plugin/notebook

1 file changed

+1
-1
lines changed

Diff for: projects/vdk-plugins/vdk-notebook/src/vdk/plugin/notebook/cell.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Cell:
1717
def __init__(self, jupyter_cell):
1818
self.tags = jupyter_cell["metadata"].get("tags", {})
1919
self.source, self.source_type = self.__extract_source_code(jupyter_cell)
20-
self.id = jupyter_cell["id"]
20+
self.id = jupyter_cell.get("id")
2121

2222
@staticmethod
2323
def __extract_source_code(jupyter_cell):

0 commit comments

Comments
 (0)