Commit Graph

194 Commits

Author SHA1 Message Date
Marcus Levine
4bc5fe5495 [BUGFIX]: Check datatype of results before converting to DataFrame (#4108)
* conditional check on datatype of results before converting to df

fix type checking

fix conditional checks

remove trailing whitespace and fix df_data fallback def

actually remove trailing whitespace

generalized type check to check all columns for dict

refactor dict col check

* move df conversion to helper and add unit test

add missing newlines

another missing newline

fix quotes

more quote fixes
2018-01-23 20:58:06 -08:00
Maxime Beauchemin
37205099db Fix USA's state geojson for 'Country Map' visualization (#4121)
* Fix USA's state geojson for 'Country Map' visualization

Turns out the ISO codes were missing from the geojson file, this adds it
and uses human-readable indents.

* using proper ISO codes

* Linting

New linting rules started applying, I'm guessing a new version of
pylint?
2018-01-02 20:21:33 -08:00
Maxime Beauchemin
44e753d94d [sql lab] deeper support for templating (#3996)
* [sql lab] deeper support for templating

* Fixing py tests

* Fix typo
2017-12-19 15:55:58 -08:00
John Bodley
ac57780607 [flake8] Resolving Q??? errors (#3847) 2017-11-13 21:06:51 -08:00
John Bodley
1b4f128f55 [flake8] Resolving F5?? errors (#3846) 2017-11-12 11:09:22 -08:00
John Bodley
690de862e8 [flake8] Resolve E1?? errors (#3805) 2017-11-10 12:06:22 -08:00
John Bodley
e822fb50d8 [flake8] Resolving W??? errors (#3784) 2017-11-07 20:25:10 -08:00
John Bodley
e2bca47421 [flake8] Resolve I??? errors (#3797) 2017-11-07 20:23:40 -08:00
Alejandro Fernandez
adef519583 DI-1113. Authentication: Enable user impersonation for Superset to HiveServer2 using hive.server2.proxy.user (a.fernandez) (#3652) 2017-10-16 20:15:16 -07:00
timifasubaa
d4d4a9b1f1 Sqllab error troubleshooting (#3680)
* provide troubleshooting link

* add option to append error troubleshooting link beneath sqllab error
2017-10-16 16:30:08 -07:00
timifasubaa
1cf634afa2 Remove repeated line (#3491)
* add lanscape?

* Revert "add lanscape?"

This reverts commit b3d6e80af4.

* remove unused line
2017-09-19 21:30:48 -07:00
Maxime Beauchemin
ed9f56448f Adding missing future imports (#3493) 2017-09-19 11:20:22 -07:00
timifasubaa
ede1432936 Improve code quality (#3480)
* add lanscape?

* add code climate badges

* pylint first pass

* Try out yapf

* merge

* merge

* lint

* more yapf

* removed unnecessary corrections
2017-09-18 20:40:27 -07:00
Dmitry Goryunov
c988080990 Feature: "Impersonate user" setting on Datasource (#3404)
* Add "Impersonate user" setting to Datasource

* Add tests

* Use g.user.username for all the sync cases

* use uri.username instead of uri.user

* Small refactoring
2017-09-18 09:52:29 -07:00
Grace Guo
ad604aed09 fix encoding error in sql lab logging (#3424) 2017-09-14 11:18:34 -07:00
Maxime Beauchemin
6fc837db51 [sql lab] improve error messages (#3308)
* [sql lab] improve error messages

Some error messages in non-async mode were showing as JSON or sometimes
as tuples. This fixes that.

* linting
2017-08-18 15:50:07 -07:00
Riccardo Magliocchetti
90592d3e3d sql_lab: re-raise exception in get_sql_results (#3111)
As caller expect it to raise an exception instead of returning
None.

Refs #3075
2017-08-01 22:38:52 -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
Maxime Beauchemin
25c599d040 Escaping the user's SQL in the explore view (#3186)
* Escaping the user's SQL in the explore view

When executing SQL from SQL Lab, we use a lower level API to the
database which doesn't require escaping the SQL. When going through
the explore view, the stack chain leading to the same method may need
escaping depending on how the DBAPI driver is written, and that is the
case for Presto (and perhaps other drivers).

* Using regex to avoid doubling doubles
2017-07-27 09:47:31 -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
Maxime Beauchemin
712297480c [CLI] adding 'superset flower' command (flower is a UI for Celery) (#2963)
* [CLI] adding 'superset flower' command (flower is a UI for Celery)

* Addressing comments
2017-06-15 17:02:17 -07:00
Maxime Beauchemin
2395fbbdaa Adding end_result_backend_time to Query model (#2766)
This will help us keep track on how long it takes to push the data
into the results backend.
2017-05-16 20:34:38 -07:00
Maxime Beauchemin
a6e1e18244 [sql lab] fix CREATE TABLE AS (#2719) 2017-05-06 21:23:55 -07:00
Maxime Beauchemin
76042be7c3 [hotfix/sqllab] setting up the connection in the try: block 2017-04-17 17:32:21 -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
6b52384024 [hotfix] fix pending queries race condition 2017-03-30 19:54:55 +00:00
Maxime Beauchemin
91167665b1 Track both query start time and button push time to track delay (#2502)
* Track both query start time and button push time to track delay

* Fix

* Setting the proper precision

* More logging
2017-03-28 20:21:34 -07:00
Maxime Beauchemin
e2b572d9e2 Prevent alarming users with stacktrace when using sqlite 2017-03-19 18:55:11 -07:00
Bogdan
0674ed846c Use list instead of numpy array (#2412) 2017-03-14 18:01:35 -07:00
Bogdan
6160a3fdff Implement stop query functionality. (#2387)
* Implement stop query functionality.

* Address comments
2017-03-13 13:54:38 -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
vera-liu
fc85034c60 Better error handling for presto (#2161)
* Better error handling for presto

* Move to db_engine_spec
2017-02-17 10:29:35 -08:00
Bogdan
b1bba96d04 Fix csv download. (#2036) 2017-01-25 18:06:29 -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
16731056ed [sqllab] async queries - better error handling (#1853) 2016-12-19 22:33:55 -08:00
vera-liu
e06a0cd89b Add force_ctas_schema to query model when enabled (#1825)
* Add force_ctas_schema to query model when enabled

* Add schema to temp_table_name

* Remove extra arg in create_table_as
2016-12-15 13:19:54 -08:00
Maxime Beauchemin
324205f77a [sqllab] bugfix where a query has the same alias twice as output (#1734) 2016-12-01 19:53:23 -08:00
Bogdan
25acb78071 Pass schema to the select star query. (#1714) 2016-11-30 19:33:43 -05:00
Bogdan
dc98c6739f Implement table name extraction. (#1598)
* Implement table name extraction tests.

* Address comments.

* Fix tests and reimplement the token processing.

* Exclude aliases.

* Clean up print statements and code.

* Reverse select test.

* Fix failing test.

* Test JOINs

* refactore as a class

* Check for permissions in SQL Lab.

* Implement permissions check for the datasources in sql_lab

* Address comments.
2016-11-29 15:43:36 -05:00
Maxime Beauchemin
cef4a8296a [sqllab] adding a sql preprocessor for Presto (#1670)
* [sqllab] adding a sql preprocessor for Presto

* fixing tests
2016-11-22 21:24:38 -08:00
Maxime Beauchemin
15b67b2c6c [WiP] rename project from Caravel to Superset (#1576)
* Change in files

* Renamin files and folders

* cleaning up a single piece of lint

* Removing boat picture from docs

* add superset word mark

* Update rename note in docs

* Fixing images

* Pinning datatables

* Fixing issues with mapbox-gl

* Forgot to rename one file

* Linting

* v0.13.0

* adding pyyaml to dev-reqs
2016-11-09 23:08:22 -08:00