From 2b983451908a30cd443bd036afbbf12a67d1dbf8 Mon Sep 17 00:00:00 2001 From: Beto Dealmeida Date: Mon, 2 Dec 2019 16:14:28 -0800 Subject: [PATCH 1/5] Add protocol to cache warmup --- superset/assets/src/visualizations/presets/MainPreset.js | 2 +- superset/config.py | 1 + superset/tasks/cache.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/superset/assets/src/visualizations/presets/MainPreset.js b/superset/assets/src/visualizations/presets/MainPreset.js index f543fe34bc688..f91afaa6f8c83 100644 --- a/superset/assets/src/visualizations/presets/MainPreset.js +++ b/superset/assets/src/visualizations/presets/MainPreset.js @@ -60,7 +60,7 @@ import { LineMultiChartPlugin, PieChartPlugin, TimePivotChartPlugin, -} from '@superset-ui/legacy-preset-chart-nvd3/lib'; +} from '@superset-ui/legacy-preset-chart-nvd3/src'; import { BoxPlotChartPlugin } from '@superset-ui/preset-chart-xy/esm/legacy'; import { DeckGLChartPreset } from '@superset-ui/legacy-preset-chart-deckgl'; diff --git a/superset/config.py b/superset/config.py index 7391e284e98fc..5b339acd26b9b 100644 --- a/superset/config.py +++ b/superset/config.py @@ -93,6 +93,7 @@ def _try_json_readsha(filepath): SUPERSET_WORKERS = 2 # deprecated SUPERSET_CELERY_WORKERS = 32 # deprecated +SUPERSET_WEBSERVER_PROTOCOL = "http" SUPERSET_WEBSERVER_ADDRESS = "0.0.0.0" SUPERSET_WEBSERVER_PORT = 8088 diff --git a/superset/tasks/cache.py b/superset/tasks/cache.py index 09cd1f344427c..15d87dec7a0e4 100644 --- a/superset/tasks/cache.py +++ b/superset/tasks/cache.py @@ -75,7 +75,7 @@ def get_form_data(chart_id, dashboard=None): def get_url(chart): """Return external URL for warming up a given chart/table cache.""" with app.test_request_context(): - baseurl = "{SUPERSET_WEBSERVER_ADDRESS}:{SUPERSET_WEBSERVER_PORT}".format( + baseurl = "{SUPERSET_WEBSERVER_PROTOCOL}://{SUPERSET_WEBSERVER_ADDRESS}:{SUPERSET_WEBSERVER_PORT}".format( **app.config ) return f"{baseurl}{chart.url}" From 7375b765784b413c116879e504b3563afff9cd99 Mon Sep 17 00:00:00 2001 From: Beto Dealmeida Date: Mon, 2 Dec 2019 16:20:06 -0800 Subject: [PATCH 2/5] Update unit tests --- tests/strategy_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/strategy_tests.py b/tests/strategy_tests.py index 3a0dc62c28228..31a6bdfb3c6e7 100644 --- a/tests/strategy_tests.py +++ b/tests/strategy_tests.py @@ -29,7 +29,7 @@ from .base_tests import SupersetTestCase -URL_PREFIX = "0.0.0.0:8081" +URL_PREFIX = "http://0.0.0.0:8081" class CacheWarmUpTests(SupersetTestCase): From e0e0b316849454ef437c9116cc28791ac8560d9b Mon Sep 17 00:00:00 2001 From: Beto Dealmeida Date: Tue, 3 Dec 2019 09:50:18 -0800 Subject: [PATCH 3/5] Fix wrong commit --- superset/assets/src/visualizations/presets/MainPreset.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superset/assets/src/visualizations/presets/MainPreset.js b/superset/assets/src/visualizations/presets/MainPreset.js index f91afaa6f8c83..f543fe34bc688 100644 --- a/superset/assets/src/visualizations/presets/MainPreset.js +++ b/superset/assets/src/visualizations/presets/MainPreset.js @@ -60,7 +60,7 @@ import { LineMultiChartPlugin, PieChartPlugin, TimePivotChartPlugin, -} from '@superset-ui/legacy-preset-chart-nvd3/src'; +} from '@superset-ui/legacy-preset-chart-nvd3/lib'; import { BoxPlotChartPlugin } from '@superset-ui/preset-chart-xy/esm/legacy'; import { DeckGLChartPreset } from '@superset-ui/legacy-preset-chart-deckgl'; From 4e4af898b5a606bed98ae2aaf9e422f4d380bd0e Mon Sep 17 00:00:00 2001 From: Beto Dealmeida Date: Tue, 3 Dec 2019 10:09:58 -0800 Subject: [PATCH 4/5] Update UPDATING.md --- UPDATING.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/UPDATING.md b/UPDATING.md index 83909708f55f5..2c8ce25a17c4b 100644 --- a/UPDATING.md +++ b/UPDATING.md @@ -21,13 +21,19 @@ under the License. This file documents any backwards-incompatible changes in Superset and assists people when migrating to a new version. +## Next + +* [8721](https://github.com/apache/incubator-superset/pull/8721): When using the cache +warmup Celery task you should now specify the `SUPERSET_WEBSERVER_PROTOCOL` variable +in your configuration (probably either "http" or "https"). This defaults to "http". + ## 0.35.0 * [8512](https://github.com/apache/incubator-superset/pull/8512): `DRUID_IS_ACTIVE` now defaults to False. To enable Druid-API-based functionality, override the `DRUID_IS_ACTIVE` configuration variable by setting it to `True` for your deployment. -* [8450](https://github.com/apache/incubator-superset/pull/8450): The time ranger picker +* [8450](https://github.com/apache/incubator-superset/pull/8450): The time range picker now uses UTC for the tooltips and default placeholder timestamps (sans timezone). * [8370](https://github.com/apache/incubator-superset/pull/8370): Deprecates From ce1ad4ce3179127b28681f86cc34ccfd67de4aa7 Mon Sep 17 00:00:00 2001 From: Beto Dealmeida Date: Tue, 3 Dec 2019 10:29:04 -0800 Subject: [PATCH 5/5] Fix pylint --- superset/tasks/cache.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/superset/tasks/cache.py b/superset/tasks/cache.py index 15d87dec7a0e4..2d2eee9eab463 100644 --- a/superset/tasks/cache.py +++ b/superset/tasks/cache.py @@ -75,8 +75,10 @@ def get_form_data(chart_id, dashboard=None): def get_url(chart): """Return external URL for warming up a given chart/table cache.""" with app.test_request_context(): - baseurl = "{SUPERSET_WEBSERVER_PROTOCOL}://{SUPERSET_WEBSERVER_ADDRESS}:{SUPERSET_WEBSERVER_PORT}".format( - **app.config + baseurl = ( + "{SUPERSET_WEBSERVER_PROTOCOL}://" + "{SUPERSET_WEBSERVER_ADDRESS}:" + "{SUPERSET_WEBSERVER_PORT}".format(**app.config) ) return f"{baseurl}{chart.url}"