Commit Graph

401 Commits

Author SHA1 Message Date
John Bodley 9dac805e7e
[schema] Deprecating the table_columns.database_expression column (#7653) 2019-07-03 14:05:59 -07:00
John Bodley 6d7701e684
[fix] Updating Pandas resample logic (#7799) 2019-07-02 11:10:50 -07:00
John Bodley ffa7c617ad
[travis] Adding Black tox environment (#7809) 2019-07-01 18:05:15 -07:00
John Bodley e0d040c377
[fix] Handling of non-existent datasource (#7755) 2019-07-01 11:55:25 -07:00
Kim Truong 5994e432d4 feat: query based on all partitions (#7782)
* feat: query based on all partitions

* fix: address Beto's comments
2019-06-27 11:19:55 -07:00
John Bodley 5c58fd1802
[format] Using Black (#7769) 2019-06-25 13:34:48 -07:00
Maxime Beauchemin 859d6e7c6a
chore: taking db dependencies out of requirements-dev.txt (#7605)
* chore: taking db dependencies out of requirements-dev.txt

The deps on mysqlclient and psycopg2

* Fix unit tests

* fix tox.ini

* fix tests
2019-06-23 22:37:41 -07:00
Ville Brofeldt 1c4092c61c Add csv upload support for BigQuery (#7756)
* Add extra_require for bigquery to setup.py

* Refactor df_to_db and add df upload capability for BigQuery

* Fix unit tests and clarify kwarg logic

* Fix flake8 errors

* Add minimum versions for bigquery dependencies

* wrap to_gbq in try-catch block and raise error if pandas-gbq is missing

* Fix linting error and make error more generic
2019-06-23 14:20:09 -07:00
michellethomas 7a575ce20a
Fixing time comparison to look for past deltas (#7616)
* Fixing time comparison to look for past deltas

* Adding note to updating about time_compare
2019-06-19 10:10:18 -07:00
Ville Brofeldt 95291facff
Break up db_engine_specs (#7676)
* Refactor db_engine_specs into package

* Rename bigquery class and add epoch funcs

* Fix flake8 errors

* Dynamically load all engine specs

* Fix linting errors and unit tests

* Implement Snowflake epoch time funcs

* Implement Teradata epoch time func

* Fix presto datasource query and remove unused import

* Fix broken datasource query

* Add mypy ignore for false positive

* Add missing license files

* Make create_time_grains_tuple public

* Fix flake8 quote

* Fix incorrect licence header
2019-06-08 11:27:13 -07:00
Erik Ritter f7812a3f27 [SQL Lab] Clarify SQL Lab query and display limits (#7641) 2019-06-07 17:16:38 -07:00
John Bodley 45b41aadcc
[fix] SQL parsing of table names (#7490) 2019-06-03 11:07:57 -07:00
Jim Horng 78c1674dc7 make filter_values() macro to properly accept value from filter box with single value setting (#7494) 2019-06-03 09:54:07 -07:00
Maxime Beauchemin 45b9880516
fix: SqlaColumn.type overflow on mysql (#7606)
* fix: SqlaColumn.type overflow on mysql

Hitting a new error when loading examples around a datatype that exceeds
the 32 chars limit on SqlaColumn.type

Type includes the 'COLLATE utf8mb4_general_ci' suffix which is too
verbose and not needed in that context.

* fix tests
2019-06-03 09:52:25 -07:00
Maxime Beauchemin 4b5931f637
Alternative fix for #7559 (#7575)
* Alternative fix for #7559

Just an idea...

* logging
2019-06-01 09:21:35 -07:00
Erik Ritter 722043c672 Allow trailing spaces in simple filter values (#7617) 2019-05-31 17:06:41 -07:00
Kim Truong 9acafd5b75 fix: handle presto columns with whitespace (#7630) 2019-05-31 13:38:05 -07:00
Kim Truong d2967340d9 View Presto row and array objects clearly in the data grid (#7625)
* feat: rough check in for Presto rows and arrays

* fix: presto arrays

* fix: return selected and expanded columns

* fix: add helper methods and unit tests

* fix: only allow exploration of selected columns

* fix: address Beto's comments and add more unit tests
2019-05-31 11:25:07 -07:00
Ville Brofeldt c1712e5d10
Add relative start param for time filters (#7525)
* Add relative start param for time filters

* Fix typo and add types to parse_human_datetime

* Add relative start/end to query_object

* Fix linting error
2019-05-31 16:55:26 +03:00
Ville Brofeldt 34407e8962
Make timestamp expression native SQLAlchemy element (#7131)
* Add native sqla component for time expressions

* Add unit tests and remove old tests

* Remove redundant _grains_dict method

* Clarify time_grain logic

* Add docstrings and typing

* Fix flake8 errors

* Add missing typings

* Rename to TimestampExpression

* Remove redundant tests

* Fix broken reference to db.database_name due to refactor
2019-05-30 08:28:37 +03:00
Maxime Beauchemin fd5befee38
Bump python libs, address insecure releases (#7550)
* Bump python libs, address insecure releases

Using
https://requires.io/github/mistercrunch/superset/requirements/?branch=apache_release_improv
to identify insecure, old releases we're using and bumping.

* redis <3.0

* fix new flakes
2019-05-28 21:03:49 -07:00
Ville Brofeldt f7d3413a50
Add support for period character in table names (#7453)
* Move schema name handling in table names from frontend to backend

* Rename all_schema_names to get_all_schema_names

* Fix js errors

* Fix additional js linting errors

* Refactor datasource getters and fix linting errors

* Update js unit tests

* Add python unit test for get_table_names method

* Add python unit test for get_table_names method

* Fix js linting error
2019-05-26 06:13:16 +03:00
John Bodley 6b9790c8b1
[ad-hoc] Fixing type for count distinct (#7573) 2019-05-22 09:41:25 -07:00
Daniel Vaz Gaspar 74704f68c7 [security] New, deprecate merge_perm, FAB method is fixed (#7355)
* [security] New, deprecate merge_perm, FAB method is fixed

* [style] Fix, flakes

* [tests] Fix, change merge_perm to add_permission_view_menu

* [security] Fix, maintain merge_perm for compatibility

* [security] New, deprecation warning on merge_perm method

* [style] Fix, flake8 C812
2019-05-20 17:30:00 -07:00
Maxime Beauchemin d8be0a7dd5
Break line before LIMIT statement to prevent trailing comment issue (#7485)
* Break line before LIMIT statement to prevent trailing comment issue

This may not be a perfect solution but it addresses the issue in 7483

closes https://github.com/apache/incubator-superset/issues/7483

* fix tests
2019-05-13 00:34:34 -05:00
Ville Brofeldt 959c35d506 bugfix: Improve support for special characters in schema and table names (#7297)
* Bugfix to SQL Lab to support tables and schemas with characters that require quoting

* Remove debugging prints

* Add uri encoding to secondary tables call

* Quote schema names for presto

* Quote selected_schema on Snowflake, MySQL and Hive

* Remove redundant parens

* Add python unit tests

* Add js unit test

* Fix flake8 linting error
2019-05-08 00:37:44 -05:00
Alex Berghage 24970485cf feat: Add `validate_sql_json` endpoint for checking that a given sql query is valid for the chosen database (#7422) (#7462)
merge from lyft-release-sp8 to master
2019-05-06 10:21:02 -07:00
Kim Truong 88e6ec992c feat: view presto row objects in data grid (#7445)
* Merge lastest from master into lyft-release-sp8 (#7405)

* filter out all nan series (#7313)

* improve not rich tooltip (#7345)

* Create issue_label_bot.yaml (#7341)

* fix: do not save colors without a color scheme (#7347)

* [wtforms] Strip leading/trailing whitespace (#7084)

* [schema] Updating the datasources schema (#5451)

* limit tables/views returned if schema is not provided (#7358)

* limit tables/views returned if schema is not provided

* fix typo

* improve code performance

* handle the case when table name or view name does not present a schema

* Add type anno (#7342)

* Updated local dev instructions to include missing step

* First pass at type annotations

* [schema] Updating the base column schema (#5452)

* Update 937d04c16b64_update_datasources.py (#7361)

* Feature flag for client cache (#7348)

* Feature flag for client cache

* Fix integration test

* Revert "Fix integration test"

This reverts commit 58434ab98a.

* Feature flag for client cache

* Fix integration tests

* Add feature flag to config.py

* Add another feature check

* Fix more integration tests

* Fix raw HTML in SliceAdder (#7338)

* remove backendSync.json (#7331)

* [bubbles] issue when using duplicated metrics (#7087)

* SUPERSET-7: Docker compose config version breaks on Ubuntu 16.04 (#7359)

* SUPERSET-8: Update text in docs copyright footer (#7360)

* SUPERSET-7: Docker compose config version breaks on Ubuntu 16.04

* SUPERSET-8: Extra text in docs copyright footer

* [schema] Adding commits and removing unnecessary foreign-key definitions (#7371)

*  Store last selected dashboard in sessionStorage (#7181)

* Store last selected dashboard in sessionStorage

* Fix tests

* [schema] Updating the base metric schema (#5453)

* Fix NoneType bug & fill the test recipients with original recipients if empty (#7365)

* feat: see Presto row and array data types (#7391)

* feat: see Presto row and array data types

* fix: address PR comments

* fix: lint and build issues

* fix: add types

* Incorporate feedback from initial PR (prematurely merged to lyft-release-sp8) (#7415)

* add stronger type hints where possible

* fix: lint issues and add select_star func in Hive

* add missing pkg init

* fix: build issues

* fix: pylint issues

* fix: use logging instead of print

* feat: view presto row objects in data grid

* fix: address feedback

* fix: spacing
2019-05-03 16:29:57 -07:00
John Bodley fb627ba376
[fix] Fixing SQL parsing issue (#7374) 2019-05-01 22:07:01 -07:00
Dave Smith a6aabf8268 feature: see Presto row and array data types (#7413)
* Merge lastest from master into lyft-release-sp8 (#7405)

* filter out all nan series (#7313)

* improve not rich tooltip (#7345)

* Create issue_label_bot.yaml (#7341)

* fix: do not save colors without a color scheme (#7347)

* [wtforms] Strip leading/trailing whitespace (#7084)

* [schema] Updating the datasources schema (#5451)

* limit tables/views returned if schema is not provided (#7358)

* limit tables/views returned if schema is not provided

* fix typo

* improve code performance

* handle the case when table name or view name does not present a schema

* Add type anno (#7342)

* Updated local dev instructions to include missing step

* First pass at type annotations

* [schema] Updating the base column schema (#5452)

* Update 937d04c16b64_update_datasources.py (#7361)

* Feature flag for client cache (#7348)

* Feature flag for client cache

* Fix integration test

* Revert "Fix integration test"

This reverts commit 58434ab98a.

* Feature flag for client cache

* Fix integration tests

* Add feature flag to config.py

* Add another feature check

* Fix more integration tests

* Fix raw HTML in SliceAdder (#7338)

* remove backendSync.json (#7331)

* [bubbles] issue when using duplicated metrics (#7087)

* SUPERSET-7: Docker compose config version breaks on Ubuntu 16.04 (#7359)

* SUPERSET-8: Update text in docs copyright footer (#7360)

* SUPERSET-7: Docker compose config version breaks on Ubuntu 16.04

* SUPERSET-8: Extra text in docs copyright footer

* [schema] Adding commits and removing unnecessary foreign-key definitions (#7371)

*  Store last selected dashboard in sessionStorage (#7181)

* Store last selected dashboard in sessionStorage

* Fix tests

* [schema] Updating the base metric schema (#5453)

* Fix NoneType bug & fill the test recipients with original recipients if empty (#7365)

* feat: see Presto row and array data types (#7391)

* feat: see Presto row and array data types

* fix: address PR comments

* fix: lint and build issues

* fix: add types

* add stronger type hints where possible

* fix: lint issues and add select_star func in Hive

* add missing pkg init

* fix: build issues

* fix: pylint issues

* fix: use logging instead of print
2019-05-01 09:17:34 -07:00
Daniel Vaz Gaspar 06c4610e8e Bump FAB to 2.0.0 (#7323)
* Bump FAB to 2.0.0

* [tests] whitelist SecurityApi login and refresh endpoints

* [style] Fix, C812 missing trailing commas

* [security] Remove SUPERSET_UPDATE_PERMS flag

Registering sources needs to be performed after the views are
initialized on UPDATE_PERMS=False configuration

* [docs] New, FAB_UPDATE_PERMS and flask fab cli

* [docs] Fix, db upgrade needs to come first, create-admin needs a db

* [cli] New, superset init bootstraps all permissions for FAB and Superset

* [style] Fix, flakes
2019-04-30 09:01:18 -07:00
John Bodley f488a3281d
[schema] Updating the base metric schema (#5453) 2019-04-24 21:50:14 -07:00
John Bodley 1388452169
[schema] Updating the base column schema (#5452) 2019-04-23 18:06:21 -07:00
Maxime Beauchemin 36a219da7f
Allow Gamma and Alpha to access '/users/userinfo/' (#6936)
* Allow Gamma and Alpha to access '/users/userinfo/'

closes https://github.com/apache/incubator-superset/issues/4919

* Fix unit test

* Fix test
2019-04-22 11:23:54 -07:00
Maxime Beauchemin 5f28027ce7 Merging lyftga into master 2019-04-18 22:47:47 -07:00
michellethomas 51068f007e
Adding permission for can_only_access_owned_queries (#7234)
* Adding permission for can_only_access_owned_queries

* Fixing lint adding typing to variable

* Adding test for queryview and enabling /queryview/api/read

* Fixing issues with python typing
2019-04-17 16:11:11 -07:00
Maxime Beauchemin 9dfa80d5c8
Add all database access permission to 'Alpha' role (#7271)
* Add all database access permission to 'Alpha' role

* Grant all database access to Alpha
2019-04-15 09:22:54 -07:00
Beto Dealmeida 4ab89dbcf7 Celery task for warming up cache (#7148)
* Sparkline dates aren't formatting in Time Series Table (#6976)

* Exclude venv for python linter to ignore

* Fix NaN error

* Fix the white background shown in SQL editor on drag (#7021)

This PR sets the background-color css property on `.ace_scroller` instead of `.ace_content` to prevent the white background shown during resizing of the SQL editor before drag ends.

* Show tooltip with time frame (#6979)

* Fix time filter control (#6978)

* Enhancement of query context and object. (#6962)

* added more functionalities for query context and object.

* fixed cache logic

* added default value for groupby

* updated comments and removed print

(cherry picked from commit d5b9795f87)

* [fix] /superset/slice/id url is too long (#6989)


(cherry picked from commit 6a4d507ab6)

* [WIP] fix user specified JSON metadata not updating dashboard on refresh (#7027)


(cherry picked from commit cc58f0e661)

* feat: add ability to change font size in big number (#7003)

* Add ability to change font sizes in Big Number

* rename big number to header

* Add comment to clarify font size values

* Allow LIMIT to be specified in parameters (#7052)

* [fix] Cursor jumping when editing chart and dashboard titles (#7038)


(cherry picked from commit fc1770f7b7)

* Changing time table viz to pass formatTime a date (#7020)

(cherry picked from commit 7f3c145b1f)

* [db-engine-spec] Aligning Hive/Presto partition logic (#7007)


(cherry picked from commit 05be866117)

* [fix] explore chart from dashboard missed slice title (#7046)


(cherry picked from commit a6d48d4052)

* fix inaccurate data calculation with adata rolling and contribution (#7035)


(cherry picked from commit 0782e831cd)

* Adding warning message for sqllab save query (#7028)


(cherry picked from commit ead3d48133)

* [datasource] Ensuring consistent behavior of datasource editing/saving. (#7037)

* Update datasource.py

* Update datasource.py

(cherry picked from commit c771625f10)

* [csv-upload] Fixing message encoding (#6971)


(cherry picked from commit 48431ab5b9)

* [sql-parse] Fixing LIMIT exceptions (#6963)


(cherry picked from commit 3e076cb60b)

* Adding custom control overrides (#6956)

* Adding extraOverrides to line chart

* Updating extraOverrides to fit with more cases

* Moving extraOverrides to index.js

* Removing webpack-merge in package.json

* Fixing metrics control clearing metric

(cherry picked from commit e6194051f4)

* [sqlparse] Fixing table name extraction for ill-defined query (#7029)


(cherry picked from commit 07c340cf82)

* [missing values] Removing replacing missing values (#4905)


(cherry picked from commit 61add606ca)

* [SQL Lab] Improved query and results tabs rendering reliability (#7082)

closes #7080

(cherry picked from commit 9b58e9f492)

* Fix filter_box migration PR #6523 (#7066)

* Fix filter_box migration PR #6523

* Fix druid-related bug

(cherry picked from commit b210742ad2)

* SQL editor layout makeover (#7102)

This PR includes the following layout and css tweaks:
- Using flex to layout the north and south sub panes of query pane so resizing works properly in both Chrome and Firefox
- Removal of necessary wrapper divs and tweaking of css in sql lab so we can scroll to the bottom of both the table list and the results pane
- Make sql lab's content not overflow vertically and layout the query result area to eliminate double scroll bars
- css tweaks on the basic.html page so the loading animation appears in the center of the page across the board

(cherry picked from commit 71f1bbd2ec)

* [forms] Fix handling of NULLs

(cherry picked from commit e83a07d3df)

* handle null column_name in sqla and druid models

(cherry picked from commit 2ff721ae07)

* Use metric name instead of metric in filter box (#7106)


(cherry picked from commit 003364e74e)

* Bump python lib croniter to an existing version (#7132)

Package maintainers should really never delete packages, but it appears
this happened with croniter and resulted in breaking our builds.

This PR bumps to a more recent existing version of the library

(cherry picked from commit 215ed392a1)

* Revert PR #6933 (#7162)

* Celery worker for warming up cache

* Remove testing changes

* Add documentation

* Fix lint

* WIP dashboard filters

* Use new cache so it works with dashboards

* Add more unit tests, fix old ones

* Fix flake8 and docs

* Sparkline dates aren't formatting in Time Series Table (#6976)

* Exclude venv for python linter to ignore

* Fix NaN error

* Changing time table viz to pass formatTime a date (#7020)

(cherry picked from commit 7f3c145b1f)

* SQL editor layout makeover (#7102)

This PR includes the following layout and css tweaks:
- Using flex to layout the north and south sub panes of query pane so resizing works properly in both Chrome and Firefox
- Removal of necessary wrapper divs and tweaking of css in sql lab so we can scroll to the bottom of both the table list and the results pane
- Make sql lab's content not overflow vertically and layout the query result area to eliminate double scroll bars
- css tweaks on the basic.html page so the loading animation appears in the center of the page across the board

(cherry picked from commit 71f1bbd2ec)

* Celery worker for warming up cache

* Remove testing changes

* Add documentation

* Fix lint

* WIP dashboard filters

* Use new cache so it works with dashboards

* Add more unit tests, fix old ones

* Fix flake8 and docs

* Fix bad merge and pylint
2019-04-03 16:57:59 -07:00
Kim Truong e974a23f90 [Lyft-GA] Enable color consistency in a dashboard (#7135)
* Enable color consistency in a dashboard

Moved actions, minor UI, allowed dashboard copy

Fix linting errors

Undo unintentional change

Updated and added unit tests

Fail quietly if package has not been updated

Fail quietly on dashboard copy if package is old

* Update packages

* Remove unnecessary code

* Addressed Grace's comments

* Small fix for item key

* Reset chart's color during exploration

* Do not reset chart form data when exploring chart
2019-04-01 22:04:31 -07:00
Dave Smith ba19a62412 Injectable statsd client (#7138)
* Add ability to inject statsd client; some py test/reqs updates

- Updated the metrics logger to allow construction with an existing
statsd client, so that it can be configured by external systems or libs.
- added requirements to requirements-dev.txt which are needed to run
  tests-eg coverage, nose
- removed dependency on mock lib, it is in python stdlib now
- updated tox.ini to remove the now-superfluous deps

* add license to test file, and remove blank line at EOF
2019-03-27 14:08:36 -07:00
Ville Brofeldt 23e823f0c1 Bump SQLAlchemy to 1.3 (#7099)
* Bump sqla to >=1.3.1

* Refine mssql column types to only use N-prefixing when necessary

* make join explicit

* replace set with list

* Add additional test case for N-prefix

* Replace engine with dialect and fix linting error

* Remove unneeded import
2019-03-24 20:44:05 -07:00
Maxime Beauchemin b210742ad2
Fix filter_box migration PR #6523 (#7066)
* Fix filter_box migration PR #6523

* Fix druid-related bug
2019-03-20 21:41:33 -07:00
John Bodley 61add606ca
[missing values] Removing replacing missing values (#4905) 2019-03-20 17:14:15 -07:00
John Bodley 07c340cf82
[sqlparse] Fixing table name extraction for ill-defined query (#7029) 2019-03-15 09:19:30 -07:00
John Bodley 3e076cb60b
[sql-parse] Fixing LIMIT exceptions (#6963) 2019-03-05 09:36:08 -08:00
Maxime Beauchemin ed79134e7f
auto-set 'Is Temporal' to true where column_name == '__time' (#6857)
* auto-set 'Is Temporal' to true where column_name == '__time'

* Adress comments

* lint

* clarifying name and comments
2019-03-04 20:51:11 -08:00
Maxime Beauchemin 3ae02d1a54
Allow for dynamic feature flags (#6808)
* Allow for dynamic feature flags

Giving more control over feature flags, allowing administrator to define
custom logic around whether features are enabled for particular users /
roles.

The exposed function can be used for things like:
* progressive rollout of features (1%, 5%, 50%, 100%)
* experimentation
* role-based feature affectation (only admins see a particular feature)

* fix build

* Addressing comments

* Addressing @hughhh's comments
2019-02-27 15:11:38 -08:00
Ville Brofeldt ea9d22b2ec Force quotes on non-expression time grains on Postgres (#6897)
* Force quotes on non-expression time grains on postgres

* Change to or semantics

* Return lower case column name as unmutated

* Add testcases for postgres time grains

* Make expression MixedCase
2019-02-21 13:16:28 -08:00
Ville Brofeldt f5277fe684 Refactor dataframe and column name mutation logic (#6847)
* Merge dataframe and column name mutation logic, add flag for disabling column aliases and add column name length checking

* Remove custome mutate_label from oracle spec

* Move hashing from mutate_label() to make_label_compatible()

* Remove empty line

* Make label mutating and truncating more robust

* Rename variables and make proposed changes from review

* Always execute labels_expected codepath

* Fix linting error

* Add comments and fix subquery errors

* Refine column compatibility

* Simplify label assignment

* Add unit tests for BQ and Oracle

* Linting
2019-02-20 23:05:35 -08:00
michellethomas ba9523c7c4 Adding dropdown to DatasourceControl and ability to change datasource (#6816)
* Adding dropdown to DatasourceControl and ability to change datasource

* Style fixes

* Adding unit tests for datasource/get endpoint

* Fixing issue with dropdown overflow and style changes

* Fixing issues rebasing metadata button and fixing sort for datasource with no name
2019-02-20 14:32:33 -08:00