Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/master' into filter_inpu…
Browse files Browse the repository at this point in the history
…t_box

* remotes/origin/master: (340 commits)
  [New Viz] Partition Diagram (apache#3642)
  Add description for running specific test (apache#3665)
  Making the sort order for metrics pull from fd for time table viz (apache#3661)
  Make columns that return an exception on click unsortable. (apache#3417)
  Adding sort time table (apache#3651)
  added aihello as superset user. (apache#3647)
  Fix apache#3612 - reverse sign in difference calculation (apache#3646)
  Fixing some warnings during tests (apache#3648)
  [Translations] Restored lost French translations (apache#3645)
  [sql lab] fix impersonation + template issue (apache#3644)
  Pin moment.js library since 2.19.0 creates problem (apache#3641)
  [time_table] adding support for URLs / links (apache#3600)
  Set tooltip to show extent of sparkData (apache#3626)
  add explicit message display for 'Fetching Annotation Layer' error (apache#3631)
  [bugfix] Template rendering failed: '_AppCtxGlobals' object has no attribute 'user' (apache#3637)
  fix long title text wrapping in editable-title component (apache#3638)
  [minor] proper tooltip on ControlHeader's instant re-render trigger (apache#3625)
  add annotation option and a linear color map for heatmap viz. (apache#3634)
  [bugfix] empty From date filter NoneType error (apache#3633)
  remove unused imports (apache#3621)
  ...
  • Loading branch information
eddy-geek committed Oct 15, 2017
2 parents 4505ed8 + bad6938 commit 609d1e2
Show file tree
Hide file tree
Showing 314 changed files with 39,112 additions and 7,066 deletions.
5 changes: 5 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ engines:
enabled: false
eslint:
enabled: true
checks:
import/extensions:
enabled: false
import/no-extraneous-dependencies:
enabled: false
config:
config: superset/assets/.eslintrc
pep8:
Expand Down
2 changes: 1 addition & 1 deletion .coveralls.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
repo_token: eESbYiv4An6KEvjpmguDs4L7YkubXbqn1
repo_token: 4P9MpvLrZfJKzHdGZsdV3MzO43OZJgYFn
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ app.db
.idea
*.sqllite
.vscode
.python-version

# Node.js, webpack artifacts
*.entry.js
Expand All @@ -33,3 +34,6 @@ node_modules
npm-debug.log
yarn.lock
superset/assets/version_info.json

# IntelliJ
*.iml
12 changes: 4 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@

language: python
services:
- redis-server
addons:
code_climate:
repo_token: 5f3a06c425eef7be4b43627d7d07a3e46c45bdc07155217825ff7c49cb6a470c
apt:
sources:
- deadsnakes
packages:
- python3.5
cache:
directories:
- $HOME/.wheelhouse/
env:
global:
- TRAVIS_CACHE=$HOME/.travis_cache/
- TRAVIS_NODE_VERSION="6.10.2"
- TRAVIS_NODE_VERSION="7.10.0"
matrix:
- TOX_ENV=javascript
- TOX_ENV=pylint
Expand All @@ -23,7 +19,7 @@ env:
- TOX_ENV=py27-mysql
- TOX_ENV=py27-sqlite
before_install:
- npm install -g npm@'>=4.5.0'
- npm install -g npm@'>=5.4.1'
before_script:
- mysql -e 'drop database if exists superset; create database superset DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci' -u root
- mysql -u root -e "CREATE USER 'mysqluser'@'localhost' IDENTIFIED BY 'mysqluserpassword';"
Expand Down
397 changes: 397 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

126 changes: 96 additions & 30 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ If you are reporting a bug, please include:
troubleshooting.
- Detailed steps to reproduce the bug.

When you post python stack traces please quote them using
[markdown blocks](https://help.github.com/articles/creating-and-highlighting-code-blocks/).

### Fix Bugs

Look through the GitHub issues for bugs. Anything tagged with "bug" is
Expand All @@ -26,7 +29,7 @@ open to whoever wants to implement it.
### Implement Features

Look through the GitHub issues for features. Anything tagged with
"feature" is open to whoever wants to implement it.
"feature" or "starter_task" is open to whoever wants to implement it.

### Documentation

Expand All @@ -47,9 +50,27 @@ If you are proposing a feature:
- Remember that this is a volunteer-driven project, and that
contributions are welcome :)

## Pull Request Guidelines

Before you submit a pull request from your forked repo, check that it
meets these guidelines:

1. The pull request should include tests, either as doctests,
unit tests, or both.
2. If the pull request adds functionality, the docs should be updated
as part of the same PR. Doc string are often sufficient, make
sure to follow the sphinx compatible standards.
3. The pull request should work for Python 2.7, and ideally python 3.4+.
``from __future__ import`` will be required in every `.py` file soon.
4. Code will be reviewed by re running the unittests, flake8 and syntax
should be as rigorous as the core Python project.
5. Please rebase and resolve all conflicts before submitting.
6. If you are asked to update your pull request with some changes there's
no need to create a new one. Push your changes to the same branch.

## Documentation

The latest documentation and tutorial are available [here](http://airbnb.io/superset).
The latest documentation and tutorial are available [here](https://superset.incubator.apache.org/).

Contributing to the official documentation is relatively easy, once you've setup
your environment and done an edit end-to-end. The docs can be found in the
Expand All @@ -64,7 +85,7 @@ Before you start changing the docs, you'll want to
[fork the Superset project on Github](https://help.github.com/articles/fork-a-repo/).
Once that new repository has been created, clone it on your local machine:

git clone git@github.com:your_username/superset.git
git clone git@github.com:your_username/incubator-superset.git

At this point, you may also want to create a
[Python virtual environment](http://docs.python-guide.org/en/latest/dev/virtualenvs/)
Expand All @@ -76,7 +97,7 @@ to manage the Python packages you're about to install:
Finally, to make changes to the rst files and build the docs using Sphinx,
you'll need to install a handful of dependencies from the repo you cloned:

cd superset
cd incubator-superset
pip install -r dev-reqs-for-docs.txt

To get the feel for how to edit and build the docs, let's edit a file, build
Expand Down Expand Up @@ -123,7 +144,7 @@ referenced in the rst, e.g.

aren't actually included in that directory. _Instead_, you'll want to add and commit
images (and any other static assets) to the _superset/assets/images_ directory.
When the docs are being pushed to [airbnb.io](http://airbnb.io/superset/), images
When the docs are being pushed to [Apache Superset (incubating)](https://superset.incubator.apache.org/), images
will be moved from there to the _\_static/img_ directory, just like they're referenced
in the docs.

Expand All @@ -140,19 +161,19 @@ instead.

## Setting up a Python development environment

Check the [OS dependencies](http://airbnb.io/superset/installation.html#os-dependencies) before follows these steps.
Check the [OS dependencies](https://superset.incubator.apache.org/installation.html#os-dependencies) before follows these steps.

# fork the repo on GitHub and then clone it
# alternatively you may want to clone the main repo but that won't work
# so well if you are planning on sending PRs
# git clone git@github.com:airbnb/superset.git
# git clone git@github.com:apache/incubator-superset.git

# [optional] setup a virtual env and activate it
virtualenv env
source env/bin/activate

# install for development
python setup.py develop
pip install -e .

# Create an admin user
fabmanager create-admin --app superset
Expand Down Expand Up @@ -202,8 +223,13 @@ To install third party libraries defined in `package.json`, run the
following within the `superset/assets/` directory which will install them in a
new `node_modules/` folder within `assets/`.

```
npm install
```bash
# from the root of the repository, move to where our JS package.json lives
cd superset/assets/
# install yarn, a replacement for `npm install` that is faster and more deterministic
npm install -g yarn
# run yarn to fetch all the dependencies
yarn
```

To parse and generate bundled files for superset, run either of the
Expand Down Expand Up @@ -231,9 +257,20 @@ npm run dev

## Testing

Python tests can be run with:
Before running python unit tests, please setup local testing environment:
```
pip install -r dev-reqs.txt
```

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 @@ -292,23 +329,6 @@ The `variables.less` and `bootswatch.less` files that ship with Superset are der
[Bootswatch](https://bootswatch.com) and thus extend Bootstrap. Modify variables in these files directly, or
swap them out entirely with the equivalent files from other Bootswatch (themes)[https://github.com/thomaspark/bootswatch.git]

## Pull Request Guidelines

Before you submit a pull request from your forked repo, check that it
meets these guidelines:

1. The pull request should include tests, either as doctests,
unit tests, or both.
2. If the pull request adds functionality, the docs should be updated
as part of the same PR. Doc string are often sufficient, make
sure to follow the sphinx compatible standards.
3. The pull request should work for Python 2.6, 2.7, and ideally python 3.3.
``from __future__ import`` will be required in every `.py` file soon.
4. Code will be reviewed by re running the unittests, flake8 and syntax
should be as rigorous as the core Python project.
5. Please rebase and resolve all conflicts before submitting.


## Translations

We use [Babel](http://babel.pocoo.org/en/latest/) to translate Superset. The
Expand All @@ -317,6 +337,8 @@ key is to instrument the strings that need translation using
a module, all you have to do is to `_("Wrap your strings")` using the
underscore `_` "function".

We use `import {t, tn, TCT} from locales;` in js, JSX file, locales is in `./superset/assets/javascripts/` directory.

To enable changing language in your environment, you can simply add the
`LANGUAGES` parameter to your `superset_config.py`. Having more than one
options here will add a language selection dropdown on the right side of the
Expand All @@ -333,17 +355,25 @@ new language dictionary, run the following command:

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

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

fabmanager babel-extract --target superset/translations/
fabmanager babel-extract --target superset/translations/ -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
to take effect, they need to be compiled using this command:

fabmanager babel-compile --target superset/translations/

In the case of JS translation, we need to convert the PO file into a JSON file, and we need the global download of the npm package po2json.
We need to be compiled using this command:

npm install po2json -g

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

## Adding new datasources

Expand All @@ -360,3 +390,39 @@ to take effect, they need to be compiled using this command:
`ADDITIONAL_MODULE_DS_MAP = {'superset.my_models': ['MyDatasource', 'MyOtherDatasource']}`

This means it'll register MyDatasource and MyOtherDatasource in superset.my_models module in the source registry.

## Creating a new visualization type

Here's an example as a Github PR with comments that describe what the
different sections of the code do:
https://github.com/apache/incubator-superset/pull/3013

## Refresh documentation website

Every once in a while we want to compile the documentation and publish it.
Here's how to do it.

.. code::

# install doc dependencies
pip install -r dev-reqs-for-docs.txt

# build the docs
python setup.py build_sphinx

# copy html files to temp folder
cp -r docs/_build/html/ /tmp/tmp_superset_docs/

# clone the docs repo
cd ~/
git clone https://git-wip-us.apache.org/repos/asf/incubator-superset-site.git

# copy
cp -r /tmp/tmp_superset_docs/ ~/incubator-superset-site.git/

# commit and push to `asf-site` branch
cd ~/incubator-superset-site.git/
git checkout asf-site
git add .
git commit -a -m "New doc version"
git push origin master
25 changes: 0 additions & 25 deletions INTHEWILD.md

This file was deleted.

3 changes: 1 addition & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
recursive-include superset/templates *
recursive-include superset/static *
recursive-exclude superset/static/assets/node_modules *
recursive-include superset/static/assets/node_modules/font-awesome *
recursive-exclude superset/static/docs *
recursive-exclude superset/static/spec *
recursive-exclude superset/static/assets/node_modules *
recursive-exclude tests *
recursive-include superset/data *
recursive-include superset/migrations *
Loading

0 comments on commit 609d1e2

Please sign in to comment.