Skip to content

Commit

Permalink
Merge branch 'master' into mogball/feature/altered_explore_slice
Browse files Browse the repository at this point in the history
  • Loading branch information
Mogball committed Nov 10, 2017
2 parents 2e83588 + 6c52f2f commit 5301b10
Show file tree
Hide file tree
Showing 165 changed files with 12,677 additions and 1,901 deletions.
2 changes: 0 additions & 2 deletions .pycodestyle

This file was deleted.

2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ env:
- TRAVIS_CACHE=$HOME/.travis_cache/
- TRAVIS_NODE_VERSION="7.10.0"
matrix:
- TOX_ENV=flake8
- TOX_ENV=javascript
- TOX_ENV=pylint
- TOX_ENV=py34-postgres
Expand All @@ -30,5 +31,6 @@ before_script:
install:
- pip install --upgrade pip
- pip install tox tox-travis
- pip install --upgrade flake8
- rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION
script: tox -e $TOX_ENV
24 changes: 20 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ If you are proposing a feature:
implement.
- Remember that this is a volunteer-driven project, and that
contributions are welcome :)

### Questions

There is a dedicated [tag](https://stackoverflow.com/questions/tagged/apache-superset) on [stackoverflow](https://stackoverflow.com/). Please use it when asking questions.

## Pull Request Guidelines

Expand Down Expand Up @@ -262,9 +266,15 @@ Before running python unit tests, please setup local testing environment:
pip install -r dev-reqs.txt
```

Python tests can be run with:
All python tests can be run with:

./run_tests.sh

Alternatively, you can run a specific test with:

./run_specific_test.sh tests.core_tests:CoreTests.test_function_name

Note that before running specific tests, you have to both setup the local testing environment and run all tests.

We use [Mocha](https://mochajs.org/), [Chai](http://chaijs.com/) and [Enzyme](http://airbnb.io/enzyme/) to test Javascript. Tests can be run with:

Expand Down Expand Up @@ -345,14 +355,15 @@ navigation bar.
}

As per the [Flask AppBuilder documentation] about translation, to create a
new language dictionary, run the following command:
new language dictionary, run the following command (where `es` is replaced with
the language code for your target language):

pybabel init -i ./babel/messages.pot -d superset/translations -l es
pybabel init -i superset/translations/messages.pot -d superset/translations -l es

Then it's a matter of running the statement below to gather all strings that
need translation

fabmanager babel-extract --target superset/translations/ -k _ -k __ -k t -k tn -k tct
fabmanager babel-extract --target superset/translations/ --output superset/translations/messages.pot --config superset/translations/babel.cfg -k _ -k __ -k t -k tn -k tct

You can then translate the strings gathered in files located under
`superset/translation`, where there's one per language. For the translations
Expand All @@ -369,6 +380,11 @@ Execute this command to convert the en PO file into a json file:

po2json -d superset -f jed1.x superset/translations/en/LC_MESSAGES/messages.po superset/translations/en/LC_MESSAGES/messages.json

If you get errors running `po2json`, you might be running the ubuntu package with the same
name rather than the nodejs package (they have a different format for the arguments). You
need to be running the nodejs version, and so if there is a conflict you may need to point
directly at `/usr/local/bin/po2json` rather than just `po2json`.

## Adding new datasources

1. Create Models and Views for the datasource, add them under superset folder, like a new my_models.py
Expand Down
7 changes: 4 additions & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
recursive-include superset/templates *
recursive-include superset/data *
recursive-include superset/migrations *
recursive-include superset/static *
recursive-exclude superset/static/docs *
recursive-exclude superset/static/spec *
recursive-exclude superset/static/assets/node_modules *
recursive-include superset/templates *
recursive-include superset/translations *
recursive-exclude tests *
recursive-include superset/data *
recursive-include superset/migrations *
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ Resources
* [Gitter (live chat) Channel](https://gitter.im/airbnb/superset)
* [Docker image](https://hub.docker.com/r/amancevice/superset/) (community contributed)
* [Slides from Strata (March 2016)](https://drive.google.com/open?id=0B5PVE0gzO81oOVJkdF9aNkJMSmM)
* [Stackoverflow tag](https://stackoverflow.com/questions/tagged/apache-superset)


Contributing
Expand Down Expand Up @@ -181,6 +182,7 @@ the world know they are using Superset. Join our growing community!
- [Faasos](http://faasos.com/)
- [GfK Data Lab](http://datalab.gfk.com)
- [Konfío](http://konfio.mx)
- [Lyft](https://www.lyft.com/)
- [Maieutical Labs](https://cloudschooling.it)
- [Pronto Tools](http://www.prontotools.io)
- [Qunar](https://www.qunar.com/)
Expand All @@ -189,7 +191,9 @@ the world know they are using Superset. Join our growing community!
- [Tails.com](https://tails.com)
- [Tobii](http://www.tobii.com/)
- [Tooploox](https://www.tooploox.com/)
- [Twitter](https://twitter.com/)
- [Udemy](https://www.udemy.com/)
- [VIPKID](https://www.vipkid.com.cn/)
- [Yahoo!](https://yahoo.com/)
- [Zalando](https://www.zalando.com)

1 change: 1 addition & 0 deletions docs/_build/html/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Folder containing the sphinx-generated documentation
12 changes: 10 additions & 2 deletions docs/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ You can override this path using the ``SUPERSET_HOME`` environment variable.

Another work around is to change where superset stores the sqlite database by adding ``SQLALCHEMY_DATABASE_URI = 'sqlite:////new/location/superset.db'`` in superset_config.py (create the file if needed), then adding the directory where superset_config.py lives to PYTHONPATH environment variable (e.g. ``export PYTHONPATH=/opt/logs/sandbox/airbnb/``).

How do I add new columns to an existing table
---------------------------------------------
What if the table schema changed?
---------------------------------

Table schemas evolve, and Superset needs to reflect that. It's pretty common
in the life cycle of a dashboard to want to add a new dimension or metric.
Expand Down Expand Up @@ -213,3 +213,11 @@ How can I set a default filter on my dashboard?

Easy. Simply apply the filter and save the dashboard while the filter
is active.

How do I get Superset to refresh the schema of my table?
--------------------------------------------------------

When adding columns to a table, you can have Superset detect and merge the
new columns in by using the "Refresh Metadata" action in the
``Source -> Tables`` page. Simply check the box next to the tables
you want the schema refreshed, and click ``Actions -> Refresh Metadata``.
4 changes: 2 additions & 2 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ that the required dependencies are installed: ::
**OSX**, system python is not recommended. brew's python also ships with pip ::

brew install pkg-config libffi openssl python
env LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" pip install cryptography==1.7.2
env LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" pip install cryptography==1.9

**Windows** isn't officially supported at this point, but if you want to
attempt it, download `get-pip.py <https://bootstrap.pypa.io/get-pip.py>`_, and run ``python get-pip.py`` which may need admin access. Then run the following: ::
Expand Down Expand Up @@ -163,7 +163,7 @@ Refer to the
for more information.

Note that *gunicorn* does not
work on Windows so the `superser runserver` command is not expected to work
work on Windows so the `superset runserver` command is not expected to work
in that context. Also note that the development web
server (`superset runserver -d`) is not intended for production use.

Expand Down
6 changes: 6 additions & 0 deletions docs/visualization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ List of Countries
+---------+--------------------+
| CN-33 | Zhejiang |
+---------+--------------------+
| CN-71 | Taiwan |
+---------+--------------------+
| CN-91 | Hong Kong |
+---------+--------------------+
| CN-92 | Macao |
+---------+--------------------+

* Egypt

Expand Down
3 changes: 2 additions & 1 deletion scripts/permissions_cleanup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from superset import sm
from collections import defaultdict

from superset import sm


def cleanup_permissions():
# 1. Clean up duplicates.
Expand Down
3 changes: 0 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,3 @@ detailed-errors=1
with-coverage=1
nocapture=1
cover-package=superset

[pycodestyle]
max-line-length=90
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import json
import os
import subprocess
import json
from setuptools import setup, find_packages

from setuptools import find_packages, setup

BASE_DIR = os.path.abspath(os.path.dirname(__file__))
PACKAGE_DIR = os.path.join(BASE_DIR, 'superset', 'static', 'assets')
Expand All @@ -14,7 +15,7 @@ def get_git_sha():
try:
s = str(subprocess.check_output(['git', 'rev-parse', 'HEAD']))
return s.strip()
except:
except Exception:
return ""

GIT_SHA = get_git_sha()
Expand Down
5 changes: 2 additions & 3 deletions superset/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
from __future__ import print_function
from __future__ import unicode_literals

import json
import logging
from logging.handlers import TimedRotatingFileHandler

import json
import os

from flask import Flask, redirect
from flask_appbuilder import SQLA, AppBuilder, IndexView
from flask_appbuilder import AppBuilder, IndexView, SQLA
from flask_appbuilder.baseviews import expose
from flask_migrate import Migrate
from flask_wtf.csrf import CSRFProtect
Expand Down
2 changes: 1 addition & 1 deletion superset/assets/.babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets" : ["airbnb", "env", "react"],
"presets" : ["airbnb"],
}
File renamed without changes
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export default function RunQueryActionButton(props) {
const runBtnText = props.selectedText ? t('Run Selected Query') : t('Run Query');
const btnStyle = props.selectedText ? 'warning' : 'primary';
const shouldShowStopBtn = ['running', 'pending'].indexOf(props.queryState) > -1;
const asyncToolTip = t('Run query asynchronously');

const commonBtnProps = {
bsSize: 'small',
Expand All @@ -32,7 +31,7 @@ export default function RunQueryActionButton(props) {
{...commonBtnProps}
onClick={() => props.runQuery(false)}
key="run-btn"
tooltip={asyncToolTip}
tooltip={t('Run query synchronously')}
>
<i className="fa fa-refresh" /> {runBtnText}
</Button>
Expand All @@ -43,7 +42,7 @@ export default function RunQueryActionButton(props) {
{...commonBtnProps}
onClick={() => props.runQuery(true)}
key="run-async-btn"
tooltip={asyncToolTip}
tooltip={t('Run query asynchronously')}
>
<i className="fa fa-table" /> {runBtnText}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,12 @@ class VisualizeModal extends React.PureComponent {
}
visualize() {
this.props.actions.createDatasource(this.buildVizOptions(), this)
.done(() => {
.done((resp) => {
const columns = Object.keys(this.state.columns).map(k => this.state.columns[k]);
const data = JSON.parse(resp);
const mainGroupBy = columns.filter(d => d.is_dim)[0];
const formData = {
datasource: this.props.datasource,
datasource: `${data.table_id}__table`,
viz_type: this.state.chartType.value,
since: '100 years ago',
limit: '0',
Expand Down
Loading

0 comments on commit 5301b10

Please sign in to comment.