Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge apache 72d1011 #51

Closed
wants to merge 34 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
5ebc5a6
[celery] Bump celery to 4.3.0 (#7848)
dpgaspar Jul 12, 2019
87f50ba
Make SHOW_STACKTRACE config apply across the board (#7845)
mistercrunch Jul 12, 2019
7946165
fix: multi deck.gl bug fixes (#7854)
thunter009 Jul 12, 2019
df05181
Adds the ability to replace/extend caching backend (#7856)
robdiciuccio Jul 12, 2019
fc8268b
Update tox.ini (#7867)
john-bodley Jul 12, 2019
1197d25
[wip] fix: multi deck.gl bug fixes (pt 2) (#7866)
thunter009 Jul 13, 2019
f53acd8
Bump pandas to 0.24 (#7852)
villebro Jul 14, 2019
eed99b1
[cypress] Disable chromeWebSecurity globally (#7853)
Jul 15, 2019
78d46fa
[docs] Advise about celery 4.3.0 requirement on redis (#7872)
dpgaspar Jul 15, 2019
b99a3a1
bug fix for all_database_access() call (#7875)
rahul-rahul-sp Jul 16, 2019
a27b8b7
fix: add check to re-render only if underlying layers change (#7878)
thunter009 Jul 16, 2019
9b8bfbb
DruidEngineSpec: set allows_subquery to True (#7863)
michalmisiewicz Jul 16, 2019
a36c136
Fix docker configurations and docker installation guide. (#7827)
ali-bahjati Jul 16, 2019
86fdceb
Avoid removing custom sql adhoc metric when columns change (#7877)
michellethomas Jul 16, 2019
d65b039
Improve examples & related tests (#7773)
mistercrunch Jul 17, 2019
32f33f2
[sql lab] improve TableElement controls (#7881)
mistercrunch Jul 18, 2019
a993da6
Corrected ISO codes on India Country Map (#7882)
TheLastSultan Jul 18, 2019
b512502
Remove unnecessary fields from dashboard exported json (#7879)
smacker Jul 18, 2019
174a48a
Sort dashboards exported json (#7883)
smacker Jul 18, 2019
2b3e7fe
[sqla] Adding check for invalid filter columns (#7888)
john-bodley Jul 18, 2019
fce1166
Fix missing `gevent` extra dependency in Docker setup (#7744)
bmfs Jul 18, 2019
ccedbea
[fix] Adding space after -- for SQL comments (#7897)
john-bodley Jul 18, 2019
f570b45
[test] Fix test data remove slice_name (#7898)
Jul 19, 2019
4568b2a
Add cache_key_wrapper to Jinja template processor (#7816)
villebro Jul 20, 2019
ee3430c
[Bugfix] Response header and response mismatch on explore result from…
Jul 22, 2019
7a1dcaa
[SQL Lab] Fix TableSelector perf for large option sets (#7868)
Jul 22, 2019
92eed8a
Bump nvd3 charts for responsive y axis fix (#7915)
Jul 22, 2019
9dd6a38
[migration] add unique constraint on dashboard_slices table (#7880)
Jul 22, 2019
b65ab51
[api] [database] New, migrate to new FAB API side by side (#7665)
dpgaspar Jul 23, 2019
648f9fa
Set owner to dashboards and charts on import (#7894)
smacker Jul 23, 2019
2221445
Fix incorrect datasource_name in dashboard export (#7892)
smacker Jul 23, 2019
07a76f8
[Bugfix] Remove prequery properties from query_obj (#7896)
villebro Jul 23, 2019
72d1011
[sqllab] Fix limit parsing bug when using limit-offset comma notation…
villebro Jul 24, 2019
bd36c68
Merge commit '72d1011023cc441d85afe2d198bac25b21cff8cd' into merge_ap…
khtruong Jul 26, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ include NOTICE
include LICENSE.txt
graft licenses/
include README.md
recursive-include superset/data *
recursive-include superset/examples *
recursive-include superset/migrations *
recursive-include superset/static *
recursive-exclude superset/static/assets/docs *
Expand Down
4 changes: 4 additions & 0 deletions UPDATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ assists people when migrating to a new version.

## Next Version

* [7848](https://github.com/apache/incubator-superset/pull/7848): If you are
running redis with celery, celery bump to 4.3.0 requires redis-py upgrade to
3.2.0 or later.

* [7667](https://github.com/apache/incubator-superset/pull/7667): a change to
make all Unix timestamp (which by definition are in UTC) comparisons refer
to a timestamp in UTC as opposed to local time.
Expand Down
5 changes: 4 additions & 1 deletion contrib/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,14 @@ WORKDIR /home/superset

COPY requirements.txt .
COPY requirements-dev.txt .
COPY contrib/docker/requirements-extra.txt .

RUN pip install --upgrade setuptools pip \
&& pip install -r requirements.txt -r requirements-dev.txt \
&& pip install -r requirements.txt -r requirements-dev.txt -r requirements-extra.txt \
&& rm -rf /root/.cache/pip

RUN pip install gevent

COPY --chown=superset:superset superset superset

ENV PATH=/home/superset/superset/bin:$PATH \
Expand Down
2 changes: 1 addition & 1 deletion contrib/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Docker is an easy way to get stated with Superset.
To initialize the database with a user and example charts, dashboards and datasets run:

```bash
SUPERSET_LOAD_EXAMPLES=yes docker-compose run --rm superset ./docker-init.sh
docker-compose run -e SUPERSET_LOAD_EXAMPLES=yes --rm superset ./docker-init.sh
```

This may take a minute.
Expand Down
5 changes: 3 additions & 2 deletions contrib/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:
image: redis:3.2
restart: unless-stopped
ports:
- 6379:6379
- "127.0.0.1:6379:6379"
volumes:
- redis:/data

Expand All @@ -32,7 +32,7 @@ services:
POSTGRES_PASSWORD: superset
POSTGRES_USER: superset
ports:
- 5432:5432
- "127.0.0.1:5432:5432"
volumes:
- postgres:/var/lib/postgresql/data

Expand All @@ -52,6 +52,7 @@ services:
# If using production, comment development volume below
#SUPERSET_ENV: production
SUPERSET_ENV: development
user: root:root
ports:
- 8088:8088
depends_on:
Expand Down
17 changes: 17 additions & 0 deletions contrib/docker/requirements-extra.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#
# 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.
#
gevent==1.4.0
18 changes: 18 additions & 0 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,24 @@ into your global default defined in ``CACHE_CONFIG``.
'CACHE_REDIS_URL': 'redis://localhost:6379/0',
}

It is also possible to pass a custom cache initialization function in the
config to handle additional caching use cases. The function must return an
object that is compatible with the `Flask-Cache <https://pythonhosted.org/Flask-Cache/>`_ API.

.. code-block:: python

from custom_caching import CustomCache

def init_cache(app):
"""Takes an app instance and returns a custom cache backend"""
config = {
'CACHE_DEFAULT_TIMEOUT': 60 * 60 * 24, # 1 day default (in secs)
'CACHE_KEY_PREFIX': 'superset_results',
}
return CustomCache(app, config)

CACHE_CONFIG = init_cache

Superset has a Celery task that will periodically warm up the cache based on
different strategies. To use it, add the following to the `CELERYBEAT_SCHEDULE`
section in `config.py`:
Expand Down
2 changes: 2 additions & 0 deletions docs/sqllab.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ Superset's Jinja context:

.. autofunction:: superset.jinja_context.filter_values

.. autofunction:: superset.jinja_context.CacheKeyWrapper.cache_key_wrapper

.. autoclass:: superset.jinja_context.PrestoTemplateProcessor
:members:

Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ pycodestyle==2.5.0
pyhive==0.6.1
pylint==1.9.2
python-dotenv==0.10.1
redis==2.10.6
redis==3.2.1
statsd==3.3.0
tox==3.11.1
12 changes: 6 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
# pip-compile --output-file=requirements.txt setup.py
#
alembic==1.0.0 # via flask-migrate
amqp==2.3.2 # via kombu
amqp==2.5.0 # via kombu
apispec[yaml]==1.2.0 # via flask-appbuilder
asn1crypto==0.24.0 # via cryptography
attrs==19.1.0 # via jsonschema
babel==2.6.0 # via flask-babel
billiard==3.5.0.4 # via celery
billiard==3.6.0.0 # via celery
bleach==3.0.2
celery==4.2.0
celery==4.3.0
certifi==2018.8.24 # via requests
cffi==1.11.5 # via cryptography
chardet==3.0.4 # via requests
Expand Down Expand Up @@ -44,15 +44,15 @@ isodate==0.6.0
itsdangerous==0.24 # via flask
jinja2==2.10.1 # via flask, flask-babel
jsonschema==3.0.1 # via flask-appbuilder
kombu==4.2.1 # via celery
kombu==4.6.3 # via celery
mako==1.0.7 # via alembic
markdown==3.0
markupsafe==1.0 # via jinja2, mako
marshmallow-enum==1.4.1 # via flask-appbuilder
marshmallow-sqlalchemy==0.16.2 # via flask-appbuilder
marshmallow==2.19.2 # via flask-appbuilder, marshmallow-enum, marshmallow-sqlalchemy
numpy==1.15.2 # via pandas
pandas==0.23.4
pandas==0.24.2
parsedatetime==2.0.0
pathlib2==2.3.0
polyline==1.3.2
Expand All @@ -78,7 +78,7 @@ sqlalchemy-utils==0.33.11
sqlalchemy==1.3.5
sqlparse==0.2.4
urllib3==1.24.3 # via requests, selenium
vine==1.1.4 # via amqp
vine==1.3.0 # via amqp, celery
webencodings==0.5.1 # via bleach
werkzeug==0.14.1 # via flask, flask-jwt-extended
wtforms-json==0.3.3
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def get_git_sha():
scripts=["superset/bin/superset"],
install_requires=[
"bleach>=3.0.2, <4.0.0",
"celery>=4.2.0, <5.0.0",
"celery>=4.3.0, <5.0.0",
"click>=6.0, <7.0.0", # `click`>=7 forces "-" instead of "_"
"colorama",
"contextlib2",
Expand All @@ -85,7 +85,7 @@ def get_git_sha():
"idna",
"isodate",
"markdown>=3.0",
"pandas>=0.18.0, <0.24.0", # `pandas`>=0.24.0 changes datetimelike API
"pandas>=0.24.2, <0.25.0",
"parsedatetime",
"pathlib2",
"polyline",
Expand Down
7 changes: 4 additions & 3 deletions superset/assets/cypress.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"baseUrl": "http://localhost:8081",
"videoUploadOnPasses": false,
"video": false,
"chromeWebSecurity": false,
"defaultCommandTimeout": 10000,
"ignoreTestFiles": ["**/!(*.test.js)"],
"projectId": "fbf96q",
"defaultCommandTimeout": 10000,
"video": false,
"videoUploadOnPasses": false,
"viewportWidth": 1280,
"viewportHeight": 800
}
2 changes: 0 additions & 2 deletions superset/assets/cypress/integration/dashboard/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import readResponseBlob from '../../utils/readResponseBlob';
import { WORLD_HEALTH_DASHBOARD } from './dashboard.helper';

export default () => describe('save', () => {
Cypress.config('chromeWebSecurity', false);

let dashboardId;
let boxplotChartId;

Expand Down
6 changes: 3 additions & 3 deletions superset/assets/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion superset/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"@superset-ui/legacy-plugin-chart-word-cloud": "^0.10.11",
"@superset-ui/legacy-plugin-chart-world-map": "^0.10.11",
"@superset-ui/legacy-preset-chart-big-number": "^0.10.11",
"@superset-ui/legacy-preset-chart-nvd3": "^0.10.35",
"@superset-ui/legacy-preset-chart-nvd3": "^0.10.36",
"@superset-ui/number-format": "^0.11.3",
"@superset-ui/time-format": "^0.11.3",
"@superset-ui/translation": "^0.11.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ describe('TableSelector', () => {
it('should clear table options', () => {
inst.fetchTables(true);
expect(wrapper.state().tableOptions).toEqual([]);
expect(wrapper.state().filterOptions).toBeNull();
});

it('should fetch table options', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,5 +333,40 @@ describe('MetricsControl', () => {
'SUM(',
)).toBe(true);
});

it('Removes metrics if savedMetrics changes', () => {
const { props, wrapper, onChange } = setup({
value: [
{
expressionType: EXPRESSION_TYPES.SIMPLE,
column: { type: 'double', column_name: 'value' },
aggregate: AGGREGATES.SUM,
label: 'SUM(value)',
optionName: 'blahblahblah',
},
],
});
expect(wrapper.state('value')).toHaveLength(1);

wrapper.setProps({ ...props, columns: [] });
expect(onChange.lastCall.args).toEqual([[]]);
});

it('Does not remove custom sql metric if savedMetrics changes', () => {
const { props, wrapper, onChange } = setup({
value: [
{
expressionType: EXPRESSION_TYPES.SQL,
sqlExpression: 'COUNT(*)',
label: 'old label',
hasCustomLabel: true,
},
],
});
expect(wrapper.state('value')).toHaveLength(1);

wrapper.setProps({ ...props, columns: [] });
expect(onChange.calledOnce).toEqual(false);
});
});
});
3 changes: 1 addition & 2 deletions superset/assets/src/SqlLab/actions/sqlLab.js
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,7 @@ export function createDatasource(vizOptions) {
endpoint: '/superset/sqllab_viz/',
postPayload: { data: vizOptions },
})
.then(({ json }) => {
const data = JSON.parse(json);
.then(({ data }) => {
dispatch(createDatasourceSuccess(data));

return Promise.resolve(data);
Expand Down
2 changes: 1 addition & 1 deletion superset/assets/src/SqlLab/components/QuerySearch.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ class QuerySearch extends React.PureComponent {
<div className="col-sm-2">
<AsyncSelect
onChange={this.onChange}
dataEndpoint="/databaseasync/api/read?_flt_0_expose_in_sqllab=1"
dataEndpoint="/api/v1/database/?q=(filters:!((col:expose_in_sqllab,opr:eq,value:!t)))"
value={this.state.databaseId}
mutator={this.dbMutator}
placeholder={t('Filter by database')}
Expand Down
Loading