From 2c792773b4d88cc17cfb60c0c8f8b7f5d23b331d Mon Sep 17 00:00:00 2001 From: Daniel Gaspar Date: Mon, 10 Jan 2022 12:11:43 +0000 Subject: [PATCH 1/6] fix: Improve logger messages on core API --- superset-frontend/package-lock.json | 195 +++++++++++++++------------- superset/views/core.py | 16 +-- 2 files changed, 110 insertions(+), 101 deletions(-) diff --git a/superset-frontend/package-lock.json b/superset-frontend/package-lock.json index 41fd69a0b0dee..34f97a5c9050b 100644 --- a/superset-frontend/package-lock.json +++ b/superset-frontend/package-lock.json @@ -21110,10 +21110,6 @@ "resolved": "plugins/legacy-plugin-chart-sunburst", "link": true }, - "node_modules/@superset-ui/legacy-plugin-chart-time-table": { - "resolved": "plugins/legacy-plugin-chart-time-table", - "link": true - }, "node_modules/@superset-ui/legacy-plugin-chart-treemap": { "resolved": "plugins/legacy-plugin-chart-treemap", "link": true @@ -59827,6 +59823,26 @@ "@encodable/color": "=1.1.1" } }, + "packages/superset-ui-demo/node_modules/@superset-ui/legacy-plugin-chart-time-table": { + "version": "0.18.25", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-time-table/-/legacy-plugin-chart-time-table-0.18.25.tgz", + "integrity": "sha512-rRHtheYnBdumo5lRupXOdetB2/DIw9ayZ7KPWJP0JpdC9qR6i1OLKMvGNO67b+d6JIklNh538eHF3iP8E1Oo+Q==", + "dependencies": { + "@data-ui/sparkline": "^0.0.84", + "@superset-ui/chart-controls": "0.18.25", + "@superset-ui/core": "0.18.25", + "@types/d3-scale": "^2.0.2", + "d3-scale": "^3.2.1", + "moment": "^2.26.0", + "mustache": "^4.0.1", + "prop-types": "^15.7.2", + "reactable-arc": "^0.15.0" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.3.1" + } + }, "packages/superset-ui-demo/node_modules/ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", @@ -59877,6 +59893,34 @@ "node": ">=8" } }, + "packages/superset-ui-demo/node_modules/d3-array": { + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-2.12.1.tgz", + "integrity": "sha512-B0ErZK/66mHtEsR1TkPEEkwdy+WDesimkM5gpZr5Dsg54BiTA5RXtYW5qTLIAcekaS9xfZrzBLF/OAkB3Qn1YQ==", + "dependencies": { + "internmap": "^1.0.0" + } + }, + "packages/superset-ui-demo/node_modules/d3-scale": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-3.3.0.tgz", + "integrity": "sha512-1JGp44NQCt5d1g+Yy+GeOnZP7xHo0ii8zsQp6PGzd+C1/dl0KGsp9A7Mxwp+1D1o4unbTTxVdU/ZOIEBoeZPbQ==", + "dependencies": { + "d3-array": "^2.3.0", + "d3-format": "1 - 2", + "d3-interpolate": "1.2.0 - 2", + "d3-time": "^2.1.1", + "d3-time-format": "2 - 3" + } + }, + "packages/superset-ui-demo/node_modules/d3-time": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-2.1.1.tgz", + "integrity": "sha512-/eIQe/eR4kCQwq7yxi7z4c6qEXf2IYGcjoWB5OOQy4Tq9Uv39/947qlDcN2TLkiTzQWzvnsuYPB9TrWaNfipKQ==", + "dependencies": { + "d3-array": "2" + } + }, "packages/superset-ui-demo/node_modules/deepmerge": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", @@ -59982,6 +60026,14 @@ "node": ">=8.6" } }, + "packages/superset-ui-demo/node_modules/mustache": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", + "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==", + "bin": { + "mustache": "bin/mustache" + } + }, "packages/superset-ui-demo/node_modules/parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -60476,6 +60528,7 @@ "plugins/legacy-plugin-chart-time-table": { "name": "@superset-ui/legacy-plugin-chart-time-table", "version": "0.0.1", + "extraneous": true, "dependencies": { "@data-ui/sparkline": "^0.0.84", "@superset-ui/chart-controls": "0.18.25", @@ -60488,42 +60541,6 @@ "reactable-arc": "^0.15.0" } }, - "plugins/legacy-plugin-chart-time-table/node_modules/d3-array": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-2.12.1.tgz", - "integrity": "sha512-B0ErZK/66mHtEsR1TkPEEkwdy+WDesimkM5gpZr5Dsg54BiTA5RXtYW5qTLIAcekaS9xfZrzBLF/OAkB3Qn1YQ==", - "dependencies": { - "internmap": "^1.0.0" - } - }, - "plugins/legacy-plugin-chart-time-table/node_modules/d3-scale": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-3.3.0.tgz", - "integrity": "sha512-1JGp44NQCt5d1g+Yy+GeOnZP7xHo0ii8zsQp6PGzd+C1/dl0KGsp9A7Mxwp+1D1o4unbTTxVdU/ZOIEBoeZPbQ==", - "dependencies": { - "d3-array": "^2.3.0", - "d3-format": "1 - 2", - "d3-interpolate": "1.2.0 - 2", - "d3-time": "^2.1.1", - "d3-time-format": "2 - 3" - } - }, - "plugins/legacy-plugin-chart-time-table/node_modules/d3-time": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-2.1.1.tgz", - "integrity": "sha512-/eIQe/eR4kCQwq7yxi7z4c6qEXf2IYGcjoWB5OOQy4Tq9Uv39/947qlDcN2TLkiTzQWzvnsuYPB9TrWaNfipKQ==", - "dependencies": { - "d3-array": "2" - } - }, - "plugins/legacy-plugin-chart-time-table/node_modules/mustache": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", - "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==", - "bin": { - "mustache": "bin/mustache" - } - }, "plugins/legacy-plugin-chart-treemap": { "name": "@superset-ui/legacy-plugin-chart-treemap", "version": "0.18.25", @@ -76845,6 +76862,22 @@ "typescript": "^3.8.3" }, "dependencies": { + "@superset-ui/legacy-plugin-chart-time-table": { + "version": "0.18.25", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-time-table/-/legacy-plugin-chart-time-table-0.18.25.tgz", + "integrity": "sha512-rRHtheYnBdumo5lRupXOdetB2/DIw9ayZ7KPWJP0JpdC9qR6i1OLKMvGNO67b+d6JIklNh538eHF3iP8E1Oo+Q==", + "requires": { + "@data-ui/sparkline": "^0.0.84", + "@superset-ui/chart-controls": "0.18.25", + "@superset-ui/core": "0.18.25", + "@types/d3-scale": "^2.0.2", + "d3-scale": "^3.2.1", + "moment": "^2.26.0", + "mustache": "^4.0.1", + "prop-types": "^15.7.2", + "reactable-arc": "^0.15.0" + } + }, "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", @@ -76881,6 +76914,34 @@ "yaml": "^1.7.2" } }, + "d3-array": { + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-2.12.1.tgz", + "integrity": "sha512-B0ErZK/66mHtEsR1TkPEEkwdy+WDesimkM5gpZr5Dsg54BiTA5RXtYW5qTLIAcekaS9xfZrzBLF/OAkB3Qn1YQ==", + "requires": { + "internmap": "^1.0.0" + } + }, + "d3-scale": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-3.3.0.tgz", + "integrity": "sha512-1JGp44NQCt5d1g+Yy+GeOnZP7xHo0ii8zsQp6PGzd+C1/dl0KGsp9A7Mxwp+1D1o4unbTTxVdU/ZOIEBoeZPbQ==", + "requires": { + "d3-array": "^2.3.0", + "d3-format": "1 - 2", + "d3-interpolate": "1.2.0 - 2", + "d3-time": "^2.1.1", + "d3-time-format": "2 - 3" + } + }, + "d3-time": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-2.1.1.tgz", + "integrity": "sha512-/eIQe/eR4kCQwq7yxi7z4c6qEXf2IYGcjoWB5OOQy4Tq9Uv39/947qlDcN2TLkiTzQWzvnsuYPB9TrWaNfipKQ==", + "requires": { + "d3-array": "2" + } + }, "deepmerge": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", @@ -76961,6 +77022,11 @@ "picomatch": "^2.2.3" } }, + "mustache": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", + "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==" + }, "parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -77363,55 +77429,6 @@ "prop-types": "^15.6.2" } }, - "@superset-ui/legacy-plugin-chart-time-table": { - "version": "file:plugins/legacy-plugin-chart-time-table", - "requires": { - "@data-ui/sparkline": "^0.0.84", - "@superset-ui/chart-controls": "0.18.25", - "@superset-ui/core": "0.18.25", - "@types/d3-scale": "^2.0.2", - "d3-scale": "^3.2.1", - "moment": "^2.26.0", - "mustache": "^4.0.1", - "prop-types": "^15.7.2", - "reactable-arc": "^0.15.0" - }, - "dependencies": { - "d3-array": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-2.12.1.tgz", - "integrity": "sha512-B0ErZK/66mHtEsR1TkPEEkwdy+WDesimkM5gpZr5Dsg54BiTA5RXtYW5qTLIAcekaS9xfZrzBLF/OAkB3Qn1YQ==", - "requires": { - "internmap": "^1.0.0" - } - }, - "d3-scale": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-3.3.0.tgz", - "integrity": "sha512-1JGp44NQCt5d1g+Yy+GeOnZP7xHo0ii8zsQp6PGzd+C1/dl0KGsp9A7Mxwp+1D1o4unbTTxVdU/ZOIEBoeZPbQ==", - "requires": { - "d3-array": "^2.3.0", - "d3-format": "1 - 2", - "d3-interpolate": "1.2.0 - 2", - "d3-time": "^2.1.1", - "d3-time-format": "2 - 3" - } - }, - "d3-time": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-2.1.1.tgz", - "integrity": "sha512-/eIQe/eR4kCQwq7yxi7z4c6qEXf2IYGcjoWB5OOQy4Tq9Uv39/947qlDcN2TLkiTzQWzvnsuYPB9TrWaNfipKQ==", - "requires": { - "d3-array": "2" - } - }, - "mustache": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", - "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==" - } - } - }, "@superset-ui/legacy-plugin-chart-treemap": { "version": "file:plugins/legacy-plugin-chart-treemap", "requires": { diff --git a/superset/views/core.py b/superset/views/core.py index ecbd13df32673..feead02731f5f 100755 --- a/superset/views/core.py +++ b/superset/views/core.py @@ -2014,10 +2014,7 @@ def sync_druid_source(self) -> FlaskResponse: # pylint: disable=no-self-use ] DruidCluster = DruidDatasource.cluster_class # pylint: disable=invalid-name if not user: - err_msg = __( - "Can't find User '%(name)s', please ask your admin " "to create one.", - name=user_name, - ) + err_msg = __("Can't find User, please ask your admin to create one.") logger.error(err_msg, exc_info=True) return json_error_response(err_msg) cluster = ( @@ -2026,10 +2023,7 @@ def sync_druid_source(self) -> FlaskResponse: # pylint: disable=no-self-use .one_or_none() ) if not cluster: - err_msg = __( - "Can't find DruidCluster with cluster_name = " "'%(name)s'", - name=cluster_name, - ) + err_msg = __("Can't find DruidCluster") logger.error(err_msg, exc_info=True) return json_error_response(err_msg) try: @@ -2376,8 +2370,7 @@ def results_exec(key: str) -> FlaskResponse: max_tries=5, ) def stop_query(self) -> FlaskResponse: - client_id = request.form.get("client_id") - + client_id = int(request.form.get("client_id")) query = db.session.query(Query).filter_by(client_id=client_id).one() if query.status in [ QueryStatus.FAILED, @@ -2385,9 +2378,8 @@ def stop_query(self) -> FlaskResponse: QueryStatus.TIMED_OUT, ]: logger.warning( - "Query with client_id %s could not be stopped: " + "Query with client_id could not be stopped: " "query already complete", - str(client_id), ) return self.json_response("OK") From 4b0ab10b014f9fbf52d98cda9e90220e1a90330d Mon Sep 17 00:00:00 2001 From: Daniel Gaspar Date: Mon, 10 Jan 2022 12:15:29 +0000 Subject: [PATCH 2/6] revert package.json change --- superset-frontend/package-lock.json | 195 +++++++++++++--------------- 1 file changed, 89 insertions(+), 106 deletions(-) diff --git a/superset-frontend/package-lock.json b/superset-frontend/package-lock.json index 34f97a5c9050b..41fd69a0b0dee 100644 --- a/superset-frontend/package-lock.json +++ b/superset-frontend/package-lock.json @@ -21110,6 +21110,10 @@ "resolved": "plugins/legacy-plugin-chart-sunburst", "link": true }, + "node_modules/@superset-ui/legacy-plugin-chart-time-table": { + "resolved": "plugins/legacy-plugin-chart-time-table", + "link": true + }, "node_modules/@superset-ui/legacy-plugin-chart-treemap": { "resolved": "plugins/legacy-plugin-chart-treemap", "link": true @@ -59823,26 +59827,6 @@ "@encodable/color": "=1.1.1" } }, - "packages/superset-ui-demo/node_modules/@superset-ui/legacy-plugin-chart-time-table": { - "version": "0.18.25", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-time-table/-/legacy-plugin-chart-time-table-0.18.25.tgz", - "integrity": "sha512-rRHtheYnBdumo5lRupXOdetB2/DIw9ayZ7KPWJP0JpdC9qR6i1OLKMvGNO67b+d6JIklNh538eHF3iP8E1Oo+Q==", - "dependencies": { - "@data-ui/sparkline": "^0.0.84", - "@superset-ui/chart-controls": "0.18.25", - "@superset-ui/core": "0.18.25", - "@types/d3-scale": "^2.0.2", - "d3-scale": "^3.2.1", - "moment": "^2.26.0", - "mustache": "^4.0.1", - "prop-types": "^15.7.2", - "reactable-arc": "^0.15.0" - }, - "peerDependencies": { - "@types/react": "*", - "react": "^16.3.1" - } - }, "packages/superset-ui-demo/node_modules/ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", @@ -59893,34 +59877,6 @@ "node": ">=8" } }, - "packages/superset-ui-demo/node_modules/d3-array": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-2.12.1.tgz", - "integrity": "sha512-B0ErZK/66mHtEsR1TkPEEkwdy+WDesimkM5gpZr5Dsg54BiTA5RXtYW5qTLIAcekaS9xfZrzBLF/OAkB3Qn1YQ==", - "dependencies": { - "internmap": "^1.0.0" - } - }, - "packages/superset-ui-demo/node_modules/d3-scale": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-3.3.0.tgz", - "integrity": "sha512-1JGp44NQCt5d1g+Yy+GeOnZP7xHo0ii8zsQp6PGzd+C1/dl0KGsp9A7Mxwp+1D1o4unbTTxVdU/ZOIEBoeZPbQ==", - "dependencies": { - "d3-array": "^2.3.0", - "d3-format": "1 - 2", - "d3-interpolate": "1.2.0 - 2", - "d3-time": "^2.1.1", - "d3-time-format": "2 - 3" - } - }, - "packages/superset-ui-demo/node_modules/d3-time": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-2.1.1.tgz", - "integrity": "sha512-/eIQe/eR4kCQwq7yxi7z4c6qEXf2IYGcjoWB5OOQy4Tq9Uv39/947qlDcN2TLkiTzQWzvnsuYPB9TrWaNfipKQ==", - "dependencies": { - "d3-array": "2" - } - }, "packages/superset-ui-demo/node_modules/deepmerge": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", @@ -60026,14 +59982,6 @@ "node": ">=8.6" } }, - "packages/superset-ui-demo/node_modules/mustache": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", - "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==", - "bin": { - "mustache": "bin/mustache" - } - }, "packages/superset-ui-demo/node_modules/parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -60528,7 +60476,6 @@ "plugins/legacy-plugin-chart-time-table": { "name": "@superset-ui/legacy-plugin-chart-time-table", "version": "0.0.1", - "extraneous": true, "dependencies": { "@data-ui/sparkline": "^0.0.84", "@superset-ui/chart-controls": "0.18.25", @@ -60541,6 +60488,42 @@ "reactable-arc": "^0.15.0" } }, + "plugins/legacy-plugin-chart-time-table/node_modules/d3-array": { + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-2.12.1.tgz", + "integrity": "sha512-B0ErZK/66mHtEsR1TkPEEkwdy+WDesimkM5gpZr5Dsg54BiTA5RXtYW5qTLIAcekaS9xfZrzBLF/OAkB3Qn1YQ==", + "dependencies": { + "internmap": "^1.0.0" + } + }, + "plugins/legacy-plugin-chart-time-table/node_modules/d3-scale": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-3.3.0.tgz", + "integrity": "sha512-1JGp44NQCt5d1g+Yy+GeOnZP7xHo0ii8zsQp6PGzd+C1/dl0KGsp9A7Mxwp+1D1o4unbTTxVdU/ZOIEBoeZPbQ==", + "dependencies": { + "d3-array": "^2.3.0", + "d3-format": "1 - 2", + "d3-interpolate": "1.2.0 - 2", + "d3-time": "^2.1.1", + "d3-time-format": "2 - 3" + } + }, + "plugins/legacy-plugin-chart-time-table/node_modules/d3-time": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-2.1.1.tgz", + "integrity": "sha512-/eIQe/eR4kCQwq7yxi7z4c6qEXf2IYGcjoWB5OOQy4Tq9Uv39/947qlDcN2TLkiTzQWzvnsuYPB9TrWaNfipKQ==", + "dependencies": { + "d3-array": "2" + } + }, + "plugins/legacy-plugin-chart-time-table/node_modules/mustache": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", + "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==", + "bin": { + "mustache": "bin/mustache" + } + }, "plugins/legacy-plugin-chart-treemap": { "name": "@superset-ui/legacy-plugin-chart-treemap", "version": "0.18.25", @@ -76862,22 +76845,6 @@ "typescript": "^3.8.3" }, "dependencies": { - "@superset-ui/legacy-plugin-chart-time-table": { - "version": "0.18.25", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-time-table/-/legacy-plugin-chart-time-table-0.18.25.tgz", - "integrity": "sha512-rRHtheYnBdumo5lRupXOdetB2/DIw9ayZ7KPWJP0JpdC9qR6i1OLKMvGNO67b+d6JIklNh538eHF3iP8E1Oo+Q==", - "requires": { - "@data-ui/sparkline": "^0.0.84", - "@superset-ui/chart-controls": "0.18.25", - "@superset-ui/core": "0.18.25", - "@types/d3-scale": "^2.0.2", - "d3-scale": "^3.2.1", - "moment": "^2.26.0", - "mustache": "^4.0.1", - "prop-types": "^15.7.2", - "reactable-arc": "^0.15.0" - } - }, "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", @@ -76914,34 +76881,6 @@ "yaml": "^1.7.2" } }, - "d3-array": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-2.12.1.tgz", - "integrity": "sha512-B0ErZK/66mHtEsR1TkPEEkwdy+WDesimkM5gpZr5Dsg54BiTA5RXtYW5qTLIAcekaS9xfZrzBLF/OAkB3Qn1YQ==", - "requires": { - "internmap": "^1.0.0" - } - }, - "d3-scale": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-3.3.0.tgz", - "integrity": "sha512-1JGp44NQCt5d1g+Yy+GeOnZP7xHo0ii8zsQp6PGzd+C1/dl0KGsp9A7Mxwp+1D1o4unbTTxVdU/ZOIEBoeZPbQ==", - "requires": { - "d3-array": "^2.3.0", - "d3-format": "1 - 2", - "d3-interpolate": "1.2.0 - 2", - "d3-time": "^2.1.1", - "d3-time-format": "2 - 3" - } - }, - "d3-time": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-2.1.1.tgz", - "integrity": "sha512-/eIQe/eR4kCQwq7yxi7z4c6qEXf2IYGcjoWB5OOQy4Tq9Uv39/947qlDcN2TLkiTzQWzvnsuYPB9TrWaNfipKQ==", - "requires": { - "d3-array": "2" - } - }, "deepmerge": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", @@ -77022,11 +76961,6 @@ "picomatch": "^2.2.3" } }, - "mustache": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", - "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==" - }, "parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -77429,6 +77363,55 @@ "prop-types": "^15.6.2" } }, + "@superset-ui/legacy-plugin-chart-time-table": { + "version": "file:plugins/legacy-plugin-chart-time-table", + "requires": { + "@data-ui/sparkline": "^0.0.84", + "@superset-ui/chart-controls": "0.18.25", + "@superset-ui/core": "0.18.25", + "@types/d3-scale": "^2.0.2", + "d3-scale": "^3.2.1", + "moment": "^2.26.0", + "mustache": "^4.0.1", + "prop-types": "^15.7.2", + "reactable-arc": "^0.15.0" + }, + "dependencies": { + "d3-array": { + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-2.12.1.tgz", + "integrity": "sha512-B0ErZK/66mHtEsR1TkPEEkwdy+WDesimkM5gpZr5Dsg54BiTA5RXtYW5qTLIAcekaS9xfZrzBLF/OAkB3Qn1YQ==", + "requires": { + "internmap": "^1.0.0" + } + }, + "d3-scale": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-3.3.0.tgz", + "integrity": "sha512-1JGp44NQCt5d1g+Yy+GeOnZP7xHo0ii8zsQp6PGzd+C1/dl0KGsp9A7Mxwp+1D1o4unbTTxVdU/ZOIEBoeZPbQ==", + "requires": { + "d3-array": "^2.3.0", + "d3-format": "1 - 2", + "d3-interpolate": "1.2.0 - 2", + "d3-time": "^2.1.1", + "d3-time-format": "2 - 3" + } + }, + "d3-time": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-2.1.1.tgz", + "integrity": "sha512-/eIQe/eR4kCQwq7yxi7z4c6qEXf2IYGcjoWB5OOQy4Tq9Uv39/947qlDcN2TLkiTzQWzvnsuYPB9TrWaNfipKQ==", + "requires": { + "d3-array": "2" + } + }, + "mustache": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", + "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==" + } + } + }, "@superset-ui/legacy-plugin-chart-treemap": { "version": "file:plugins/legacy-plugin-chart-treemap", "requires": { From 89837c41390f2969f996aa1cdd70fdb55ad770e1 Mon Sep 17 00:00:00 2001 From: Daniel Gaspar Date: Mon, 10 Jan 2022 13:01:58 +0000 Subject: [PATCH 3/6] fix --- superset/views/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superset/views/core.py b/superset/views/core.py index feead02731f5f..92d8308a05164 100755 --- a/superset/views/core.py +++ b/superset/views/core.py @@ -2370,7 +2370,7 @@ def results_exec(key: str) -> FlaskResponse: max_tries=5, ) def stop_query(self) -> FlaskResponse: - client_id = int(request.form.get("client_id")) + client_id = request.form.get("client_id") query = db.session.query(Query).filter_by(client_id=client_id).one() if query.status in [ QueryStatus.FAILED, From 38c6ebdd58941ff1a11aff6e304d74e63093038e Mon Sep 17 00:00:00 2001 From: Daniel Gaspar Date: Mon, 10 Jan 2022 13:52:23 +0000 Subject: [PATCH 4/6] black --- superset/views/core.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/superset/views/core.py b/superset/views/core.py index 92d8308a05164..77869afffa726 100755 --- a/superset/views/core.py +++ b/superset/views/core.py @@ -2378,8 +2378,7 @@ def stop_query(self) -> FlaskResponse: QueryStatus.TIMED_OUT, ]: logger.warning( - "Query with client_id could not be stopped: " - "query already complete", + "Query with client_id could not be stopped: " "query already complete", ) return self.json_response("OK") From 7a3b4f6b89b30c62e8d4b42b3d7766137daf569b Mon Sep 17 00:00:00 2001 From: Daniel Gaspar Date: Mon, 10 Jan 2022 16:48:49 +0000 Subject: [PATCH 5/6] improve log message --- superset/views/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superset/views/core.py b/superset/views/core.py index 77869afffa726..f3415efd40873 100755 --- a/superset/views/core.py +++ b/superset/views/core.py @@ -2014,7 +2014,7 @@ def sync_druid_source(self) -> FlaskResponse: # pylint: disable=no-self-use ] DruidCluster = DruidDatasource.cluster_class # pylint: disable=invalid-name if not user: - err_msg = __("Can't find User, please ask your admin to create one.") + err_msg = __("Can't find user, please ask your admin to create one.") logger.error(err_msg, exc_info=True) return json_error_response(err_msg) cluster = ( From 42493265728575b0ec4701c2b429a49ec1a549d3 Mon Sep 17 00:00:00 2001 From: Daniel Gaspar Date: Mon, 10 Jan 2022 18:09:51 +0000 Subject: [PATCH 6/6] improve message --- superset/views/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superset/views/core.py b/superset/views/core.py index f3415efd40873..ca7dae3ee51e7 100755 --- a/superset/views/core.py +++ b/superset/views/core.py @@ -2378,7 +2378,7 @@ def stop_query(self) -> FlaskResponse: QueryStatus.TIMED_OUT, ]: logger.warning( - "Query with client_id could not be stopped: " "query already complete", + "Query with client_id could not be stopped: query already complete", ) return self.json_response("OK")