Commit Graph

576 Commits

Author SHA1 Message Date
Daniel Vaz Gaspar d81f720502
[thumbnails] API and celery task for dashboards and charts (#8947) 2020-04-15 09:40:14 +01:00
Jianchao Yang 7b4b0d1c61
[Build] Add Github workflows (#9517)
As an replacement to Travis CI.
2020-04-14 13:38:09 -07:00
Daniel Vaz Gaspar 925d8b5315
[dashboard] Fix, improve test for custom filter (#9521) 2020-04-14 10:10:14 +01:00
Ville Brofeldt 9447381549
deprecate groupby controls in query_obj (#9366)
* Deprecate groupby from query_obj

* Fix query_object bug

* Fix histogram

* Remove groupby from legacy druid connector and fix first batch of unit tests

* Deprecate some unnecessary tests + fix a few others

* Address comments

* hide SIP-38 changes behind feature flag

* Break out further SIP-38 related tests

* Reslove test errors

* Add feature flag to QueryContext

* Resolve tests and bad rebase

* Backport recent changes from viz.py and fix broken DeckGL charts

* Fix bad rebase

* backport #9522 and address comments
2020-04-14 12:06:10 +03:00
Daniel Vaz Gaspar 622561f756
[charts] New, custom filter for name OR description (#9492)
* [charts] New, custom filter for name OR description

* Improve test
2020-04-11 07:25:54 +01:00
Bogdan 02b3fb1d63
Add visualization flow to the CTA queries (#9370)
* Visualize after running Ctas query (#4)

* Visualize after running Ctas query.

Stub for table viz

Work on the viz

Add JS functionality for Ctas viz

Add test for the table viz flow

Fix test

Add js test for the ctas viz

* Fix tests

* Resolve comments

* Leverate tmpSchema in the query object

* Fix i18n string

Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
2020-04-11 00:46:46 +03:00
Ville Brofeldt a8ce3bccdf
feat: Add post processing to QueryObject (#9427)
* Add post processing to QueryObject

* Simplify sort signature and require explicit sort order

* Add new operations and unit tests

* linting

* Address comments

* Simplify test method names

* Address comments

* Linting

* remove unnecessary logic

* Apply strict whitelisting to all getattr calls

* Add checking of rolling_type_options and add/improve docs
2020-04-10 20:50:11 +03:00
Daniel Vaz Gaspar b39e78fca5
[dashboards] New, tittle and slug OR filter (#9435)
* [dashboards] New, tittle and slug OR filter

* Update requirements, because of prison bump

* Tests

* Fix tests

* Avoid like filter on empty string value

* merge master brings strict typing to the table
2020-04-09 11:14:28 +01:00
Daniel Vaz Gaspar bb80ceaccc
[dashboards] Fix, update dashboard owners not propagating to charts o… (#9484)
* [dashboards] Fix, update dashboard owners not propagating to charts owners

* Add tests

* Fix tests

* better naming
2020-04-09 09:37:37 +01:00
Daniel Vaz Gaspar 0610c489bb
[query] Migrate api v1 query to new location (#9479)
* [query] Migrate api v1 query to new location

* Improved errors and tests

* [query] nit and revert undesired change

* [query] lint

* [query] revert nan change

* Update superset/queries/api.py

Co-Authored-By: Ville Brofeldt <33317356+villebro@users.noreply.github.com>

* Update tests/queries/api_tests.py

Co-Authored-By: Ville Brofeldt <33317356+villebro@users.noreply.github.com>

* change endpoint location to charts

Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
2020-04-09 09:05:49 +01:00
Daniel Vaz Gaspar 4485800e21
[tests] refactor, change datasets and charts to it's own folder (#9487) 2020-04-08 08:44:35 +01:00
dandanhub 72f051f3ce
[sqllab] Add CUSTOM_TEMPLATE_PROCESSOR config (#9376)
Co-authored-by: Dandan Shi <dshi@dropbox.com>
2020-04-07 21:00:42 +01:00
David Aaron Suddjian 5e535062da
Filter owners select by text input (#9337)
* filter owners select by text input

* use rison

* fix backend owners filter logic

* use fullname, not username on owners inputs

* fix some tests

* fixing tests

* deterministic tests

* appease linter

* add back search by username

* more comprehensive filter test

* add clarifying text

* formatting...
2020-04-07 09:09:02 -07:00
Daniel Vaz Gaspar c0807c1af7
[query] New, readonly API (#9403)
* [query] New, readonly API

* Update tests/queries/api_tests.py

Co-Authored-By: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
2020-04-06 11:18:32 +01:00
Jianchao Yang 801e2f1777
chore: bump black to 19.10b0 and mypy to 0.770 (#9378)
* Bump black to 19.10b0

* Upgrade mypy to 0.770

* Update how inline type is defined
2020-04-04 13:23:18 -07:00
Daniel Vaz Gaspar 752de8fe9d
[dashboards] Fix, API update slug uniqueness refusing empty string (#9417)
* [dashboards] Fix, API update slug uniqueness refusing empty string

* [dashboards] tests
2020-03-30 16:10:08 +01:00
Ville Brofeldt 499f9c8fca
feat: add SSL certificate validation for Druid (#9396)
* feat: add SSL certificate feature

* Address comments

* don't mutate extras

* Address comments and add polish

* Add further polish
2020-03-27 19:07:07 +02:00
Daniel Vaz Gaspar 81971967c3
[charts] New, bulk delete API endpoint (#9387)
* [charts] New, bulk delete API endpoint

* [charts] Fix, typos

* [charts] Fix wrong model name
2020-03-27 09:31:01 +00:00
Daniel Vaz Gaspar 40bc1b33d2
[dataset] New, export API endpoint (#9367)
* [dataset] New, export API endpoint

* Fix, lint
2020-03-27 09:30:23 +00:00
John Bodley 19da9042ff
[cache] Cleaning up viz/cache logic (#9375)
Co-authored-by: John Bodley <john.bodley@airbnb.com>
2020-03-26 09:22:06 -07:00
Grace Guo 6b0f62a36e
[explore view] fix long query issue from Run in SQL LAB Button (#9345)
* [explore view] fix long query issue from Run in SQL LAB Button

* SQL Lab page needs to take the post form data, too

* fix variable names

* updated payload dict, rename hidden form

Co-authored-by: Jesse Yang <jesse.yang@airbnb.com>
2020-03-25 13:15:52 -07:00
Daniel Vaz Gaspar ccb22dc976
[dataset] columns and metrics API (nested) (#9268)
* [dataset] columns and metrics API (nested)

* [dataset] tests and validation

* [datasets] Fix, revert list field name to database_name
2020-03-24 17:24:08 +00:00
Daniel Vaz Gaspar f51ab59748
[charts] Refactor API using SIP-35 (#9329)
* [charts] Refactor charts API using SIP-35

* [charts] Fix, copy pasta

* [charts] simplify
2020-03-24 10:05:11 +00:00
Maxime Beauchemin 98a71be80b
feat: [explore] don't save filters inherited from a dashboard (#9340)
* feat: [explore] don't save filters inherited from a dashboard

When navigating to explore from a dashboard context, the current
dashboard filter(s) are passed along to explore so that the context is
kept. So say you're filtering on "country=Romania", in your dashboard
and pivot to explore, that filter is still there and keep on exploring.

Now a common issue is that you'll want to make some tweak to your chart
that are unrelated to the filter, say toggling the legend off for
instance, and then save it. Now you back to your dashboard and even
though you started with an "all countries" dashboard, with a global
filter on country, now that one chart is stuck on "Romania". Typically
you notice this when filtering on something else, say "Italy" and then
that one chart now has two mutually exclusive filters, and show "No data".

Now, the fix is to flag the filter as "extra" (that's the not-so-good internal
name we use for these inherited filters) and make it clear that that
specific filter is special and won't be saved when saving the chart.

* fix build
2020-03-23 23:05:00 -07:00
Daniel Vaz Gaspar c34df6b7b3
[dashboard] Refactor API using SIP-35 (#9315)
* [dashboard] Refactor API using SIP-35

* [dashboard] Fix, import

* [dashboard] more tests

* [dashboards] a misc of improvements

* [charts] Fix, DAO and tests

* [dashboards] small exceptions refactor

* [dashboards] lint

* [dashboards] Improves comments on base classes

* [dashboards] lint
2020-03-20 16:32:03 +00:00
Ville Brofeldt f1edcebc79
fix: handle list of lists from fetch_data (#9322)
* fix: handle list of lists from fetch_data

* Address comments
2020-03-18 22:04:26 +02:00
Grace Guo adebd40d30
[cache warm_up] warm_up slice with dashboard default_filters (#9311)
* [cache warm_up] warm_up slice with dashboard default_filters

* update Celery warmup tasks

* fix code review comments

* add try catch and type checking for parsed dash metadata

* extra code review fix
2020-03-18 08:21:10 -07:00
Ville Brofeldt 982c234a50
fix: remove character set and collate column info by default (#9316)
* fix: remove character set and collate column info by default

* lint

* remove collation and charset info before compile
2020-03-17 21:34:39 +02:00
Maxime Beauchemin 6cf36c91ea
fix: big number to handle NULL as it did in the past (#9314) 2020-03-17 10:46:59 -07:00
ʈᵃᵢ 5767fb15cd
[datasets] new, listview (react) (#9197)
* [datasets] new, react listview

* add hidden columns to support filtering by columns not rendered

* throw exception if config is incorrect

* fix database filter

* update endpoints to point to datasets; fix translation strings

* move Link into src/components

* add add new record button to datasets listview
2020-03-13 21:35:00 +02:00
Erik Ritter f80fadff0e
Reduce dashboard bootstrap payload (#9284) 2020-03-13 12:18:22 -07:00
Daniel Vaz Gaspar 78ba7d52f6
[dashboard][api] Fix, PUT publish/draft to not clean slug and owners (#9279) 2020-03-12 15:35:27 +00:00
Ville Brofeldt 3682702e91
fix: add connection testing params for snowflake (#9272)
* fix: add connection testingt params for snowflake

* Linting
2020-03-11 06:51:57 +02:00
Grace Guo 724b8a3c31
[fix] copy filter_scopes with duplicate charts (#9271) 2020-03-10 10:23:15 -07:00
Maxime Beauchemin c04d6163e7
feat: add rolling window support to 'Big Number with Trendline' viz (#9107)
* Rolling big number

* addressing comment
2020-03-10 10:19:12 -07:00
Maxime Beauchemin 116200cf73
fix: change database save in DatasourceEditor (#9255)
* fix: change database save in DatasourceEditor

This addresses the issue where pointing a datasource to another database
in the datasource editor is not reflected.

Also addresses:
- a minorcosmetic issue in the datasource editor.
- user/owners list not getting populated

* tests
2020-03-10 09:20:37 -07:00
Daniel Vaz Gaspar 52c59d6890
[datasets] new, API using command pattern (#9129)
* [datasets] new, API using command pattern

* [datasets] tests and improvements

* [datasets] lint

* [database] address comments

* [datasets] lint

* [datasets] Address PR comments

* [dataset] Fix, dataset expects a Dict now

* [dataset] lint and optional commits

* [dataset] mypy

* [dataset] Fix, license and parent class

* [dataset] Make CRUD DAO raise exceptions
2020-03-08 09:13:08 +00:00
Erik Ritter f34e9e393a
Replace No data error with help message (#9249) 2020-03-06 16:11:01 -08:00
Grace Guo 000a038af1
[fix] use filter_scopes in dashboard warmup strategy (#9235)
* [fix] use filter_scopes in dashboard warmup strategy

* remove unnecessary comment
2020-03-05 17:50:32 -08:00
Ville Brofeldt ef2ebbd570
Add option to specify type specific date truncation functions (#9238) 2020-03-05 07:25:50 +02:00
Ville Brofeldt 969bc87431
fix: Oracle fetch_query and datetime conversion (#9240) 2020-03-04 23:43:28 +02:00
Ville Brofeldt 7a91498cf1
fix: share column type matching between model and result set (#9161)
* Share column type matching between model and result set

* Address comments
2020-03-04 16:33:22 +02:00
Bogdan 4e1fa95035
Make schema name for the CTA queries and limit configurable (#8867)
* Make schema name configurable

Fixing unit tests

Fix table quoting

Mypy

Split tests out for sqlite

Grant more permissions for mysql user

Postgres doesn't support if not exists

More logging

Commit for table creation

Priviliges for postgres

Update tests

Resolve comments

Lint

No limits for the CTA queries if configures

* CTA -> CTAS and dict -> {}

* Move database creation to the .travis file

* Black

* Move tweaks to travis db setup

* Remove left over version

* Address comments

* Quote table names in the CTAS queries

* Pass tmp_schema_name for the query execution

* Rebase alembic migration

* Switch to python3 mypy

* SQLLAB_CTA_SCHEMA_NAME_FUNC -> SQLLAB_CTAS_SCHEMA_NAME_FUNC

* Black
2020-03-03 19:52:20 +02:00
David Aaron Suddjian e01f24f833
Prevent database connections to sqlite (#9218)
* prevent database connections to sqlite

* tweaks and tests

* add entry to UPDATING.md
2020-03-02 13:13:11 -08:00
Grace Guo ccd6e44edf
refactor copy filter_scopes and add tests (#9224)
* refactor copy filter_scopes and add tests

* fix review comments
2020-03-02 12:55:30 -08:00
John Bodley 7b2c2e8a33
[fix] Adding SIP-15 support for the query context (#9219) 2020-03-02 10:10:54 -08:00
michellethomas 4f73f8a1f9
[Bug Fix] Returning timeseries_limit_metric in table viz get_data (#9196)
* Returning timeseries_limit_metric in table viz get_data

* Fixing issue with include_time field

* Reformatting and adding a test

* Changing if/else structure

* Reformatting
2020-02-25 21:34:36 -08:00
Daniel Vaz Gaspar 27b371a485
[core] Fix, sanitize errors returned from testconn (#9178) 2020-02-24 10:40:51 +00:00
altef dee16de03e
[SIP-29] Add support for row-level security (#8699)
* Support and apply filters.

* Added the UI for row level security, and moved it all under SQLA in order to access the Table model more easily.

* Added a row level security filter documentation entry.

* Accidentally added two new lines to this file.

* Blacked and iSorted, hopefully.  Also, sometimes g.user may not be set.

* Another isort, and handling g not having a user attribute another way.

* Let's try this again #CI tests.

* Adjusted import order for isort; I was sure I'd already done this..

* Row level filters should be wrapped in parentheses in case one contains an OR.

* Oops, did not think that would change Black's formatting.

* Changes as per @mistercrunch.

* RLS filters are now many-to-many with Roles.

* Updated documentation to reflect RLS filters supporting multiple rows.

* Let's see what happens when I set it to the previous revision ID

* Updated from upstream.

* There was a pylint error.

* Added RLS ids to the cache keys; modified documentation; added template processing to RLS filters.

* A new migration was merged in.

* Removed RLS cache key from query_object.

* RLS added to the cache_key from query_context.

* Changes as per @etr2460.

* Updating entry for RLS pull request.

* Another migration to skip.

* Changes as per @serenajiang.

* Blacked.

* Blacked and added some attributes to check for.

* Changed to a manual query as per @mistercrunch.

* Blacked.

* Another migration in the meantime.

* Black wanted some whitespace changes.

* AttributeError: 'AnonymousUserMixin' object has no attribute 'id'.

* Oops, did hasattr backwards.

* Changes as per @mistercrunch.

* Doesn't look like text us required here anymore.

* Changes as per @dpgaspar

* Two RLS tests.

* Row level security is now disabled by default via the feature flag ENABLE_ROW_LEVEL_SECURITY.

* New head to revise.

* Changed the comment.
2020-02-22 11:21:31 +02:00
Daniel Vaz Gaspar e55fe43ca6
[database] Fix, tables API endpoint (#9144) 2020-02-20 10:15:22 +00:00