From efb44ba59d0f94d95ef177d543cf728aae7d0d42 Mon Sep 17 00:00:00 2001 From: Daniel Vaz Gaspar Date: Fri, 15 Nov 2019 09:25:23 +0000 Subject: [PATCH 1/4] [druid] Fix, pydruid forced dependency (#8566) * [druid] Fix, forced pydruid dependency * [druid] Fix, more type annotation that force pydruid dependency --- superset/connectors/druid/models.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/superset/connectors/druid/models.py b/superset/connectors/druid/models.py index af68f1046af7d..81653512bf890 100644 --- a/superset/connectors/druid/models.py +++ b/superset/connectors/druid/models.py @@ -167,7 +167,7 @@ def get_base_broker_url(self) -> str: base_url = self.get_base_url(self.broker_host, self.broker_port) return f"{base_url}/{self.broker_endpoint}" - def get_pydruid_client(self) -> PyDruid: + def get_pydruid_client(self) -> "PyDruid": cli = PyDruid( self.get_base_url(self.broker_host, self.broker_port), self.broker_endpoint ) @@ -829,7 +829,7 @@ def granularity( return granularity @staticmethod - def get_post_agg(mconf: Dict) -> Postaggregator: + def get_post_agg(mconf: Dict) -> "Postaggregator": """ For a metric specified as `postagg` returns the kind of post aggregation for pydruid. @@ -1441,7 +1441,7 @@ def _create_extraction_fn(dim_spec): return (col, extraction_fn) @classmethod - def get_filters(cls, raw_filters, num_cols, columns_dict) -> Filter: + def get_filters(cls, raw_filters, num_cols, columns_dict) -> "Filter": """Given Superset filter data structure, returns pydruid Filter(s)""" filters = None for flt in raw_filters: @@ -1570,7 +1570,7 @@ def get_filters(cls, raw_filters, num_cols, columns_dict) -> Filter: return filters - def _get_having_obj(self, col: str, op: str, eq: str) -> Having: + def _get_having_obj(self, col: str, op: str, eq: str) -> "Having": cond = None if op == "==": if col in self.column_names: @@ -1584,7 +1584,7 @@ def _get_having_obj(self, col: str, op: str, eq: str) -> Having: return cond - def get_having_filters(self, raw_filters: List[Dict]) -> Having: + def get_having_filters(self, raw_filters: List[Dict]) -> "Having": filters = None reversed_op_map = {"!=": "==", ">=": "<", "<=": ">"} From 4290f7964069cbebf57022b3eb48bd8b0174078d Mon Sep 17 00:00:00 2001 From: Daniel Vaz Gaspar Date: Fri, 15 Nov 2019 13:44:07 +0000 Subject: [PATCH 2/4] [docs] Improve tests for an Apache release candidate (#8570) * [docs] Improve tests for an Apache release candidate * [docs] Fix phrase --- RELEASING/Dockerfile.from_tarball | 4 +--- RELEASING/README.md | 31 +++++++++++++------------- RELEASING/test_run_tarball.sh | 36 +++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 19 deletions(-) create mode 100755 RELEASING/test_run_tarball.sh diff --git a/RELEASING/Dockerfile.from_tarball b/RELEASING/Dockerfile.from_tarball index f42cee3922760..c7a9c1ca7b302 100644 --- a/RELEASING/Dockerfile.from_tarball +++ b/RELEASING/Dockerfile.from_tarball @@ -56,9 +56,7 @@ RUN cd superset/assets \ WORKDIR /home/superset/apache-superset-incubating-$VERSION RUN pip install --upgrade setuptools pip \ - && pip install -r requirements.txt -r requirements-dev.txt \ - && pip install -e . \ - && rm -rf /root/.cache/pip + && pip install --no-cache-dir . RUN flask fab babel-compile --target superset/translations diff --git a/RELEASING/README.md b/RELEASING/README.md index a3248b9255d2a..ed8743143b6bf 100644 --- a/RELEASING/README.md +++ b/RELEASING/README.md @@ -57,16 +57,18 @@ need to be done at every release. ## Crafting a source release When crafting a new minor or major release we create -a branch named with the release MAJOR.MINOR version. +a branch named with the release MAJOR.MINOR version (on this example 0.34). This new branch will hold all PATCH and release candidates that belong to the MAJOR.MINOR version. The MAJOR.MINOR branch is normally a "cut" from a specific point in time from the master branch. Then (if needed) apply all cherries that will make the PATCH -Finally bump the version number on `superset/static/assets/package.json` :: +Finally bump the version number on `superset/static/assets/package.json`: - "version": "0.35.0" +```json + "version": "0.34.1" +``` Commit the change with the version number, then git tag the version with the release candidate and push @@ -157,6 +159,16 @@ Now let's ship this RC into svn's dev folder svn commit -m "Release ${SUPERSET_VERSION_RC}" ``` +### Build and test from source tarball + +To make a working build given a tarball +```bash +# Build and run a release candidate tarball +./test_run_tarball.sh +# you should be able to access localhost:5001 on your browser +# login using admin/admin +``` + ### Voting Now you're ready to start the [VOTE] thread. Here's an example of a previous release vote thread: @@ -218,19 +230,6 @@ deprecations and upgrading-related topics, make sure to move the content now under the `Next Version` section under a new section for the new release. -## Build from source tarball - -To make a working build given a tarball -```bash -# Building a docker from a tarball -docker build -t apache-superset:${SUPERSET_VERSION_RC} -f Dockerfile.from_tarball . --build-arg VERSION=${SUPERSET_VERSION_RC} - -# testing the resulting docker -docker run -p 5001:8088 apache-superset:${SUPERSET_VERSION_RC} -# you should be able to access localhost:5001 on your browser -# login using admin/admin -``` - # Refresh documentation website Every once in a while we want to compile the documentation and publish it. diff --git a/RELEASING/test_run_tarball.sh b/RELEASING/test_run_tarball.sh new file mode 100755 index 0000000000000..6521ac09e0ed7 --- /dev/null +++ b/RELEASING/test_run_tarball.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +set -e + +if [ -z "${SUPERSET_VERSION_RC}" ]; then + echo "SUPERSET_VERSION_RC is required to run this container" + exit 1 +fi + +# Building a docker from a tarball +docker build --no-cache -t apache-superset:${SUPERSET_VERSION_RC} -f Dockerfile.from_tarball . --build-arg VERSION=${SUPERSET_VERSION_RC} + +echo "---------------------------------------------------" +echo "After docker build and run, you should be able to access localhost:5001 on your browser" +echo "login using admin/admin" +echo "---------------------------------------------------" +if ! docker run -p 5001:8088 apache-superset:${SUPERSET_VERSION_RC}; then + echo "---------------------------------------------------" + echo "[ERROR] Seems like this apache-superset:${SUPERSET_VERSION_RC} has a setup/startup problem!" + echo "---------------------------------------------------" +fi From fc12e53ff58e32756bd7fcf5f0013f424b2fc901 Mon Sep 17 00:00:00 2001 From: Rob DiCiuccio Date: Fri, 15 Nov 2019 17:08:23 +0000 Subject: [PATCH 3/4] Bump pyarrow to 0.15.1 due to CVE (#8583) --- requirements.txt | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index bcf4b8fcb41ec..2580eb9ffb3b3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -58,7 +58,7 @@ pathlib2==2.3.4 polyline==1.4.0 prison==0.1.2 # via flask-appbuilder py==1.8.0 # via retry -pyarrow==0.14.1 +pyarrow==0.15.1 pycparser==2.19 # via cffi pyjwt==1.7.1 # via flask-appbuilder, flask-jwt-extended pyrsistent==0.15.4 # via jsonschema diff --git a/setup.py b/setup.py index bf57731c17dce..f7ac4716f47ad 100644 --- a/setup.py +++ b/setup.py @@ -97,7 +97,7 @@ def get_git_sha(): "python-dateutil", "python-dotenv", "python-geohash", - "pyarrow>=0.14.1, <0.15.0", + "pyarrow>=0.15.1, <0.16.0", "pyyaml>=5.1", "retry>=0.9.2", "selenium>=3.141.0", From 9c82ff8b96637394e2534bfd93443f381c9932cc Mon Sep 17 00:00:00 2001 From: Beto Dealmeida Date: Fri, 15 Nov 2019 10:34:56 -0800 Subject: [PATCH 4/4] Fix async queries with SQLLAB_BACKEND_PERSISTENCE (#8586) --- superset/assets/src/SqlLab/components/SouthPane.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/superset/assets/src/SqlLab/components/SouthPane.jsx b/superset/assets/src/SqlLab/components/SouthPane.jsx index 92c9934dea5d7..3f747a8af9d8f 100644 --- a/superset/assets/src/SqlLab/components/SouthPane.jsx +++ b/superset/assets/src/SqlLab/components/SouthPane.jsx @@ -92,6 +92,7 @@ export class SouthPane extends React.PureComponent { if (latestQuery) { if ( isFeatureEnabled(FeatureFlag.SQLLAB_BACKEND_PERSISTENCE) && + latestQuery.state === 'success' && (!latestQuery.resultsKey && !latestQuery.results) ) { results = {t('No stored results found, you need to re-run your query')};