Fix syntax error in snippets_menu pandas.js that breaks SnippetsMenu #1636
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.
There was a syntax error introduced to the pandas snippets in commit d0fb866, since it attempted to use single quotes within a single-quoted string.
Without this fix, the Snippets menu would entirely fail to load if the built-in Pandas snippets are included (as is the default), with the dev tools console reporting
Uncaught SyntaxError: Unexpected identifier 'label_count' (at pandas.js?v=20230413134100:119:39) 13:49:07.959
. This should resolve the problem and ensure that the default SnippetsMenu works again, and that pandas snippets can be included.As a workaround until this is merged and published, for anyone who comes across this, you can uncheck the "Include pandas sub-menu" option for Snippets Menu in the Nbextensions UI, or equivalently set
"snippets": {"include_submenu": { "pandas": false, } }
within your nbconfig file (which can be found atecho $(jupyter --config-dir)/nbconfig/notebook.json
).