From 399813ae7baf45843238c5d64d270016f7fe2a9a Mon Sep 17 00:00:00 2001 From: Han Wang Date: Tue, 31 Jan 2023 07:12:22 +0000 Subject: [PATCH 1/6] Update keywords --- fugue_jupyter/_constants.py | 2 +- fugue_jupyter/nbextension/main.js | 2 +- package.json | 2 +- requirements.txt | 1 + src/utils.ts | 2 +- tests/fugue_jupyter/test_notebook.ipynb | 36 ++----------------------- 6 files changed, 7 insertions(+), 38 deletions(-) diff --git a/fugue_jupyter/_constants.py b/fugue_jupyter/_constants.py index 3e71d3a..ccdc5c6 100644 --- a/fugue_jupyter/_constants.py +++ b/fugue_jupyter/_constants.py @@ -7,7 +7,7 @@ for (var i = 0; i < words.length; ++i) obj[words[i]] = true; return obj; } -var fugue_keywords = "fill hash rand even presort persist broadcast params process output outtransform rowcount concurrency prepartition zip print title save append parquet csv json single checkpoint weak strong deterministic yield connect sample seed take sub callback dataframe file"; +var fugue_keywords = "system bernoulli reservoir fill hash rand even presort persist broadcast params process output outtransform rowcount concurrency prepartition zip print title save append parquet csv json single checkpoint weak strong deterministic yield connect sample seed take sub callback dataframe file"; CodeMirror.defineMIME("text/x-fsql", { name: "sql", keywords: set(fugue_keywords + " add after all alter analyze and anti archive array as asc at between bucket buckets by cache cascade case cast change clear cluster clustered codegen collection column columns comment commit compact compactions compute concatenate cost create cross cube current current_date current_timestamp database databases data dbproperties defined delete delimited deny desc describe dfs directories distinct distribute drop else end escaped except exchange exists explain export extended external false fields fileformat first following for format formatted from full function functions global grant group grouping having if ignore import in index indexes inner inpath inputformat insert intersect interval into is items join keys last lateral lazy left like limit lines list load local location lock locks logical macro map minus msck natural no not null nulls of on optimize option options or order out outer outputformat over overwrite partition partitioned partitions percent preceding principals purge range recordreader recordwriter recover reduce refresh regexp rename repair replace reset restrict revoke right rlike role roles rollback rollup row rows schema schemas select semi separated serde serdeproperties set sets show skewed sort sorted start statistics stored stratify struct table tables tablesample tblproperties temp temporary terminated then to touch transaction transactions transform true truncate unarchive unbounded uncache union unlock unset use using values view when where window with"), diff --git a/fugue_jupyter/nbextension/main.js b/fugue_jupyter/nbextension/main.js index d75d40b..e8bcfad 100644 --- a/fugue_jupyter/nbextension/main.js +++ b/fugue_jupyter/nbextension/main.js @@ -21,7 +21,7 @@ define([ return obj; } - var fugue_keywords = "fill hash rand even presort persist broadcast params process output outtransform rowcount concurrency prepartition zip print title save append parquet csv json single checkpoint weak strong deterministic yield connect sample seed take sub callback dataframe file"; + var fugue_keywords = "system bernoulli reservoir fill hash rand even presort persist broadcast params process output outtransform rowcount concurrency prepartition zip print title save append parquet csv json single checkpoint weak strong deterministic yield connect sample seed take sub callback dataframe file"; function load_extension() { diff --git a/package.json b/package.json index 39f5fd7..215b29a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fugue-jupyter", - "version": "0.2.1", + "version": "0.2.2", "description": "Jupyterlab Extension for Fugue", "keywords": [ "jupyter", diff --git a/requirements.txt b/requirements.txt index 474b38f..df96f55 100644 --- a/requirements.txt +++ b/requirements.txt @@ -22,5 +22,6 @@ jupyterlab jupyter-packaging jupyterlab-lsp cookiecutter +bleach>5.0.0 check-manifest diff --git a/src/utils.ts b/src/utils.ts index 462503c..9929244 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -91,7 +91,7 @@ function set(str: string) { } const fugue_keywords = - 'fill hash rand even presort persist broadcast params process output outtransform rowcount concurrency prepartition zip print title save append parquet csv json single checkpoint weak strong deterministic yield connect sample seed take sub callback dataframe file'; + 'system bernoulli reservoir fill hash rand even presort persist broadcast params process output outtransform rowcount concurrency prepartition zip print title save append parquet csv json single checkpoint weak strong deterministic yield connect sample seed take sub callback dataframe file'; /** * Register text editor based on file type. diff --git a/tests/fugue_jupyter/test_notebook.ipynb b/tests/fugue_jupyter/test_notebook.ipynb index 2c0e6c0..d758f93 100644 --- a/tests/fugue_jupyter/test_notebook.ipynb +++ b/tests/fugue_jupyter/test_notebook.ipynb @@ -420,39 +420,7 @@ }, { "data": { - "application/javascript": [ - "\n", - "require([\"codemirror/lib/codemirror\"]);\n", - "function set(str) {\n", - " var obj = {}, words = str.split(\" \");\n", - " for (var i = 0; i < words.length; ++i) obj[words[i]] = true;\n", - " return obj;\n", - " }\n", - "var fugue_keywords = \"fill hash rand even presort persist broadcast params process output outtransform rowcount concurrency prepartition zip print title save append parquet csv json single checkpoint weak strong deterministic yield connect sample seed take sub callback dataframe file\";\n", - "CodeMirror.defineMIME(\"text/x-fsql\", {\n", - " name: \"sql\",\n", - " keywords: set(fugue_keywords + \" add after all alter analyze and anti archive array as asc at between bucket buckets by cache cascade case cast change clear cluster clustered codegen collection column columns comment commit compact compactions compute concatenate cost create cross cube current current_date current_timestamp database databases data dbproperties defined delete delimited deny desc describe dfs directories distinct distribute drop else end escaped except exchange exists explain export extended external false fields fileformat first following for format formatted from full function functions global grant group grouping having if ignore import in index indexes inner inpath inputformat insert intersect interval into is items join keys last lateral lazy left like limit lines list load local location lock locks logical macro map minus msck natural no not null nulls of on optimize option options or order out outer outputformat over overwrite partition partitioned partitions percent preceding principals purge range recordreader recordwriter recover reduce refresh regexp rename repair replace reset restrict revoke right rlike role roles rollback rollup row rows schema schemas select semi separated serde serdeproperties set sets show skewed sort sorted start statistics stored stratify struct table tables tablesample tblproperties temp temporary terminated then to touch transaction transactions transform true truncate unarchive unbounded uncache union unlock unset use using values view when where window with\"),\n", - " builtin: set(\"date datetime tinyint smallint int bigint boolean float double string binary timestamp decimal array map struct uniontype delimited serde sequencefile textfile rcfile inputformat outputformat\"),\n", - " atoms: set(\"false true null\"),\n", - " operatorChars: /^[*\\/+\\-%<>!=~&|^]/,\n", - " dateSQL: set(\"time\"),\n", - " support: set(\"ODBCdotTable doubleQuote zerolessFloat\")\n", - " });\n", - "\n", - "CodeMirror.modeInfo.push( {\n", - " name: \"Fugue SQL\",\n", - " mime: \"text/x-fsql\",\n", - " mode: \"sql\"\n", - " } );\n", - "\n", - "require(['notebook/js/codecell'], function(codecell) {\n", - " codecell.CodeCell.options_default.highlight_modes['magic_text/x-fsql'] = {'reg':[/%%fsql/]} ;\n", - " Jupyter.notebook.events.on('kernel_ready.Kernel', function(){\n", - " Jupyter.notebook.get_cells().map(function(cell){\n", - " if (cell.cell_type == 'code'){ cell.auto_highlight(); } }) ;\n", - " });\n", - " });\n" - ], + "application/javascript": "\nrequire([\"codemirror/lib/codemirror\"]);\nfunction set(str) {\n var obj = {}, words = str.split(\" \");\n for (var i = 0; i < words.length; ++i) obj[words[i]] = true;\n return obj;\n }\nvar fugue_keywords = \"fill hash rand even presort persist broadcast params process output outtransform rowcount concurrency prepartition zip print title save append parquet csv json single checkpoint weak strong deterministic yield connect sample seed take sub callback dataframe file\";\nCodeMirror.defineMIME(\"text/x-fsql\", {\n name: \"sql\",\n keywords: set(fugue_keywords + \" add after all alter analyze and anti archive array as asc at between bucket buckets by cache cascade case cast change clear cluster clustered codegen collection column columns comment commit compact compactions compute concatenate cost create cross cube current current_date current_timestamp database databases data dbproperties defined delete delimited deny desc describe dfs directories distinct distribute drop else end escaped except exchange exists explain export extended external false fields fileformat first following for format formatted from full function functions global grant group grouping having if ignore import in index indexes inner inpath inputformat insert intersect interval into is items join keys last lateral lazy left like limit lines list load local location lock locks logical macro map minus msck natural no not null nulls of on optimize option options or order out outer outputformat over overwrite partition partitioned partitions percent preceding principals purge range recordreader recordwriter recover reduce refresh regexp rename repair replace reset restrict revoke right rlike role roles rollback rollup row rows schema schemas select semi separated serde serdeproperties set sets show skewed sort sorted start statistics stored stratify struct table tables tablesample tblproperties temp temporary terminated then to touch transaction transactions transform true truncate unarchive unbounded uncache union unlock unset use using values view when where window with\"),\n builtin: set(\"date datetime tinyint smallint int bigint boolean float double string binary timestamp decimal array map struct uniontype delimited serde sequencefile textfile rcfile inputformat outputformat\"),\n atoms: set(\"false true null\"),\n operatorChars: /^[*\\/+\\-%<>!=~&|^]/,\n dateSQL: set(\"time\"),\n support: set(\"ODBCdotTable doubleQuote zerolessFloat\")\n });\n\nCodeMirror.modeInfo.push( {\n name: \"Fugue SQL\",\n mime: \"text/x-fsql\",\n mode: \"sql\"\n } );\n\nrequire(['notebook/js/codecell'], function(codecell) {\n codecell.CodeCell.options_default.highlight_modes['magic_text/x-fsql'] = {'reg':[/%%fsql/]} ;\n Jupyter.notebook.events.on('kernel_ready.Kernel', function(){\n Jupyter.notebook.get_cells().map(function(cell){\n if (cell.cell_type == 'code'){ cell.auto_highlight(); } }) ;\n });\n });\n", "text/plain": [ "" ] @@ -568,7 +536,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.13" + "version": "3.8.13 (default, Apr 7 2022, 04:56:26) \n[GCC 10.2.1 20210110]" } }, "nbformat": 4, From 4a1f1b3f06dc7d31c4a86ec120801d1c0631a7df Mon Sep 17 00:00:00 2001 From: Han Wang Date: Tue, 31 Jan 2023 07:16:27 +0000 Subject: [PATCH 2/6] update --- fugue_jupyter/_constants.py | 2 +- fugue_jupyter/nbextension/main.js | 2 +- src/utils.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fugue_jupyter/_constants.py b/fugue_jupyter/_constants.py index ccdc5c6..37aed1d 100644 --- a/fugue_jupyter/_constants.py +++ b/fugue_jupyter/_constants.py @@ -7,7 +7,7 @@ for (var i = 0; i < words.length; ++i) obj[words[i]] = true; return obj; } -var fugue_keywords = "system bernoulli reservoir fill hash rand even presort persist broadcast params process output outtransform rowcount concurrency prepartition zip print title save append parquet csv json single checkpoint weak strong deterministic yield connect sample seed take sub callback dataframe file"; +var fugue_keywords = "system bernoulli reservoir approx fill hash rand even presort persist broadcast params process output outtransform rowcount concurrency prepartition zip print title save append parquet csv json single checkpoint weak strong deterministic yield connect sample seed take sub callback dataframe file"; CodeMirror.defineMIME("text/x-fsql", { name: "sql", keywords: set(fugue_keywords + " add after all alter analyze and anti archive array as asc at between bucket buckets by cache cascade case cast change clear cluster clustered codegen collection column columns comment commit compact compactions compute concatenate cost create cross cube current current_date current_timestamp database databases data dbproperties defined delete delimited deny desc describe dfs directories distinct distribute drop else end escaped except exchange exists explain export extended external false fields fileformat first following for format formatted from full function functions global grant group grouping having if ignore import in index indexes inner inpath inputformat insert intersect interval into is items join keys last lateral lazy left like limit lines list load local location lock locks logical macro map minus msck natural no not null nulls of on optimize option options or order out outer outputformat over overwrite partition partitioned partitions percent preceding principals purge range recordreader recordwriter recover reduce refresh regexp rename repair replace reset restrict revoke right rlike role roles rollback rollup row rows schema schemas select semi separated serde serdeproperties set sets show skewed sort sorted start statistics stored stratify struct table tables tablesample tblproperties temp temporary terminated then to touch transaction transactions transform true truncate unarchive unbounded uncache union unlock unset use using values view when where window with"), diff --git a/fugue_jupyter/nbextension/main.js b/fugue_jupyter/nbextension/main.js index e8bcfad..91a87e9 100644 --- a/fugue_jupyter/nbextension/main.js +++ b/fugue_jupyter/nbextension/main.js @@ -21,7 +21,7 @@ define([ return obj; } - var fugue_keywords = "system bernoulli reservoir fill hash rand even presort persist broadcast params process output outtransform rowcount concurrency prepartition zip print title save append parquet csv json single checkpoint weak strong deterministic yield connect sample seed take sub callback dataframe file"; + var fugue_keywords = "system bernoulli reservoir approx fill hash rand even presort persist broadcast params process output outtransform rowcount concurrency prepartition zip print title save append parquet csv json single checkpoint weak strong deterministic yield connect sample seed take sub callback dataframe file"; function load_extension() { diff --git a/src/utils.ts b/src/utils.ts index 9929244..c9e14ac 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -91,7 +91,7 @@ function set(str: string) { } const fugue_keywords = - 'system bernoulli reservoir fill hash rand even presort persist broadcast params process output outtransform rowcount concurrency prepartition zip print title save append parquet csv json single checkpoint weak strong deterministic yield connect sample seed take sub callback dataframe file'; + 'system bernoulli reservoir approx fill hash rand even presort persist broadcast params process output outtransform rowcount concurrency prepartition zip print title save append parquet csv json single checkpoint weak strong deterministic yield connect sample seed take sub callback dataframe file'; /** * Register text editor based on file type. From 499de7a017e7cdc0a211d0f83507466fe4f181ce Mon Sep 17 00:00:00 2001 From: Han Wang Date: Tue, 31 Jan 2023 07:24:35 +0000 Subject: [PATCH 3/6] fix build --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3c2f776..4554b26 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Nodejs 14 uses: actions/setup-node@v2 with: - node-version: '14.x' + node-version: '15.x' - name: Base Setup uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - name: Install dependencies @@ -59,7 +59,7 @@ jobs: - name: Set up Nodejs 14 uses: actions/setup-node@v2 with: - node-version: '14.x' + node-version: '15.x' - uses: actions/download-artifact@v2 with: name: myextension-sdist From f63dde0591810f2c13d6c4207f46706104a83303 Mon Sep 17 00:00:00 2001 From: Han Wang Date: Tue, 31 Jan 2023 07:36:25 +0000 Subject: [PATCH 4/6] fix --- .github/workflows/build.yml | 6 ++++-- .github/workflows/release.yml | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4554b26..a8c4cad 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,9 +19,11 @@ jobs: - name: Set up Nodejs 14 uses: actions/setup-node@v2 with: - node-version: '15.x' + node-version: '14.x' - name: Base Setup uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 + with: + python_version: "3.8" - name: Install dependencies run: make devenv - name: Build the extension @@ -59,7 +61,7 @@ jobs: - name: Set up Nodejs 14 uses: actions/setup-node@v2 with: - node-version: '15.x' + node-version: '14.x' - uses: actions/download-artifact@v2 with: name: myextension-sdist diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b9080e0..0783ade 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,6 +22,8 @@ jobs: - name: Base Setup uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 + with: + python_version: "3.8" - name: Install dependencies run: make devenv - name: Build and publish From 25d60b8ea3f605f061d2d67972f635417a3fb10b Mon Sep 17 00:00:00 2001 From: Han Wang Date: Tue, 31 Jan 2023 07:37:52 +0000 Subject: [PATCH 5/6] update --- .github/workflows/build.yml | 1 + .github/workflows/release.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a8c4cad..940adcd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,6 +24,7 @@ jobs: uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 with: python_version: "3.8" + node-version: '14.x' - name: Install dependencies run: make devenv - name: Build the extension diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0783ade..4b0eae9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,6 +24,7 @@ jobs: uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 with: python_version: "3.8" + node-version: '14.x' - name: Install dependencies run: make devenv - name: Build and publish From c117fc760f8427914d5704cfd2357aca0ada6700 Mon Sep 17 00:00:00 2001 From: Han Wang Date: Tue, 31 Jan 2023 07:41:01 +0000 Subject: [PATCH 6/6] fix --- .github/workflows/build.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 940adcd..b9653b8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,7 @@ jobs: uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 with: python_version: "3.8" - node-version: '14.x' + node_version: '14.x' - name: Install dependencies run: make devenv - name: Build the extension diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4b0eae9..b129bd2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,7 @@ jobs: uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 with: python_version: "3.8" - node-version: '14.x' + node_version: '14.x' - name: Install dependencies run: make devenv - name: Build and publish