Update notebooks for JupyterLab 4 upgrade and new SQL cell #10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The JupyterLab version for notebooks will be updated to version
4.0.4
. In JupyterLab 4, the source code of a cell is saved as a single string (likely related to the CodeMirror upgrade). Before, it was an array of strings where each string represented a line of code. Although JupyterLab 4 is still able to read these old notebook files, it seems to append a newline at the end of each string in the array. As a result, every newline in the old notebook gets duplicated. As such, this MR updates the template notebooks to turn thesource
array of string into a single string.Additionally, notebooks will now support SQL cells, which are cells specified to run SQL without the need to pre-pend the magic command (i.e.
%%sql
). To mark a cell as SQL, its metadata needs to containlanguage: "sql"
. In the case where a cell used to output the results to a variable, the metadata must also containoutput_variable: "<variable>"
. The notebooks were therefore updated to:I only updated the SQL cells of notebooks which are currently on the Portal template list.
Note: There will likely also be a further update to the
Image Matching with SQL
notebook, sinceboto3
is broken with the new JupyterLab4 upgrade due to an incompatibility with the new version ofurllib
. A solution for this has not been decided yet.