Commit Graph

162 Commits

Author SHA1 Message Date
Brian Wolfe 1e325d9645 [druid] Allow custom druid postaggregators (#3146)
* [druid] Allow custom druid postaggregators

Also, fix the postaggregation for approxHistogram quantiles so it adds
the dependent field and that can show up in the graphs/tables.

In general, postAggregators add significant power, we should probably
support including custom postAggregators. Plywood has standard
postAggregators here, and a customAggregator escape hatch that allows
you to define custom postAggregators.

This commit adds a similar capability for Superset and a additional
field/fields/fieldName breakdown of the typical naming for dependent
aggregations, which should make it significantly easier to develop
approxHistogram and custom postAggregation-required dashboards.

* [druid] Minor style cleanup in tests file.

* [druid] Apply code review suggestions

* break out CustomPostAggregator into separate class. This just cleans
  up the creation of the postaggregator a little bit.
* minor style issues.
* move the function around so the git diff is more readable
2017-07-28 11:45:59 -07:00
Maxime Beauchemin b888802e05 [sqllab] improve Hive support (#3187)
* [sqllab] improve Hive support

* Fix "Transport not open" bug
* Getting progress bar to show
* Bump pyhive to 0.4.0
* Getting [Track Job] button to show

* Fix testzz
2017-07-27 14:00:19 -07:00
Ke Zhu e834154030 Fixes #3134 by correct response content-type of /testconn (#3135) 2017-07-15 09:52:37 -07:00
Maxime Beauchemin 06fcaa3095 Stabilizing Celery / SQL Lab (#2981)
* upgrade celery to 4.0.2
* using Redis for unit tests (sqla broker not supported in Celery 4)
* Setting Celery's soft_time_limit based on `SQLLAB_ASYNC_TIME_LIMIT_SEC` config
* Better error handling in async tasks
* Better statsd logging in async tasks
* show [pending/running] query status in Results tab
* systematically using sqla NullPool on worker (async) to limit number
  of database connections
2017-06-20 13:55:03 -07:00
Grace Guo 8329ea2b9b Edit Dashboard title and Slice title in place (#2940)
* Edit Dashboard title and Slice title in place

Add EditableTitle component into Dashboard and Explore view to support edit title inline.
2017-06-14 12:52:12 -07:00
Alanna Scott e1751c065c add new slice test (#2939)
* sort explicitly on label

* add simple test for /slicemodelview/add endpoint

* make comments and method names more clear

* fix test name

* be more explicit, test status_code
2017-06-13 09:44:26 -07:00
timfeirg 17bd7512ff remove reference for CSRF_ENABLED, and use WTF_CSRF_ENABLED instead (#2946) 2017-06-12 13:17:59 -07:00
ShengyaoQian b0e2904c24 Updating permission when refreshing druid datasource (#2655)
* Updating permission when refreshing druid datasource

* Adding test

* Fix style

* Deletion view_menu after db, table, cluster, ds deletion

* Update table model

* Linting

* Override _delete instead of post_delete

* fix

* lint

* fix multi delete

* fix

* Refactoring

* Amending
2017-05-22 16:41:32 -07:00
YOU 46d7a925bb chore: remove unused methods with invalid models.Query usage (#2721)
* fix: models.Query is not defined

* chore: remove unused Query and methods
2017-05-06 21:23:17 -07:00
Maxime Beauchemin cb14640a82 Removing uneeded results_backends.py (#2717) 2017-05-04 23:41:10 -07:00
robert-digit 1df37e6e4d add option for pulling favourited dashboards by username (#2661)
* add option for pulling favourited dashboards by username

add tests

* fix too many lines pep8 error
2017-04-24 20:48:25 -07:00
Maxime Beauchemin 91fe02cdc8 Setting adjust_database_uri for HiveEngineSpec (#2636)
* Setting adjust_database_uri for HiveEngineSpec

* fix tests
2017-04-18 12:29:13 -07:00
Maxime Beauchemin 31283f1424 Fix metric formating in Dashboard view + some refactoring (#2598)
* Fix metric formating in Dashboard view + some refactoring

* Fixing build
2017-04-12 09:37:49 -07:00
Maxime Beauchemin ac84fc2b65 Fixing confusion when selecting schema across engines (#2572) 2017-04-10 15:36:58 -07:00
rumbin c581ea8661 Alternative PR for: Some bytes/str issues in py3 w/ zlib and json (#2558)
* sql_lab.py: compress via utils

* utils.py: added zlib_compress and zlib_compress_to_string

* core.py: converted to use zlib_decompress_to_string; renamed uncompress to decompress in utils.py

* utils_tests.py: added test for compress/decompress

* fixed broken utils test; removed redundant code and empty lines from utils.py

* utils.py: corrected docstrings, removed unnecessary 'else'

* removed yet another superfluous else
2017-04-06 09:42:43 -07:00
Maxime Beauchemin 122891c29b [sql lab] allow users to save their queries (#2528)
* Allow users to save their queries

Fixing tests .

* Adding placeholder for Query Description

* initJQueryCSRF -> initJQueryAjaxCSRF
2017-04-04 20:15:19 -07:00
Maxime Beauchemin 1f8e48b374 [sqllab] assign types for visualize flow (#2458)
* [sqllab] assign types for visualize flow

Somehow when using the visualize flow, the types were not
assigned at all, creating some bugs downstream. This PR attempts to get
the information required based on what pandas is knows and the types in
the data itself.

* Fixing tests

* Fixing tests

* Fixing more tests

* Fixing the last py3 tests
2017-03-24 09:23:51 -07:00
Maxime Beauchemin 1590b8c7e5 Speeding up polling by not checking access (#2466)
* Speeding up polling by not checking access

* Fix tests
2017-03-23 22:46:25 -07:00
Maxime Beauchemin 5e43d074c3 [explore ] templating can now reference query elements (#2388)
Second take on
https://github.com/mistercrunch/superset/pull/3
2017-03-14 13:23:20 -07:00
Bogdan 0779da6d24 Keep column order in .csv (#2377) 2017-03-10 14:49:11 -08:00
Maxime Beauchemin 2969cc9993 Refactoring Druid & SQLa into a proper "Connector" interface (#2362)
* Formalizing the Connector interface

* Checkpoint

* Fixing views

* Fixing tests

* Adding migrtion

* Tests

* Final

* Addressing comments
2017-03-10 09:11:51 -08:00
Bogdan 9114d86ecd Add hive to superset + monkey patch the pyhive (#2134)
* Initial hive implementation

* Fix select star query for hive.

* Exclude generated code.

* Address code coverage and linting.

* Exclude generated code from coveralls.

* Fix lint errors

* Move TCLIService to it's own repo.

* Address comments

* Implement special postgres case,
2017-03-06 16:20:55 -08:00
Sungju Jin d4b59b36a8 Fixed a bug when querying with schema path to Redshift/Postgresql (#1789) 2017-02-26 22:54:48 -08:00
Maxime Beauchemin 0cc8eff1c3 [WiP] Deprecate Explore v1 (#2064)
* Simplifying the viz interface (#2005)

* Working on dashes

* Making this a collaborative branch

* Fixing some bugs

* Fixing bugs

* More improvements

* Add datasource back in bootstrap data

* Decent state

* Linting

* Moving forward

* Some more linting

* Fix the timer

* Triggering events through state

* Lingint

* Put filters in an array instead of flt strings (#2090)

* Put filters in an array instead of flt strings

* Remove query_filter(), put opChoices into Filter

* Update version_info.json

* Fix migrations

* More renderTrigger=true

* Fixing bugs

* Working on standalone

* getting standalone to work

* Fixed forcedHeight for standalone =view

* Linting

* Get save slice working in v2 (#2106)

* Filter bugfix

* Fixing empty series limit bug

* Fixed dashboard view

* Fixing short urls

* Only allow owners to overwrite slice (#2142)

* Raise exception when date range is wrong

* Only allow owner to overwrite a slice

* Fix tests for deprecate v1 (#2140)

* Fixed tests for control panels container and filters

* Fixed python tests for explorev2

* Fix linting errors

* Add in stop button during slice querying/rendering (#2121)

* Add in stop button during slice querying/rendering

* Abort ajax request on stop

* Adding missing legacy module

* Removing select2.sortable.js because of license

* Allow query to display while slice is loading (#2100)

* Allow query to display while slice is loading

* Put latestQueryFormData in store

* Reorganized query function, got rid of tu[le return values

* Merging migrations

* Wrapping up shortner migration

* Fixing tests

* Add folder creation to syncBackend

* Fixing edit URL in explore view

* Fix look of Stop button

* Adding syntax highlighting to query modal

* Fix cast_form_data and flase checkbox on dash

* Bugfix

* Going deeper

* Fix filtering

* Deleing invalid filters when changing datasource

* Minor adjustments

* Fixing calendar heatmap examples

* Moving edit datasource button to header's right side

* Fixing mapbox example

* Show stack trace when clicking alert

* Adding npm sync-backend command to build instruction

* Bumping up JS dependencies

* rm dep on select2

* Fix py3 urlparse

* rm superset-select2.js

* Improving migration scripts

* Bugfixes on staging

* Fixing Markup viz
2017-02-16 17:28:35 -08:00
Bogdan c564881867 Implement caching and dynamic data fetching. (#1466)
* Rename rv => o in the decorator.

* Address comments.

* Permissions cleanup: remove none and duplicates. (#1967)

* Updates

* Rename var and dropdown text

* Cleanup

* Resolve comments.

* Add user to the perm check.
2017-02-13 16:14:55 -08:00
Saleh Hindi daa1420c8e adding tests for #1131 (#1902)
* Add login test

* Add add-slice test

* Fix linting errors

* Use get_resp()helper method instead of self.client.get()

* Fix failing test.

* Add checks for URLs in the tablemodelview

* Fix linting errors

* Address pull request comments

* Address pull request comments

* Remove accidentally added files

* Fix failing test
2017-02-10 01:17:49 -08:00
Benedict Jin 1f58e18b6f Some code refactoring (#2139) 2017-02-08 11:52:58 -08:00
Benjamin Yolken 716406198e Clean up imports of cPickle and StringIO 2017-02-03 21:50:04 -08:00
Benjamin Yolken ce50e6e4fe Fix python3 cPickle import errors 2017-02-03 21:27:21 -08:00
Benjamin Yolken 167ed33bba Fix name of test in results_backends_tests module 2017-02-03 16:29:28 -08:00
Benjamin Yolken 00b6b0ac68 Misc. style tweaks to S3Cache changes and tests 2017-02-03 15:43:43 -08:00
Benjamin Yolken 1546b1ae71 Add tests for S3Cache 2017-02-03 15:40:18 -08:00
vera-liu 85806624db Use a key-value store model for sharing long queries (#1951)
* Add KeyValue model for storing id-value pairs
use it for storing shared queries

* Change string to text and added test

* Put getQueryLink in one place

* Changed migration down version

* Changes based on comments

* Update bcf3126872fc_add_keyvalue.py
2017-01-27 10:20:24 -08:00
Bogdan b1bba96d04 Fix csv download. (#2036) 2017-01-25 18:06:29 -08:00
vera-liu 27ed0b37bf Cleanup fulfilled requests after approve (#1953)
* Cleanup fulfilled requests after approve

* Modified tests

* Moved to separate test, add user to access functions

* Moved to separate test and added test cases

* Fixed issue with dryrun

* More changes based on comments
2017-01-24 18:11:51 -08:00
Bogdan 495f6460a4 Add email functionality (#1914)
* Add email functionality

* Add email templates.

* Test notifications

* Move email to utils
2017-01-13 19:30:17 -08:00
Maxime Beauchemin 2d866e3ffa [hotfix] fix the logging fix that broke the build (#1940)
* [hotfix] fix the logging fix that broke the build

* Fixing tests
2017-01-11 07:53:24 -08:00
Bogdan 2ab6a411f4 Druid dashboard import/export. (#1930)
* Druid dashboard import

* Fix tests.

* Parse params with trailing commas

* Resolved issue with datasource is not in DB yet when slice perms are set

* Finish rebase

* Fix heads alembic problem.
2017-01-09 10:02:03 -08:00
Maxime Beauchemin 49e6fd5bfb Revert "Druid dashboard import/export. " (#1923) 2017-01-07 14:02:13 -08:00
Bogdan af872fa4d4 Druid dashboard import/export. (#1811)
* Druid dashboard import

* Fix tests.

* Parse params with trailing commas

* Resolved issue with datasource is not in DB yet when slice perms are set

* Finish rebase
2017-01-06 16:48:21 -08:00
Maxime Beauchemin 222671675c [exploreV2] mapStateToProps for fields (#1882)
* Controls support for mapStateToProps

* Binding methods in the constructor

* Adressing comments

* Fixing tests
2017-01-06 12:38:44 -08:00
Maxime Beauchemin 9a62d94630 [sqllab] bugfix visualizing a query with a semi-colon (#1869)
* [sqllab] bugfix visualizing a query with a semi-colon

* Fixing tests
2017-01-06 12:24:07 -08:00
Maxime Beauchemin c14c7edc5e [explore] show the broken query when failing (#1871)
* Return query when failing

* Linting

* sjson -> simplejson
2017-01-05 10:00:39 -08:00
Riccardo Magliocchetti e3b296c558 utils: teach our json serializer to handle more types (#1907)
Namely datetime.time and numpy.bool_

Refs: #1900
Refs: #1903
2017-01-05 09:56:07 -08:00
willgroves ea8e6634d6 read anon user role from config, remove reference to public role (#1878)
* read anon user role from configuration, add anon user role as 'Public' to testing configuration

* apply suggestions
2016-12-27 14:30:01 -08:00
Dongkyu Hwangbo 3e6f90cf72 Upgrading pydruid version and adopt 'merge' flag during refresh_druid operation (#1879)
* Initial

* rewrite some line to make it short and setting merge variable temporarily

* rewrite commit author

* add emitted attribute

* Fix typo

* fix test error

* fix typo

* test added
2016-12-27 14:27:55 -08:00
vera-liu 6732f01cb7 Enable freeform-select with fetched column values for filter values (#1697)
* Enable freeform-select with fetched column values for filter values
 - db migration to add filter_select_enabled
 - add freeform-multi option for Selectfield
 - modify formatFilter() function on query to accomodate filter-select

* Fix js tests

* Fix codeclimate issue

* Changes based on comments

* Add test for filter endpoint

* Extract out renderFilterFormField function from render

* Fix landscape issues
2016-12-16 14:23:48 -08:00
Bogdan 92aa1a6124 Permissions refactoring, optimizations and unit testing. (#1798)
* Refactor and speed up superset init

* Add unit tests.

* Test fixes.

* More test updates.

* Fix read only perms

* Address comments.
2016-12-15 08:38:34 -05:00
vera-liu e1e20b8757 Sort searched queries by recency (#1735)
* Sort searched queries by recency

* Fixed sqllab tests

* Add one more tr to QueryTable spec for pagination

* Change desc to asc as we reverse queries in component
2016-12-14 10:14:54 -08:00
Maxime Beauchemin e099088012 [hotfix] fixing the build 2016-12-13 16:05:05 -08:00