Commit Graph

1293 Commits

Author SHA1 Message Date
Hugh A. Miles II c563ea091e
fix: flacky test in test_update_dataset_item_w_override_columns (#14082)
* fix flack test

* fix flack test
2021-04-12 16:45:50 -04:00
Lily Kuang 7980b767c0
feat: Implement Celery SoftTimeLimit handling (#13740)
* log soft time limit error

* lint

* update test
2021-04-12 13:18:17 -07:00
Sam Faber-Manning 911462a148
feat: only send alert error emails to owners of the alert (#13862)
* only send alert error emails to owners of the alert

* reformat long lines

* fix send to owners and add tests

* fix pylint errors

* fix formatting
2021-04-12 08:51:32 -07:00
Hugh A. Miles II a4fd6b8f33
fix: Use superset generic db to catch external_metadata queries (#13974) 2021-04-10 10:15:03 -04:00
Erik Ritter 3d357c661c
feat: handle chart/data API errors (#14040) 2021-04-09 09:39:02 -07:00
John Bodley a3b41e2bac
fix: Issue 13956 (#13980)
Co-authored-by: John Bodley <john.bodley@airbnb.com>
2021-04-09 15:21:58 +12:00
Beto Dealmeida c60a93db9c
feat: add extract_errors to Postgres (#13997)
* feat: add extract_errors to Postgres

* Add unit tests

* Fix lint

* Fix unit tests
2021-04-08 13:24:54 -07:00
AAfghahi b5e5b3aa62
feat: create backend routes and API for importing saved queries (#13893)
* initial commit

* revisions

* started tests

* added unit tests

* revisions

* tests passing

* fixed api test

* Update superset/queries/saved_queries/commands/importers/v1/utils.py

Co-authored-by: Hugh A. Miles II <hughmil3s@gmail.com>

* Revert "Update superset/queries/saved_queries/commands/importers/v1/utils.py"

This reverts commit 18580aad1e.

Co-authored-by: Hugh A. Miles II <hughmil3s@gmail.com>
2021-04-08 14:20:11 -04:00
Rob DiCiuccio 6a81a7961c
feat: Support feature flag overrides in ephemeral test envs (#14008)
* Add support for feature flag overrides in ephemeral env cmd

* update docs to reference correct config

* Update ephemeral env docs
2021-04-08 11:05:59 -07:00
Daniel Vaz Gaspar 89817d4cee
fix(alerts/reports): working timeout with celery kill and logic fix (#13911)
* fix: working timeout with celery kill and logic fix

* add config flags

* fix typo

* fix python lint

* log query time for alerts

* add tests

* fix lint
2021-04-08 11:23:31 +01:00
Beto Dealmeida a82d72fef6
feat: initial work to make v1 API compatible with SIP-40 and SIP-41 (#13960)
* WIP

* Use errorhandler

* Add response schema

* Fix status on HTTPException

* s/found/encountered/g

* Fix test

* Fix lint

* Fix lint and test
2021-04-06 22:06:32 -07:00
Beto Dealmeida 3b11654c5a
fix: import dataset/dashboard empty keys (#13979) 2021-04-06 20:55:15 -07:00
Phillip Kelley-Dotson 34991f5fab
fix(explore): strip semicolons in virtual table SQL (#13801)
* add method to strip semicolon

* address comments

* test the test

* Update tests/sqla_models_tests.py

Co-authored-by: Jesse Yang <jesse.yang@airbnb.com>

* Update tests/sqla_models_tests.py

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

* fix test

* add suggestion

* fix trailing space

* remove logger

* fix unit test

Co-authored-by: Jesse Yang <jesse.yang@airbnb.com>
Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
2021-04-06 13:40:34 -07:00
Hugh A. Miles II f291ba05c6
fix: SQL -> Explore Overwrite flow (#13946) 2021-04-05 14:52:04 -04:00
Jesse Yang 4789074309
fix(sqla-query): order by aggregations in Presto and Hive (#13739) 2021-04-01 18:10:17 -07:00
Lily Kuang 762101018b
feat(alert/report): add ALERTS_ATTACH_REPORTS feature flags + feature (#13894)
* Add a feature flag ALERTS_ATTACH_REPORTS

* update test

* update feature flag

* add comment for feature flag

* add unit tests for alerts with attachments disabled

* fix lint

Co-authored-by: samtfm <sam@preset.io>
2021-04-01 13:06:45 -07:00
Ben Reinhart ca506e9396
fix(#13378): Ensure g.user is set for impersonation (#13878) 2021-03-31 11:22:56 -07:00
Jack Fragassi 304e3b36eb
feat(alerts & reports): Easier to read execution logs (#13752)
* Prep for migration

* Migration for execution id column

* Generate execution ids for alerts and reports

* Change execution id range

* Add execution id to API endpoint

* Add execution id to execution log view

* Change execution id range

* Change execution id to a uuid

* Fix execution id type

* Switch state and exec. id columns

* Change db column to UUIDType

* Python lint

* Fix failing frontend tests

* execution_id -> uuid

* Fix migration head

* lint

* Use celery task id as the execution id

* lint

* lint for real

* Fix tests
2021-03-30 08:46:16 -07:00
Ben Reinhart 55ba47ec2e
fix(#13734): Properly escape special characters in CSV output (#13735)
* fix: Escape csv content during downloads

* Reuse CsvResponse object

* Use correct mimetype for csv responses

* Ensure that headers are also escaped

* Update escaping logic
2021-03-26 15:22:00 -07:00
Ville Brofeldt 5ae91e2dd8
feat(rls): enable row level security by default (#13772) 2021-03-26 17:40:41 +02:00
Elizabeth Thompson 086238fb10
feat: sort time grain configs (#13720)
* sort time grain configs

* Fix lint

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
2021-03-25 18:00:52 -07:00
Ville Brofeldt 13f7e0d755
feat(native-filters): add temporal support to select filter (#13622) 2021-03-18 16:15:43 +02:00
Lily Kuang 3f2e2c9976
fix(alert|report): allow null on chart and dashboard field (#13680)
* allow null on chart and dashboard field

* update api test
2021-03-18 09:17:50 +00:00
Beto Dealmeida db57f90a34
feat: better error message when adding DBs (#13601)
* WIP

* Adding tests

* Add unit tests

* Show error message

* Fix lint

* Fix after rebase
2021-03-17 20:29:26 -07:00
Jesse Yang bd1d6acb0c
fix(query): order by adhoc metrics should trigger group by (#13434)
* fix(query): properly select adhoc metrics in orderby

* Throw error when sql is empty

* Allow `metrics` to be None

* Always use alias in orderby for metrics

* Bump table chart version and migrate histogram to typescript

* Fix Histogram without groupby

* Fix Presto birth names test

* Raw records mode should not aggregate
2021-03-16 21:00:03 -07:00
ʈᵃᵢ 3078c84d40
feat(reports): SLACK_API_TOKEN as callable or str (#13634) 2021-03-16 10:06:29 -06:00
Daniel Vaz Gaspar 1e88408418
fix: better handle datasource exceptions (#13578)
* fix: handle datasource injected security exception

* add tests

* fix error text on create update dbs

* fix lint

* revert create update message

* fix test

* add sqlalchemy exceptions
2021-03-15 22:46:51 +00:00
Nikola Gigić 335415f5a2
dynamic dttm fix for test_convert_dttm (#13626) 2021-03-15 23:14:50 +02:00
Daniel Vaz Gaspar d1e93078f4
fix: delete dataset columns and metrics on the REST API (#13389)
* feat: delete dataset columns and metrics on the REST API

* fix openapi spec

* change delete comparison to id

* delete columns and metrics on their namespace

* add missing licenses

* add failed test

* address comment
2021-03-15 18:14:26 +00:00
Erik Ritter 06d6d7f8e2
fix: ParsedQuery subselect edge case (#13602) 2021-03-12 14:54:02 -08:00
Nikola Gigić 609c3594ef
feat(explore): Postgres datatype conversion (#13294)
* test

* unnecessary import

* fix lint

* changes

* fix lint

* changes

* changes

* changes

* changes

* answering comments & changes

* answering comments

* answering comments

* changes

* changes

* changes

* fix tests

* fix tests

* fix tests

* fix tests

* fix tests

* fix tests

* fix tests

* fix tests

* fix tests

* fix tests

* fix tests

* fix tests

* fix tests

* fix tests

* fix tests

* fix tests

* fix tests

* fix tests
2021-03-12 10:36:43 +02:00
David Aaron Suddjian 1b95ed7267
feat(dashboard): dashboard/id/datasets endpoint (#13523)
* feat(dashboard) dashboard/id/datasets endpoint

* schema for dashboard datasets

* list instead of map

* finish dashboard dataset schema

* description

* better test

* add the dataset schema to the schema list

* lint
2021-03-11 17:43:33 -08:00
Srini Kadamati bebac5921b
feat: add connector for CrateDB (#13152)
* feat: add connector for CrateDB

* added crate

* fix PyPI reference

* add tests

* added more clarity on installing crate

* fix test

Co-authored-by: Ville Brofeldt <ville.v.brofeldt@gmail.com>
2021-03-11 23:03:22 +02:00
Jesse Yang b9884fb55b
fix: `IS NULL` filter operator for numeric columns (#13496) 2021-03-10 10:15:25 -08:00
Ville Brofeldt 375797f649
feat(native-filters): add timegrain and column filter (#13484)
* feat(native-filters): add timegrain and column filter

* add fetch values predicate

* bump deps

* lint

* fix test

* add python test for legacy merge

* fix default value and isInitialized to not check strict equality

* Address comments

* add FilterValue type

* address review comments
2021-03-09 17:27:46 +02:00
Hugh A. Miles II c91c45574b
feat: add event_logger to test_connection and create_database commands (#13468)
Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
2021-03-09 08:17:13 -05:00
Daniel Vaz Gaspar 139c7878a5
fix(alerts&reports): add celery soft timeout support (#13436)
* fix(alerts&reports): add celery soft timeout support

* make a specific exception for screenshots timeout

* fix docs, add new test
2021-03-08 14:21:18 +00:00
Hugh A. Miles II b17e7aa5c9
feat: refactor on DBEventLogger to allow for context management (#13441)
Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
2021-03-05 15:12:42 -05:00
David Aaron Suddjian 491fbd16f7
fix(dashboard): Get dashboard by slug (#13352)
* refactor out id_or_slug filter logic

* fix(dashboard): accept slug in place of id in url

* remove unnecessary show fields

* fixes and tests

* linting

* linter compliance

* change requests

* names
2021-03-05 10:11:21 -08:00
Beto Dealmeida 9fc03f0424
fix: API to allow importing old exports (JSON/YAML) (#13444)
* fix: fix API to allow importing old exports (JSON/YAML)

* Fix test

* Fix lint

* Add description to API schema
2021-03-04 17:18:27 -08:00
Beto Dealmeida 528ea9cbb0
fix: SHOW is not DML (#13464)
* fix: SHOW is not DML

* Fix test
2021-03-04 17:17:25 -08:00
Daniel Vaz Gaspar c3c73763d0
fix: url shortener invalid input (#13461)
* fix: url shortner invalid input

* fix lint
2021-03-04 20:46:45 +00:00
Mayur 8b38d63b7d
changes added (#13431) 2021-03-03 13:52:54 +02:00
John Bodley 694ae6f90e
fix(query-object): extra time-range-endpoints (#13331)
Co-authored-by: John Bodley <john.bodley@airbnb.com>
2021-03-03 13:22:07 +13:00
Ville Brofeldt 70e12ed27d
chore: bump pyarrow and pandas (#12882)
* bump pyarrow and pandas

* remove df copy
2021-03-02 19:44:53 +02:00
Beto Dealmeida 08183dfe57
feat: add unit test for LimitMethod.FETCH_MANY (#13364) 2021-03-01 10:55:37 -08:00
Beto Dealmeida 892eef1af6
feat: add Firebird DB engine spec (#13353)
* feat: add Firebird DB engine spec

* Add dep to setup.py

* Fix lint

* Add tests

* Remove uneeded code

* Fix old bug
2021-02-26 12:07:27 -08:00
Yongjie Zhao 94d0bb9e7f
fix: date picker support date unit with singular and plural (#13330)
* fix: date picker support date unit with singular and plural

* fix grammar
2021-02-25 17:38:23 +08:00
Daniel Vaz Gaspar 0b114fcbc5
feat(reports): send notification on error with grace (#13135)
* fix: add config to disable dataset ownership on the old api

* fix CI docker build

* fix logic

* add deprecation comment on the config

* feat: send alerts reports errors to recipients

* update

* feat(reports): send notification on error with grace

* merge and revert config

* fix lint and MySQL test

* fix mysql tests
2021-02-24 13:31:31 -08:00
Ville Brofeldt 0a00153375
feat(chart-data): add rowcount, timegrain and column result types (#13271)
* feat(chart-data): add rowcount, timegrain and column result types

* break out actions from query_context

* rename module
2021-02-24 07:43:47 +02:00
Daniel Vaz Gaspar 6e3121268e
fix(alerts): Handle None on results (#13289) 2021-02-23 09:50:55 +00:00
Daniel Vaz Gaspar 9e2455aab7
refactor(api): csrf token on the new REST API (#13212)
* refactor(api): csrf token on the new REST API

* improve OpenAPI spec description

* fix test

* remove public role like has default for all tests

* fix test
2021-02-23 09:50:22 +00:00
Karol Kostrzewa a5a31e0e60
fix schedules tests (#12870)
Co-authored-by: Ville Brofeldt <ville.v.brofeldt@gmail.com>
2021-02-22 22:21:19 -08:00
Karol Kostrzewa 974f4476e5
fix reports/commands_tests (#12864)
Co-authored-by: Ville Brofeldt <ville.v.brofeldt@gmail.com>
2021-02-22 14:53:14 -08:00
Moriah Kreeger fc180ab2a6
fix: add alert report timeout limits (#12926)
* prevent working timeout and grace period from being set to negative numbers

* add extra validation

* lint

* fix black

* fix isort

* add js tests

* fix lint + more python schema validation

* add report schema test for timeout limits

* add extra test for null grace period
2021-02-22 11:12:10 -08:00
rijojoseph07 efeb5a93e6
feat(presto): add support for user impersonation (#13214)
* changes to support presto impersionation with ldap

* renamed method to match 30 char limit

* import spell check

* added presto impersonation test

* refactored impersionation code to generalize for extension

* moving config_args mutation to the update_connect_args_for_impersonation

* moving config_args mutation to the update_connect_args_for_impersonation

* nits

* refactored update_impersonation_config method name to match lint rule

* reduced comment line length

* black reformats

Co-authored-by: rijojoseph01 <rijo.joseph@myntra.com>
2021-02-22 15:01:33 +02:00
Lily Kuang d8bd8ec896
fix(alert/report): alert modal loading dropdown options (#13222)
* alert modal loading

* add ui test
2021-02-22 01:59:33 +00:00
Xiang Fu 786c12d52d
fix: Fixing pinot query generation for date format conversion from python datetime format to java simple date format (#13163)
* Fixing pinot query generation for date format conversion from python datetime format to java simple date format

* Address comments

* fix test

Co-authored-by: Ville Brofeldt <ville.v.brofeldt@gmail.com>
2021-02-20 08:26:34 +02:00
Beto Dealmeida 3d23adec5e
chore: use shillelagh instead of gsheetsdb (#13185)
* chore: use shillelagh instead of gsheetsdb

* Fix tests

* Clean up code and remove duplication

* Fix test

* Tighten dep
2021-02-18 09:48:18 -08:00
Daniel Vaz Gaspar 4c544500a7
fix(api): apply dashboard filter to get dash charts API (#13173)
* fix(api): apply dashboard filter to get dash charts API

* lint
2021-02-17 13:42:07 -08:00
Daniel Vaz Gaspar 13a5b439fe
feat(alerts): apply SQL limit to all alerts (#13150)
* feat(alerts): apply SQL limit to all alerts

* change limit to 2 and test

* undo mock

* mock, mock and mock

* lint
2021-02-17 18:03:35 +00:00
Daniel Vaz Gaspar 9568985b7b
fix: engines that don't support comments (#13153)
* fix: engines that don't support comments

* fix: engines that don't support comments

* add quick inexpensive test

* add test
2021-02-17 18:01:34 +00:00
Ville Brofeldt d8c32b8097
fix(chart-data-api): support numeric temporal columns (#13138) 2021-02-16 09:51:22 +02:00
David Aaron Suddjian cc9103b0e2
feat(dashboard): API to get a dashboard's charts (#12978)
* feat(dashboard): get endpoint for a dashboard's charts

* temporary debugging fetch on the frontend

* attempted fixes

* singular -> plural derp

* plural -> singular derp derp

* docstring changes

* change return, no id

* move log above query

* add get_charts to include_route_methods /)_-)

* add get charts api

* result not response

* refactor test helper function to a mixin

* add test for new endpoint

* fix test when running in isolation

* correct comment

* rename test

* more tests, handle dashboard not found

* simplify test to use new helper function

* remove debugging code from frontend

* update docstring

* attempt a doc fix

* add id to api docs

* fix docs

* use pytest fixture

* why oh why does test order matter here, idk

* writing a schema for the endpoint

* more efficient fetching of charts

* testing tweaks

Co-authored-by: Phillip Kelley-Dotson <pkelleydotson@yahoo.com>
2021-02-15 11:41:59 -08:00
Daniel Vaz Gaspar 2e6ea76631
fix(alerts): void query with numeric comparison (#13090)
* fix(alerts): void query with numeric comparison

* remove config changes

* fix tests

* better logic

* fix logic

* fix logic

* Improve test readability
2021-02-15 17:09:47 +00:00
Đặng Minh Dũng 2dbe92ba2f
feat: first step native support Trino (#13105)
* feat: add TrinoEngineSpec

Signed-off-by: Đặng Minh Dũng <dungdm93@live.com>

* feat: add trino into extras_require

Signed-off-by: Đặng Minh Dũng <dungdm93@live.com>

* test: add trino_tests.py

Signed-off-by: Đặng Minh Dũng <dungdm93@live.com>
2021-02-15 14:30:13 +02:00
Amit Miran 312cbf736c
feat(dashboard_rbac): add support for related roles (#13035) 2021-02-15 10:57:37 +02:00
simcha90 d6fc720f4c
feat(native-filters): Time native filter (#12992)
* Add Time Filter component

* Improve Time Filter component

* Fix import errors

* Display Time Filter

* Remove console logs

* Change Control Panel

* Remove unnecessary files

* Use time range override

* test: fix tests

* feat: re run pipeline

* fix: fix some case for Time filter

* fix: merge with master

* use original time range

* fix height

* add cross filter behavior

* apply filters on initialization

* add applied filter to overrides

* add unit tests for merge_extra_form_data

Co-authored-by: Agata Stawarz-Pastewska <agata.stawarz-pastewska@polidea.com>
Co-authored-by: Ville Brofeldt <ville.v.brofeldt@gmail.com>
2021-02-13 12:09:54 +02:00
Daniel Vaz Gaspar fa4c118e2d
fix: API tests, make them possible to run independently again (#13076)
* fix: API tests, possible to run independently

* fix workflow name
2021-02-11 18:19:41 +00:00
Daniel Vaz Gaspar b3a814fa27
feat(db engines): add support for Opendistro Elasticsearch (AWS ES) (#12602)
* feat(db engines): add support for Opendistro Elasticsearch (AWS ES)

* add time grains

* lint

* bump elasticsearch-dbapi version

* add tests

* fix test
2021-02-10 08:17:27 +00:00
Jesse Yang bbcb41149e
fix: time filter db migration optimization (#13015) 2021-02-09 10:49:50 -08:00
Amit Miran 8ccf2e8f1e
feat(dashboard_rbac): dashboards API support for roles create/update + roles validation (#12865) 2021-02-07 16:16:19 +02:00
Ville Brofeldt ac73991913
fix(viz): improve dtype inference logic (#12933) 2021-02-04 10:47:27 -08:00
Amit Miran b472d1841c
feat(dashboard_rbac): dashboard_view access enforcement (#12875)
* test: dashboard_view_test failing

* test: tests works first time

* fix: pre-commit and  some refactoring

* fix:  after CR

* fix:  replace not_published with draft

* fix:  after CR

* fix: pre-commit fixes

* fix: pre-commit and lint fixes

* fix: remove unused

* fix: remove unused import

* fix: wrap the decorator to not block others

* chore: reuse dashboard from decorator into function
2021-02-04 13:23:53 -05:00
Karol Kostrzewa 742d560636
test: speedup celery tests (#12885)
* speedup celery tests

* refactor wait for success
2021-02-03 13:37:02 -08:00
Amit Miran bc0198b405
chore(dashboard_rbac): remove overlapping security tests (#12848)
* chore: remove some security tests that already covered in the rbac and dataset tests

* revert: test is not overlapping
2021-02-03 19:28:42 +02:00
Jesse Yang 9fa52d3e21
fix(chart): allow null for most query object props (#12905) 2021-02-02 19:28:22 -08:00
Beto Dealmeida ab3f4bd94b
feat: add separate endpoint to fetch function names for autocomplete (#12840)
* WIP

* Add unit test for API

* Add spec

* Fix unit test

* Fix unit test

* Fix test

* Fix test

* Add period to error message
2021-02-02 18:01:01 -08:00
Daniel Vaz Gaspar 6c018c0a28
refactor: dbapi exception mapping for dbapi's (#12869)
* refactor: dbapi exception mapping for dbapi's

* fix test

* fix lint

* fix grammar on comment
2021-02-02 15:07:46 +00:00
Ricardo Gândara Pinto 51195af4fa
fix: Presto column_type_mappings time and timestamp (#12861)
* Fix presto column_type_mappings time and timestamp

* Added unit tests
2021-02-01 17:41:57 +02:00
Amit Miran 9a7fba810e
feat(dashboard-rbac): dashboard lists (#12680) 2021-01-31 09:17:46 +02:00
Jesse Yang e3db935c62
refactor: migrate table chart to new API (#10270)
* refactor: migrate table chart to new API

* chore: bump superset-ui to 0.17.0

* Fix Cypress tests

* Apply soft-conversion to numeric metrics

Fix time column formatting test

* Add translation to chart does not exist error

* Bump to 0.17.1
2021-01-29 13:12:09 +02:00
Duy Nguyen Hoang 32f2c45f93
fix(explore): preserve metric column order in bar chart (#12417)
* fix: Preserve Column Order in Bar chart

* Update tests/viz_tests.py to use f-strings style

Co-authored-by: Duy Nguyen <duy.nguyenhoang@global-fashion-group.com>
2021-01-28 10:39:00 +02:00
Daniel Vaz Gaspar 365770e7c3
feat: request ids on API related endpoints (#12663)
* feat: request ids on API related endpoints

* rename ids to include_ids
2021-01-27 20:24:49 +00:00
Rob DiCiuccio d7cbd53fce
fix(async queries): Remove "force" param on cached data retrieval (#12103)
* Async queries: remove force cache param on data retrieval

* Assert equal query_object cache keys

* Decouple etag_cache from permission checks

* Fix query_context test

* Use marshmallow EnumField for validation
2021-01-27 10:16:57 -08:00
Jesse Yang 55c8f9ba60
feat(explore): allow opening charts with missing dataset (#12705) 2021-01-25 15:09:03 -08:00
Karol Kostrzewa 8ccfdba672
test: oracle engine spec (#12615)
* test fetch_data, fix test_convert_dttm

* refactor test_convert_dttm
2021-01-25 09:49:58 -08:00
Karol Kostrzewa 0c32cf4244
test: hive db engine spec (#12520)
* add tests for upload_to_s3

* add fetch_data tests

* add test_create_table_from_csv_if_exists_fail

* add test_where_latest_partition

* fix app context

* test for where_latest_partition create_table_from_csv
2021-01-25 09:49:43 -08:00
Yongjie Zhao 9e58eb809e
fix(explore): deprecated x periods pattern in new time picker value (#12552) 2021-01-23 23:41:15 -08:00
Beto Dealmeida 4255c22d01
feat: add decorator to guard public APIs (#12635)
* feat: add decorator to guard public APIs

* Add unit tests

* Refactor to use unit tests

* Paramterize tests

* Remove decorator
2021-01-22 13:06:14 -08:00
Karol Kostrzewa f2b802978d
fix: bar chart data order (#12665)
* fix bar chart order

* fix test_explore_json_dist_bar_order

* fix quotes
2021-01-22 12:38:33 +02:00
Karol Kostrzewa e1db016a6c
test: presto engine spec tests (#12594)
* test get_table_names

* test _get_full_name

* add test_split_data_type

* test _show_columns

* add test_is_column_name_quoted

* test select_star

* test get_view_names

* test estimate_statement_cost

* test get_all_datasource_names

* test get_create_view

* test _extract_error_message

* fix typo
2021-01-21 12:53:54 -08:00
Karol Kostrzewa cdea1324f1
add test_convert_dttm (#12539) 2021-01-21 12:52:38 -08:00
Karol Kostrzewa 0de61df72f
test: sqlite db engine spec (#12616) 2021-01-21 09:34:48 +00:00
Jesse Yang c14ed80f28
refactor: rename DbColumnType to GenericDataType (#12617) 2021-01-20 10:07:42 -08:00
Duy Nguyen Hoang 77da4ada99
fix: error while parsing invalid json form_data (#12586)
* Fix error while parsing invalid json form_data

* Refine error returned
2021-01-19 16:15:16 +00:00
Ville Brofeldt 7e99d768af
feat(bigquery): implement custom minute time grains (#12581)
* feat(bigquery): implement custom minute time grains

* address review comment
2021-01-19 14:32:33 +02:00
Kasia Kucharczyk ad63823d6f
fix: Added message flash when chart with missing dataset is accessed. (#12468) 2021-01-18 22:42:03 -08:00
Karol Kostrzewa fc5e311842
test: /postgres engine spec test coverage (#12490)
* add tests for PostgresEngineSpec.estimate_statement_cost

* add tests for PostgresEngineSpec.query_cost_formatter

* fix docstring

* fix dependency

* fix raise SyntaxError
2021-01-15 16:50:37 +02:00
Karol Kostrzewa 5fbfb82266
add test_extract_error_message (#12548) 2021-01-15 16:46:27 +02:00
Xiang Fu 8f940aecca
Fixing Pinot queries for time granularities: WEEKS/MONTHS/QUARTERS/YEARS (#12536) 2021-01-15 11:05:31 +02:00
Karol Kostrzewa 241f380e2e
test: World bank examples (#12161)
* add world bank data fixture

* fix fixture cleanup, add fixture to dashboard_tests

* apply world bank fixtures, fix tests

* fix fixture typo, dashboard ids

* fix export dashboard metadata

* fix test_export_dashboard_command_key_order

* fix export dash tests, not add row when no orphans

* debug timeout

* fixes after merge

* fix lint

* run pre-commit

* comment test for debug

* fix save.test.js

Co-authored-by: Karol Kostrzewa <karol.kostrzewa@polidea.com>
2021-01-13 14:20:05 -08:00
Jesse Yang f8270b0b80
fix(dashboard): use datasource id from slice metadata (#12483) 2021-01-13 18:49:51 +02:00
Ville Brofeldt 40a334aacf
feat(db-engine-specs): add support for Postgres root cert (#11720)
* feat(db-engine-specs): add support for Postgres root cert

* remove logging of json decode exception message

* fix error message

* fix error message
2021-01-13 13:39:28 +02:00
Beto Dealmeida e47350ef96
fix: import ZIP files that have been modified (#12425)
* fix: import ZIP files that have been modified

* Add unit test
2021-01-12 12:56:26 -08:00
Yongjie Zhao 9b0e6d0cc0
refactor: from superset.utils.core break down date_parser (#12408) 2021-01-11 14:16:42 -08:00
Karol Kostrzewa 2ab490a101
test: birth names (#12226)
* add birth names fixture

* fix birth names related tests

* fix test_import_v0_dataset_cli_export columns order

* fix celery tests drop table

* fix mysql datetime type

* fix mysql typo in charts/api_tests

* refactor

* add licence

* fix use fixture for presto

* fix presto, hive query

* fix flaky metadata

* fix mysql bigint type

* fix run query

* fix hive datatype in metadata

* fix slice owner for cypress

* refactor num_boys num_girls

* fix is_dttm column

* debug logging

* fix query offset

* fix presto ds type in metadata

* fix presto ds type

* clean up debug logging
2021-01-11 05:57:55 -08:00
Jesse Yang 2210015aab
test: rename column names for birth_names dataset (#12082) 2021-01-08 14:13:20 -08:00
Daniel Vaz Gaspar c685c9ea8f
refactor: test connection raises only command exceptions (#12307)
* refactor: test connection raises only command exceptions

* fix tests

* fix tests

* fix tests

* lint fix
2021-01-08 13:10:11 +00:00
Beto Dealmeida 24fccdb2bc
fix: append orphan charts (#12320)
* fix: append orphan charts

* Add unit tests
2021-01-07 14:05:08 -08:00
Yongjie Zhao 9eb911dca3
fix(explore): refine previous calendar range (#12308) 2021-01-06 10:09:13 -08:00
Yongjie Zhao 1f8347228e
fix(explore): timepicker show human readable string in pill (#12300)
* fix(explore): timepicker show human readable string in pill

* fix lint
2021-01-06 22:37:35 +08:00
Amit Miran b221417e19
chore: remove harmless incubator refs (#12289)
* chore: migrate all harmless incubator refs like comments and documentation files

* chore: migrate all superset.incubator.apache.org to superset.apache.org to

* chore: migrate dist.apache.org refs

* chore: removing incubating and Disclaimer

* fix: linting issues
2021-01-06 13:45:19 +02:00
Karol Kostrzewa 1a2680d4a1
test: fix flaky Python unit tests (#12253) 2021-01-05 16:40:01 -08:00
Beto Dealmeida 164db3e5a1
fix: CTAS on multiple statements (#12188)
* WIP

* Add unit tests for sql_parse

* Add unit tests for sql_lab
2021-01-04 09:22:35 -08:00
Daniel Vaz Gaspar 74f3faf1cd
fix(reports): make name unique between alerts and reports (#12196)
* fix(reports): make name unique between alerts and reports

* add missing migration

* make it work for mySQL and PG only (yet)

* fixing sqlite crazy unique drop

* fixing sqlite missing one col
2020-12-24 09:18:46 +00:00
Daniel Vaz Gaspar 09a381da1d
fix(reports): notification without standalone link back to superset (#12174)
* fix(reports): notification without standalone link back to superset

* fix comment
2020-12-23 11:31:08 +00:00
Jesse Yang d2da25a621
refactor: remove queryFields in QueryObject and update chart control configs (#12091)
* Clean up queryFields

* Clean up unused vars

* Bump chart plugins

* Bringing changes in #12147
2020-12-22 17:10:19 -08:00
Beto Dealmeida ca680cf976
fix: append ID to filename when exporting chart (#12166) 2020-12-22 14:19:05 -08:00
Nikola Gigić a52031a55e
chore: Change chart_is_fav to chart_is_favorite (#12075)
* Change chart_is_fav to chart_is_favorite

* Trigger cypress tests

* Retrigger cypress tests

* Retrigger all tests

* Dashboard

* Additions
2020-12-22 10:03:26 -08:00
Beto Dealmeida c281e52f81
feat: add new dashboard with video game sales (#12162) 2020-12-22 08:53:18 -08:00
Daniel Vaz Gaspar 2f0add3aec
fix: database alpha permissions (#12136)
* fix: database alpha permissions

* add test
2020-12-21 19:17:58 +00:00
Daniel Vaz Gaspar 8d5dcc5784
fix(report): fix last_eval_dttm sort and more tests (#12121)
* fix(report): fix last_eval_dttm sort and more tests

* remove unnecessary permissions and split code path

* remove SIP_34_ALERTS_UI

* disabling an alert that is working will turn it to not triggered
2020-12-21 19:07:30 +00:00
David Aaron Suddjian 865beae3d8
feat(dashboard): Dashboard-Native Filters (#11814)
* wip: filter create modal

* add a feature flag

* automatic changes to package lock

* wip

* filter sidebar and basic state management

* move create button to the sidebar

* first step for edit filterconfig

* partially fix tests...

* edits to types and comments

* respect feature flag on the filter sidebar

* add filterconfig form

* get input state working

* feat: tree filter scopes UI

* fix: turn on flag

* sticky filter bar

* stop preferring default export

* feat: finish filter scoping

* fix: under toggle

* fix: title

* fix: add licence

* refactor: update TS

* fix: fix on reopen modal + validation

* new filter bar menu

* adding, but commenting out, bulk scoping action

* adding some placeholder buttons and styles therefor

* feat: add filter chart

* add relative path to package.json

* update modal

* a little input styling... just getting warmed up

* Revert "feat: add filter chart"

This reverts commit b1302d35b6.

* Revert "add relative path to package.json"

This reverts commit 26a7b40e18.

* https package lock idk

* feat: add filter chart

* add relative path to package.json

* flexboxes all the way down

* dynamically generate groupby and datasource in select control

* big wip

* fix target column name

* no importing nonexistent things

* styles and name editing

* Add hook for retrieval of all filter states

* start with a new filter when clicking add filter

* handle removed filters gracefully

* fix incorrect default filter configuration

* add fields to useAllFilterState

* add redux for filterconfigs

* add support for native_filters

* remove consoles

* improve filter removal

* unbreak infinite loop

* basic sidebar toggling working!

* collapsing and menu working more smoothly

* linting

* make dataset and column inputs work

* save filter values properly

* add dashboard event for filter updates

* guarded

* apply filters properly

* fix schema

* making New Filter button a link

* gridunits ftw

* centering modal

* tis not a button anymore! nixing type.

* plus and collapse buttons instead of "more" menu

* updating full size filter icons

* adding icons to filter collapsing/expanding

* turning off animation, but leaving class-based animation css

* fix linting error

* fix native filters for legacy charts

* updates test

* no individual apply buttons

* fix bugs with filter config modal

* remove redundant code

* switch to the filter with validation errors on submit

* separate form validation

* switch config button from add to edit

* update tests

* oops forgot to add the fancy new useChangeEffect hook

* comments and code reorganization

* rename native_filters to extr_form_data and move hook

* disable native filters in viz selector

* add cascading

* implement new extra form data api

* cleanup

* updates tests

* bump npm packages

* fix bad merge on package.json + lock

* lint

* replace in and not in with uppercase

* lint

* lint

* lint

* lint

* bulk test fix

* Sort select input alphabetically

* Change type for sorting elements

* fix rest of unit tests

* make filter operators all uppercase

* Hide Filter bar when there are no filters

* Show edit button for dashboard owners only

* Add visible argument to filters toggle function to avoid future regression

* Improve Toggle filters bar function

* lint

* fix js lint + set createNewOnOpen

* Handle setting extra form data in Filter Bar instead of Filter Control

* Add Handle apply filter function to Apply button

* Allow applying changes instantly

* Fix types

* remove console logs

* Add Error Boundary component to Filter bar and Filter Config Modal

* fix jest tests

* update native filters tests to pass

* reset cypress baseUrl

* remove unnecessary field

* cleanup: remove unused state fields

* move unrelated types to an appropriate location

* remove misplaced resource fetch error logic

* fix cascadeParentIds error

* fix cypress password

* initial attempt at fixing scope issue

* fix bad merge

* fix lint

* trying out makeApi for saving filters

* remove unused import

* fix test

* silence bad test

* add native-filter feat flag config

* oops fix here

* remove space

* Update superset-frontend/src/common/components/index.tsx

Co-authored-by: Evan Rusackas <evan@preset.io>

* Update superset-frontend/cypress-base/cypress/integration/dashboard/nativeFilters.test.ts

Co-authored-by: Evan Rusackas <evan@preset.io>

* use styledMount in tests

* comment

Co-authored-by: Evan Rusackas <evan@preset.io>

* Update superset-frontend/src/dashboard/components/nativeFilters/FilterBar.tsx

Co-authored-by: Evan Rusackas <evan@preset.io>

* Update superset-frontend/src/dashboard/components/nativeFilters/FilterConfigForm.tsx

Co-authored-by: Evan Rusackas <evan@preset.io>

* Update superset-frontend/src/dashboard/components/nativeFilters/FilterConfigModal.tsx

Co-authored-by: Evan Rusackas <evan@preset.io>

* Update superset-frontend/src/dashboard/components/nativeFilters/FilterConfigurationLink.tsx

Co-authored-by: Evan Rusackas <evan@preset.io>

* address PR feedback

* fix package lock

* null guards

* Fix charts resizing

* fix cypress tests

* add in nativefilters to form data

* fix lint and test

Co-authored-by: Phillip Kelley-Dotson <pkelleydotson@yahoo.com>
Co-authored-by: Simcha Shats <simcha.shats@nielsen.com>
Co-authored-by: amitNielsen <amit.miran@nielsen.com>
Co-authored-by: Ville Brofeldt <ville.v.brofeldt@gmail.com>
Co-authored-by: Evan Rusackas <evan@preset.io>
Co-authored-by: Agata Stawarz-Pastewska <agata.stawarz-pastewska@polidea.com>
Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
2020-12-18 17:06:37 -08:00
Ville Brofeldt 1a5f61b133
feat(chart-data-api): ignore unknown fields on QueryObject (#12118) 2020-12-18 14:32:55 +02:00
Beto Dealmeida 6e7f276775
feat: initial custom error messages for SQL Lab (#12080) 2020-12-17 22:58:21 -08:00
Yongjie Zhao b592cc7e73
feat(explore): time picker enhancement (#11418) 2020-12-17 18:27:21 -08:00
Daniel Vaz Gaspar 1a20552c2b
fix(reports): increase crontab size and alert fixes (#12056)
* fix(reports): increase crontab size

* update to current alembic revision

* Merge branch 'master' into feat/security-converge-datasets

# Conflicts:
#	tests/security_tests.py

* Merge branch 'master' into feat/security-converge-datasets

# Conflicts:
#	tests/security_tests.py

* Merge branch 'master' into feat/security-converge-datasets

# Conflicts:
#	tests/security_tests.py

* lint

* update alembic revision

* fix related fields

* fix test
2020-12-17 18:03:05 +00:00
Daniel Vaz Gaspar 5d9721e6ba
feat(queries): security perm simplification (#12072)
* feat(queries): security perm simplification

* fix mig

* update alembic down revision
2020-12-17 14:27:14 +00:00
Daniel Vaz Gaspar 790ac5ef87
feat(databases): security perm simplification (#12036)
* feat(databases): security perm simplification

* fix tests

* fix JS tests
2020-12-17 12:37:05 +00:00
Daniel Vaz Gaspar dd5cdb1b5f
feat(dashboards): security permissions simplification (#12012)
* feat(dashboards): security perm simplification

* fix tests

* fix tests

* remove unnecessary mapping

* fix JS tests

* fix cypress test and explore endpoint

* update alembic down revision

* Merge branch 'master' into feat/security-converge-dashboards

# Conflicts:
#	superset/constants.py
#	tests/security_tests.py
2020-12-17 09:53:13 +00:00
Kasia Kucharczyk 700dee6db6
feat(logs): security permissions simplification (#12061)
* Added migration for logs security converge

* Changed class permission name and method permission in LogModelView and LogRestApi

* Updated recent revision and filename

* Changed name of Log perm in manager. Updated TestRolePermission to have correct menu and permission.

* Updated latest migration revision

* Updated latest migration revision
2020-12-17 00:50:31 -08:00
Daniel Vaz Gaspar 2302adb61a
feat(datasets): security perm simplification (#12000)
* feat(datasets): security perm simplification

* feat(datasets): security perm simplification

* fix tests

* fix tests

* fix tests

* fix tests

* fix tests

* include SqlMetricInlineView converge and fix JS tests

* update to current alembic revision
2020-12-16 11:49:03 +00:00
Kasia Kucharczyk 9c8b65d03f
feat(annotations): security permissions simplification (#12014)
* Changed security permissions for annotations and annotation layers

* Updated permissions in annotation layers list

* Created test for retrieving premissions info. Updated uris from f-strings to strings

* Updated annotations in security_tests and added annotations to NEW_SECURITY_CONVERGE_VIEWS

* Added migration for annotations security converge

* Updated current revision after rebase master

* Updated migration name to annotations security converge

* Updated annotations permissions names in AnnotationLayersList and updated test since 'can_write' has wider permissions

* Updated annotations migration to current
2020-12-16 09:08:06 +00:00
Beto Dealmeida 8bda6b0bd9
feat: show missing parameters in query (#12049)
* feat: show missing parameters in query

* Fix lint

* Address comments

* Simplify error message

* Use f-string in helper function
2020-12-15 18:47:40 -08:00
Grace Guo 8da1900d8a
feat: add hook for dataset health check (#11970)
* feat: add hook for dataset health check

* add event log

* optimize datasource json data like certified data

* add unit test

* fix review comments

* extra code review comments
2020-12-15 18:12:06 -08:00
Jesse Yang 76f9f185fb
refactor: optimize backend log payload (#11927) 2020-12-15 17:22:23 -08:00
Daniel Vaz Gaspar f79e52f48e
feat(charts): security perm simplification (#11981)
* feat(charts): security perm simplification

* fix superset explore

* fix JS test

* fix cypress test

* fix split heads

* fix favorite permission

* fix permission

* update with new async permission

* fix new permission coming from master

* fix core permission assert

* black

* update alembic down revision
2020-12-15 11:27:06 +00:00
Daniel Vaz Gaspar 0f979dea06
feat(reports): security perm simplification (#11853)
* feat: security converge report

* black

* fix: comment

* add frontend changes and rebase

* fix multiple heads
2020-12-15 08:48:00 +00:00
Daniel Vaz Gaspar 20b1aa7d6c
fix(reports): apply owners security validation (#12035)
* fix(reports): apply owners security validation

* fix pylint
2020-12-15 08:43:31 +00:00
ʈᵃᵢ 6fcda5dac1
feat: add cron picker to AlertReportModal (#12032)
* humanize cron display in list view
2020-12-14 22:29:31 -08:00
Beto Dealmeida 45703a1dea
feat: update IDs when importing dashboards (#11991)
* feat: update IDs when importing dashboards

* Fix typos
2020-12-11 18:19:36 -08:00
Rob DiCiuccio 4d329071a1
feat(SIP-39): Async query support for charts (#11499)
* Generate JWT in Flask app

* Refactor chart data API query logic, add JWT validation and async worker

* Add redis stream implementation, refactoring

* Add chart data cache endpoint, refactor QueryContext caching

* Typing, linting, refactoring

* pytest fixes and openapi schema update

* Enforce caching be configured for async query init

* Async query processing for explore_json endpoint

* Add /api/v1/async_event endpoint

* Async frontend for dashboards [WIP]

* Chart async error message support, refactoring

* Abstract asyncEvent middleware

* Async chart loading for Explore

* Pylint fixes

* asyncEvent middleware -> TypeScript, JS linting

* Chart data API: enforce forced_cache, add tests

* Add tests for explore_json endpoints

* Add test for chart data cache enpoint (no login)

* Consolidate set_and_log_cache and add STORE_CACHE_KEYS_IN_METADATA_DB flag

* Add tests for tasks/async_queries and address PR comments

* Bypass non-JSON result formats for async queries

* Add tests for redux middleware

* Remove debug statement

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

* Skip force_cached if no queryObj

* SunburstViz: don't modify self.form_data

* Fix failing annotation test

* Resolve merge/lint issues

* Reduce polling delay

* Fix new getClientErrorObject reference

* Fix flakey unit tests

* /api/v1/async_event: increment redis stream ID, add tests

* PR feedback: refactoring, configuration

* Fixup: remove debugging

* Fix typescript errors due to redux upgrade

* Update UPDATING.md

* Fix failing py tests

* asyncEvent_spec.js -> asyncEvent_spec.ts

* Refactor flakey Python 3.7 mock assertions

* Fix another shared state issue in Py tests

* Use 'sub' claim in JWT for user_id

* Refactor async middleware config

* Fixup: restore FeatureFlag boolean type

Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
2020-12-10 20:21:56 -08:00
Beto Dealmeida 475f59cb1c
feat: confirm overwrite when importing (#11982)
* feat: confirm overwrite when importing

* Skip flaky test
2020-12-10 14:50:10 -08:00
Kasia Kucharczyk 4da47f1635
tests: added fixture with energy usage instead of example (#11308)
* Added energy usage fixture. Updated dashboard utils and unicode fixture with new method parameters.

* Add energy fixture to tests/access_tests.py

* Add energy fixture to tests/core_tests.py

* Add energy fixture to tests/dashboard_tests.py

* Add energy fixture to tests/datasets/api_tests.py

* Add energy fixture to tests/db_engine_specs/base_engine_spec_tests.py

* Add energy fixture to tests/import_export_tests.py

* Add energy fixture to tests/model_tests.py

* Add energy fixture to tests/query_context_tests.py

* Add energy fixture to tests/security_tests.py

* Add energy fixture to tests/charts/api_tests.py

* Changed formatting of slices' parameters in energy usage fixture

* Removed loading energy udage data from test conf file

* Add energy fixture to tests/databases/api_tests.py

* Fixes after review: removed isort:skip, load_charts->load_energy_charts, removed unused import.

* Added energy fixture to tests/charts/commands_tests.py and retrieving proper Slice by name

* Fixed charts/api_tests.py to use energy_usage from fixtures

* Fixed datasets/commands_tests.py to retrieve dataset by name and use energy_usage fixture

* Changed energy usage data to generated data and fixed chart tests which was checking energy usage data
2020-12-09 12:02:29 -08:00
Daniel Vaz Gaspar 1e3aaab590
fix(reports): validator_config, report state machine, working_timeout (#11890)
* fix(reports): expect more exceptions and fix validator config

* use a state pattern on command reports

* use a state pattern on command reports continue

* fix multiple heads

* fix unittests

* add more tests

* fix api tests after enum rename

* fix alembic multiple heads

* fix tests

* fix fixture cleanup

* fix mysql tests

* fix initial and not found state

* fix schema, and private public methods, addressing comments

* add new col to the API
2020-12-09 18:19:07 +00:00
Beto Dealmeida 33325f9fa6
feat: add modal to import charts (#11956)
* WIP

* Splat props
2020-12-07 18:33:59 -08:00
Beto Dealmeida 2b9695c520
feat: add modal to import databases (#11884)
* feat: add modal to import databases

* Fix test

* Improve hook

* Remove log and needless store.

* Change JS functions
2020-12-07 11:22:45 -08:00
Beto Dealmeida 66cd565bff
feat: add Postgres SQL validator (#11538)
* Add Postgres SQL validator

* Strip line number from message

* Add unit tests

* Run tests only with postgres backend

* Add dep

* Add dep to bashlib
2020-12-04 19:17:23 -08:00
Erik Ritter 77d362d306
fix: Remove expensive logs table migration (#11920) 2020-12-04 07:59:28 -08:00
Ville Brofeldt 327a2817d3
feat: add event and interval annotation support to chart data ep (#11665)
* feat: add event and interval annotation support to chart data ep

* add tests + refactor fixtures

* use chart dao
2020-12-04 14:40:31 +02:00
Beto Dealmeida e0288bf76b
chore: add unit tests for the current import functionality (#11786)
* chore: add unit tests for the current import functionality

* Improve comment

* Fix unit test
2020-12-03 14:48:43 -08:00
Bogdan 0396c705d4
chore: Support SET & SHOW commands as read only SQL commands (#11868)
* Support SET & SHOW commands as read only SQL commands

* Move is_readonly definition into the engine spec

* Rename & use super()

Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
2020-12-03 10:44:11 -08:00
Daniel Vaz Gaspar 71c567bf3a
feat(css templates): security perm simplification (#11856)
* feat: security converge css templates

* fix security tests

* fix JS test

* add migration

* black and fix migration
2020-12-03 08:45:32 +00:00
Lily Kuang a76eadd838
feat: report/alert list CRUD view (#11802) 2020-12-01 17:57:15 -08:00
Kasia Kucharczyk 462b39d762
fix: update chart doesn't remove all connections to dashboards (#11830)
* Added possibility to not change dashboards connection when chart is changed

* Added two chart unit tests which checks if dashboards properly change on update
2020-11-30 09:48:14 -08:00
Hugh A. Miles II 0689738e7c
feat: Sqllab to Explore UX improvements api changes (#11836) 2020-11-30 09:23:11 -08:00
Daniel Vaz Gaspar 9dd33d5566
feat(saved queries): security perm simplification (#11764)
* feat(saved queries): security perm simplification

* migration script and frontend

* add downgrade procedure

* downgrade procedure, inferred from the upgrade data

* fix JS test

* improve code

* add tests for role migration

* more tests and a short description for each one

* Improve readability

* simplify dataclass creation

* fix dataclass
2020-11-30 13:07:39 +00:00
Daniel Vaz Gaspar bac84a3aac
fix: delete chart, dashboards, dbs with assoc reports (#11801)
* fix: delete chart or dashboards with assoc reports

* database constraint to reports and tests

* add tests for dashboards and database

* fix exceptions default text
2020-11-26 08:45:49 +00:00
Beto Dealmeida c354e7e0ab
fix: remove root dir from ZIP bundle (#11805)
* fix: remove root dir from ZIP bundle

* Fix lint

* Fix tests

* Improve tests

* Fix dashboard as well
2020-11-25 11:47:48 -08:00
Daniel Vaz Gaspar f27ebc4be5
feat: new reports scheduler (#11711)
* feat(reports): scheduler and delivery system

* working version

* improvements and fix grace_period

* add tests and fix bugs

* fix report API test

* test MySQL test fail

* delete-orphans

* fix MySQL tests

* address comments

* lint
2020-11-25 08:50:30 +00:00
Beto Dealmeida 501b9d47c5
feat: API endpoint to import dashboards (#11751)
* ImportChartsCommand

* feat: add a command to import dashboards

* feat: API endpoint to import dashboards

* Add dispatcher

* Raise specific exception

* Fix test

* Remove print calls

* Add logging when passing
2020-11-24 22:45:35 -08:00
Erik Ritter c0224aa928
feat: add certification info to table selector (#11785) 2020-11-24 12:13:52 -08:00
Beto Dealmeida 25345bea64
feat: add a command to import dashboards (#11749)
* feat: add a command to import dashboards

* Fix lint

* Remove print()
2020-11-23 16:28:26 -08:00
ʈᵃᵢ fbe4a6622e
feat: SQL preview modal for Query History (#11634) 2020-11-20 16:01:06 -08:00
Beto Dealmeida a3a2a68f01
feat: API endpoint to import charts (#11744)
* ImportChartsCommand

* feat: API endpoint to import charts

* Add dispatcher

* Fix docstring
2020-11-20 14:40:27 -08:00
Beto Dealmeida 2f4f87795d
feat: add a command to import charts (#11743)
* ImportChartsCommand

* Fix type
2020-11-20 14:20:13 -08:00
Ville Brofeldt 7ae8cd07cc
fix: do not drop calculated column on metadata sync (#11731) 2020-11-18 08:33:14 -08:00
Beto Dealmeida cce716a821
feat: API endpoints to upload dataset/db (#11728)
* feat: API endpoints to upload dataset/db

* Fix method call
2020-11-17 14:49:33 -08:00
Rob DiCiuccio 01d15f5368
feat(templating): Safer Jinja template processing (#11704)
* Enable safer Jinja template processing

* Allow JINJA_CONTEXT_ADDONS with SAFE_JINJA_PROCESSING

* Make template processor initialization less magical, refactor classes

* Consolidat Jinja logic, remove config flag in favor of sane defaults

* Restore previous ENABLE_TEMPLATE_PROCESSING default

* Add recursive type checking, update tests

* remove erroneous config file

* Remove TableColumn models from template context

* pylint refactoring

* Add entry to UPDATING.md

* Resolve botched merge conflict

* Update docs on running single python test

* Refactor template context checking to support engine-specific methods
2020-11-17 11:55:47 -08:00
Beto Dealmeida 7bc353f8a8
feat: new import commands for dataset and databases (#11670)
* feat: commands for importing databases and datasets

* Refactor code
2020-11-16 17:11:20 -08:00
Bogdan a16a2b87c7
chore: statds metrics for cache invalidation (#11701)
* Add more logging to the cache invalidation

* Address linter & tests

* Fix linter

Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
2020-11-16 06:48:26 -08:00
Jesse Yang 4cfcaebb61
feat: rename TABLE_NAMES_CACHE_CONFIG to DATA_CACHE_CONFIG (#11509)
* feat: rename TABLE_NAMES_CACHE_CONFIG to DATA_CACHE_CONFIG

The corresponding cache will now also cache the query results.

* Slice use DATA_CACHE_CONFIG CACHE_DEFAULT_TIMEOUT

* Add test for default cache timeout

* rename FAR_FUTURE to ONE_YEAR_IN_SECS
2020-11-13 22:35:10 -08:00
Jesse Yang ec8ccd4cf1
feat: keep modal open when saving database failed (#11618) 2020-11-12 16:10:14 -08:00
ʈᵃᵢ 432e5ab460
feat: Query History CRUD list view (#11574) 2020-11-12 11:55:13 -10:00
Daniel Vaz Gaspar 12cb27f5cb
feat: new reports models api (#11606)
* feat: new report schedule models

* lint and unique constraint

* support sqlite

* fix sqlite

* add audit mixin and minor fixes

* feat(api): alerts and reports REST API

* feat: new report schedule models

* lint and unique constraint

* support sqlite

* fix sqlite

* add audit mixin and minor fixes

* feat(api): alerts and reports REST API

* draft working version

* add tests

* test

* black

* remove copy pasta

* solve dashboard object representation being used on cache

* tests and custom filter

* fix PUT has PATCH on active field

* create feature flag

* fix lint

* address comments
2020-11-12 13:21:01 -08:00
Grace Guo 0338b48fdd
fix (dashboard): remove default filters parameters in dashboard url (#11661) 2020-11-12 13:00:27 -08:00
Jesse Yang 542d2e3b06
chore: clean up a debug line from #11653 (#11663) 2020-11-12 08:37:49 -08:00
Ville Brofeldt 2718909314
feat: add ECharts BoxPlot chart (#11199)
* feat: add ECharts BoxPlot chart

* lint

* fix cypress tests

* lint

* remove viz.py shim

* bump plugin package

* skip non-legacy plugin cypress dashboard tests

* fix cypress tests

* disable cypress tests for non-leagcy charts

* fix bad rebase

* use midpoint interpolation for quartile calculation

* bump packages and add support for no groupby

* whitespace

* whitespace

* linting

* fix tests

* xit mathjs load test

* bump mathjs to 8.0.1

* disable cypress filter test for v1 charts
2020-11-12 10:01:04 +02:00
Jesse Yang 302c9603c4
fix: database connection validation when creation (#11653) 2020-11-12 08:00:38 +00:00
Beto Dealmeida 45738ffc1d
chore: consolidate datasource import logic (#11533)
* Consolidate dash import logic

* WIP

* Add license

* Fix lint

* Retrigger tests

* Fix lint
2020-11-11 22:04:16 -08:00
Beto Dealmeida 4a070cfceb
chore: consolidate dashboard import logic (#11529)
* Consolidate dash import logic

* Fix lint

* Remove Slice.import_obj

* Remove unused import

* Fix log
2020-11-11 14:50:18 -08:00
Ville Brofeldt 77dff0e4e0
fix(chart-data): ignore orderby on sample result type (#11656) 2020-11-11 16:27:56 +02:00
Beto Dealmeida 51712bf7ce
fix: CommandInvalidError had invalid init (#11635) 2020-11-10 07:41:03 -08:00
Ville Brofeldt 600a6fa92a
chore(rls): move to feature flag and disable related view (#11575)
* chore(rls): move to feature flag and disable related view

* rename feature flag
2020-11-05 12:19:48 +02:00
Lily Kuang eef4809978
feat: annotation edit modal with antd datepicker (#11500) 2020-11-03 12:59:13 -08:00
Daniel Vaz Gaspar 6f2e36dd1b
fix(tests): flaky test with dttm on Query API (#11526)
* fix(tests): flaky test wirh dttm on Query API
2020-11-03 09:01:17 +00:00
ʈᵃᵢ edb9619731
refactor: reduce number of api calls needed to fetch favorite status for charts and dashboards (#11502) 2020-11-02 21:26:14 -08:00
Beto Dealmeida fd10c47bc6
chore: remove sanitize (#11532)
* chore: remove sanitize

* Fix lint
2020-11-02 15:13:44 -08:00
Daniel Vaz Gaspar 34ae29e59b
feat: query REST API more fields and tests (#11482)
* feat: query REST API more fields and tests

* fix missing field
2020-10-31 10:18:34 +00:00
Moriah Kreeger 01ddbd0697
feat: annotation layers modal + filters (#11494) 2020-10-30 15:51:46 -07:00
Beto Dealmeida fbcfaacda3
feat: create base class for export commands (#11463)
* Add UUID to saved_query

* Reuse function from previous migration

* Point to new head

* feat: add backend to export saved queries using new format

* Rename ImportMixin to ImportExportMixin

* Create base class for exports

* Add saved queries as well

* Add constant, small fixes

* Fix wrong import

* Fix lint
2020-10-30 11:52:11 -07:00
Erik Ritter ca40877640
feat: add certifications to tables (#11450) 2020-10-30 11:28:01 -07:00
Beto Dealmeida 21f722c9bc
feat: add endpoint to export saved queries using new format (#11447)
* Add UUID to saved_query

* Reuse function from previous migration

* Point to new head

* feat: add backend to export saved queries using new format
2020-10-30 08:32:16 -07:00
John Bodley a8eb3fe8e7
chore: Cleaning up ENABLE_REACT_CRUD_VIEWS config (#11496)
Co-authored-by: John Bodley <john.bodley@airbnb.com>
2020-10-29 16:47:11 -07:00
ʈᵃᵢ f918ca14aa
fix(datasets): add custom filter for virtual datasets based on sql attribute (#11452) 2020-10-29 13:11:33 -07:00
David Aaron Suddjian 18658f45be
feat(dashboards): Filter status indicators (#10936)
* Initial commit of new filters badge.

* refactor applied/rejected filters code

* finished filter indicators

* filter badge tested

* unnecessary imports

* formatting and types

* fixes

* license

* code quality tweaks

* state management for showing focused filter scope

* clean up filter key extraction code

* remove unnecessary styles

* temp css to demonstrate highlighting

* fix focused filter logic

* no more color badges

* new toys for highlighting dash components (#11144)

* tweak style for the filter chart when filter is focused

* style: Filters p0 css2 (#11151)

* nixing background tweak

* src paths

* another quick theme color

* src paths, adjusting pill icon color, changing icons, showing applied/busted counts

* linting stuff

* fixing and tweaking tests

* show filter indicator when filters are not active

* chart title bar cleanup

* open the right panel when popover opens

* unused import

* fix EditableTitle tests

* margin on dashboard header

* show the chart dropdown menu

* fix blur filter breaking dropdowns

* style tweak - no pointer events when irrelevant charts are blurred

* fix box shadow on filter highlight

* it's an array

* attempt fixing e2e

* style: filters p0 icon churn (#11215)

* new filters icon

* icon styling

* bigger icons in list views

* better sizing of table actions and favStars

* more icon sizing...

* fixing more button size jankiness

* linting

* Filters performance (#11255)

* fixing time filter "ok" button

* making unset filter menu collapsible

* sort alphabetically

* fix highlighting when removing items

* try a flex layout (for browser render perf)

* more specific transitioning

* temp: comment out some code as a test

* temp: comment out more code

* temp: remove possibly expensive computations from ChartHolder

* Revert "temp: comment out some code as a test"

This reverts commit 309b880e90.

* Revert "temp: comment out more code"

This reverts commit 64c88b2cba.

* Revert "temp: remove possibly expensive computations from ChartHolder"

This reverts commit 37ce0214f0.

* experiment: upgrade react-select to v3

* Revert "experiment: upgrade react-select to v3"

This reverts commit c3972ba486.

* fix the damn problem

* remove code used for testing purposes

* awful hack to avoid adding a class to a container

* approaching infinity... and not beyond!

* fix ref forwarding

* add theme to tests as necessary

* fix(extra-filters): add logic for identifying applied extra filters (#11325)

* fix: use dashboard id for stable cache key (#11293)

* fix: button translations missing (#11187)

* button translations missing

* blank space before text

* feat: update time_compare description and choices (#11294)

* feat: update time_compare description and choices

* Update sections.jsx

* fix(extra-filters): add logic for identifying applied extra filters

* lint

Co-authored-by: Jesse Yang <jesse.yang@airbnb.com>
Co-authored-by: rubenSastre <ruben.sastre@decathlon.com>
Co-authored-by: Erik Ritter <erik.ritter@airbnb.com>

* address design feedback

* slight tweak to panel logic, keep panels open that user has opened

* rearrange code to be more graceful

* fix: bump superset-ui/core (#11385)

* use is_dttm instead of is_temporal

* types, names

* only show unset filter panel if there are unset filters

* fix highlighting the filter control

* fix filterbox layout

* translations

* fix cypress

* actually add the test attribute

* Update superset-frontend/src/dashboard/components/DashboardBuilder.jsx

Co-authored-by: Evan Rusackas <evan@preset.io>

* Update superset-frontend/src/dashboard/components/DashboardBuilder.jsx

Co-authored-by: Evan Rusackas <evan@preset.io>

* formatting

* add link comment to hack

* Update superset-frontend/src/dashboard/components/gridComponents/ChartHolder.jsx

Co-authored-by: Evan Rusackas <evan@preset.io>

* stop importing lodash

* Update superset-frontend/src/dashboard/components/gridComponents/ChartHolder.jsx

Co-authored-by: Evan Rusackas <evan@preset.io>

* Update superset-frontend/src/dashboard/components/FiltersBadge/Styles.tsx

Co-authored-by: Evan Rusackas <evan@preset.io>

* Update superset-frontend/src/dashboard/components/FiltersBadge/Styles.tsx

Co-authored-by: Evan Rusackas <evan@preset.io>

* Update superset-frontend/src/dashboard/components/FiltersBadge/Styles.tsx

Co-authored-by: Evan Rusackas <evan@preset.io>

* Update superset-frontend/src/dashboard/components/FiltersBadge/Styles.tsx

Co-authored-by: Evan Rusackas <evan@preset.io>

* skip broken test

* Update superset-frontend/src/dashboard/components/FiltersBadge/Styles.tsx

Co-authored-by: Evan Rusackas <evan@preset.io>

* Update superset-frontend/src/dashboard/components/FiltersBadge/Styles.tsx

Co-authored-by: Evan Rusackas <evan@preset.io>

* adjust colors of titles

* linting

* no indicators when chart is loading

* support all time fields

* fix lock file

Co-authored-by: Natalie Ruhe <natalie@preset.io>
Co-authored-by: Evan Rusackas <evan@preset.io>
Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
Co-authored-by: Jesse Yang <jesse.yang@airbnb.com>
Co-authored-by: rubenSastre <ruben.sastre@decathlon.com>
Co-authored-by: Erik Ritter <erik.ritter@airbnb.com>
Co-authored-by: Ville Brofeldt <ville.v.brofeldt@gmail.com>
2020-10-28 15:46:24 -07:00
Moriah Kreeger e9dba18466
feat: annotation layers CRUD list view (#11432) 2020-10-28 15:45:07 -07:00
Ville Brofeldt ecdff724ea
feat: enable metadata sync for virtual tables (#10645)
* feat: enable metadata sync for virtual tables

* add migration and check for empty schema name

* simplify request

* truncate trailing column attributes for MySQL

* add unit test

* use db_engine_spec func to truncate collation and charset

* Remove redundant migration

* add more tests

* address review comments and apply templating to query

* add todo for refactoring

* remove schema from tests

* check column datatype
2020-10-27 07:58:38 +02:00
Ville Brofeldt 8575439f48
fix: is_temporal should be overridden by is_dttm value (#11429) 2020-10-27 07:22:27 +02:00
Daniel Vaz Gaspar 144b279aa2
feat: saved queries with execution info (#11391)
* feat: add rows and last_run info to saved queries

* feat: add rows to saved query

* refactor and tests

* lint

* fix tests
2020-10-26 11:20:07 -07:00
Daniel Vaz Gaspar 6f69212f28
feat: annotations REST API (#11344)
* feat(api): annotations and layers CRUD REST API

* lint

* annotations API and tests

* fix openapi spec

* fix openapi spec

* fix openapi spec

* annotations bulk delete

* fix openapi spec

* fix older tests

* fix older tests

* small lint fixes

* layer_id to pk to keep broad coherence on openapi spec

* fix openapi spec

* one more test and validation

* fix test name

* fix test

* fix bulk delete

* add name validation

* annotation uniqueness validation

* lint

* add sorting reqs and tests

* add statsd metrics

* Update superset/annotation_layers/annotations/dao.py

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

* Update tests/core_tests.py

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

* address comments

* address my comment :)

* fix, address comments

* lint

Co-authored-by: riahk <moar.riah@gmail.com>
Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
2020-10-23 09:41:17 +01:00
Beto Dealmeida c81204aeef
feat: export dashboards as ZIP files (#11351)
* Export datasets as ZIP files

* Add logging when failing to parse extra

* Export datasets as ZIP files

* Export charts as Zip file

* Export dashboards as a Zip file

* Add logging
2020-10-22 20:02:40 -07:00
Beto Dealmeida 633355ab00
feat: export charts as ZIP files (#11349)
* Export datasets as ZIP files

* Add logging when failing to parse extra

* Export charts as Zip file

* Fix lint
2020-10-22 12:06:58 -07:00
Beto Dealmeida 00e394451f
feat: export datasets as ZIP files (#11332)
* Export datasets as ZIP files

* Add logging when failing to parse extra

* Fix logging
2020-10-22 10:32:08 -07:00
Daniel Vaz Gaspar b86f779dc1
feat: add statsd metrics to FAB rest API post, put and delete (#11362) 2020-10-22 08:56:26 +01:00
Moriah Kreeger a2a614d760
feat: CSS Templates List Actions (#11271) 2020-10-21 20:32:59 -07:00
Daniel Vaz Gaspar f14cf9d6dc
fix: saved_query search on schema and database not working (#11286)
* fix: saved_query search on schema and database not working

* add tests
2020-10-21 21:17:25 +01:00
Hugh A. Miles II dfbcbcce67
fix: Allow "EXPLAIN" queries when "Allow DML" setting is False (#11348)
Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
2020-10-21 12:58:57 -07:00
Maxime Beauchemin 796a2a6924
fix: error around latest partition in BigQuery (#11274)
* fix: error around latest partition in BigQuery

* lint

* Going with a backend-first approach

* fix test

* add an extra test
2020-10-20 21:34:46 -07:00
Lily Kuang 9f8d0e7a06
fix: update table_name and schema on dataset editor (#11218)
* fix dataset editor for updating table_name and schema

* update test

* remove table_name from restrict list

* fix pylint

* fix cypress test

* fix test
2020-10-20 09:38:57 -07:00
hnle 7369039713
tests: Parameterize some tests in alerts_tests.py (#11313)
* SO-1099 Parameterize some tests in alerts_tests.py

* Update alerts_tests.py

Remove commented out line

* Update alerts_tests.py

Reformatted using black
2020-10-19 23:05:04 -07:00
Kasia Kucharczyk 0e97c4f66c
tests: added fixtures to created dashboards and updated test with proper value (#11290)
* Added fixtures for hidden and published dashboards. Added fixture to restore copied dashboard in dashboard tests. Changed number of dashboards in datasets/api_tests.py because copied dashboard is removed.

* Changed number of dashboards in database api tests after cleanup of dashboards in dashboards_tests
2020-10-19 15:07:26 -07:00
Beto Dealmeida 94e23bfc82
feat: export databases as a ZIP bundle (#11229)
* Export databases as Zip file

* Fix tests

* Address comments

* Implement mulexport for database

* Fix lint

* Fix lint
2020-10-16 11:10:39 -07:00
Kasia Kucharczyk 9caf875263
Refactored api_tests in charts. Split filter test into several unit tests cases. Added table id based on database id (#11249) 2020-10-14 12:41:37 -07:00
Jesse Yang 634676d467
refactor: use contextmanager for event_logger decorators (#11222) 2020-10-14 10:44:06 -07:00
Yongjie Zhao 22d8171dd6
chore(engine): adapt postgres backend connection URI (#11233)
* chore(engine): adapt postgres backend connection URI

* fix tests

* Update superset/db_engine_specs/__init__.py

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

Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
2020-10-14 18:57:41 +03:00
Jesse Yang 2c649ac20f
perf: cache dashboard bootstrap data (#11234) 2020-10-13 18:43:06 -07:00
Grace Guo 4f4367edf3
feat: prevent co-edit dashboard collision (#11220)
* feat: prevent co-edit dashboard collision

* fix comments
2020-10-12 17:58:32 -07:00
Daniel Vaz Gaspar 9e9dac68f7
feat(datasets): REST API bulk delete (#11237)
* feat(datasets): REST API bulk delete

* doc HTTP 400
2020-10-12 13:40:05 +01:00
Ville Brofeldt 9f3d089655
chore(sqla): assert query is single read-only statement (#11236) 2020-10-12 15:11:43 +03:00
Bogdan cb3f649a7f
chore: simplify alerting data model to leverage a single class (#11179)
* Collapse alerting models into a single one

Fixing upgrade migration & tests

* Address feedback

Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
2020-10-09 19:20:12 -07:00
Kasia Kucharczyk 56d5e8a1cb
Changed cache uid to be depending on table in test_csv_response_format (#11214) 2020-10-09 09:01:26 -07:00
Kasia Kucharczyk d93b1afe79
test: test_cache_logging is not depending on other dashboard (#11213)
* Changed test_cache_logging to be idempotent and not depending on other data than tested one

* Changed cache uid to be depending on table, not datashource
2020-10-09 09:00:41 -07:00
Grace Guo a10e86ab31
fix: revert eTag cache feature for dashboard (#11203)
* revert #11137

* revert #10963
2020-10-08 12:15:08 -07:00
Beto Dealmeida b6728d87a0
fix: skip unit test that is failing in master for test-postgres-hive (#11196)
* Get full diff

* Test

* Test

* Test

* Test

* Test

* Explicitly detect backend to skip test
2020-10-08 09:17:09 -07:00
Daniel Vaz Gaspar 7c60939429
chore: turn SQL templating off by default (#11172)
* feat: possible to turn off SQL templating

* turn SQL templating off by default

* Update UPDATING.md

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

* fix missing PR number

* fix missing PR number

Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
2020-10-08 11:55:39 +01:00
Beto Dealmeida 9785667a0d
feat: add UUID column to ImportMixin (#11098)
* Add UUID column to ImportMixin

* Fix default value

* Fix lint

* Fix order of downgrade

* Add logging when downgrade fails

* Migrate position_json to contain UUIDs, and add schedule tables

* Save UUID when adding charts to dashboard

* Fix heads

* Rename migration file

* Fix dashboard serialization

* Fix migration script with Postgres

* Fix unique contraint name

* Handle UUID when exporting dashboard

* Fix Dataset PUT

* Add UUID JSON serialization

* Fix tests

* Simplify logic

* Try binary=True
2020-10-07 09:00:55 -07:00
Kasia Kucharczyk 32e174d4b8
test: removed unicode_test example from unit tests (#11131)
* Removed depemdency to unicode example in tests config.

* Added common methods for creating dashboards for tests.

* Added fixtures to all tests which were using unicode example.

* Added cleanup for unicode_test table

* Removed unnecessary fixture parts of unicode dashboard tests

* Parametrized creating slice for tests

* Moved fixtures for unicode test to separate file and refactored to several methods. Added param types and return types.

* Cleandup after fix

* Changed variable names to more readable

* Added cleanup for dashboards and slices

* Applied unicode fixture to charts api tests

* Update schema variable to dtype in dashboard utils

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

* Changed variable schema to dtype in dashboards. Replaced accessing first element with one_or_none

Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
2020-10-07 18:29:37 +03:00
Daniel Vaz Gaspar 4c85d33109
feat: custom favorite filter for dashboards, charts and saved queries (#11083)
* feat: custom favorite filter for dashboards

* lint and sort

* add favored for charts

* fix tests and lint

* more tests and saved query filter

* fix tests

* fix tests

* lint

* lint and fix conflict

* remove unnecessary prop

* separate tests
2020-10-01 15:08:40 -07:00
Daniel Vaz Gaspar fdb26f6131
feat: CRUD REST API for CSS Templates (#11114)
* feat: CSS Template CRUD API

* fix API docs

* fix copy pasta

* lint
2020-10-01 11:46:25 +01:00
Moriah Kreeger e7a4265c30
feat: saved query list actions (#11109) 2020-09-30 18:18:34 -07:00
Lily Kuang 5b284e67eb
feat: add created by chart CRUD view (#11067) 2020-09-30 13:53:04 -07:00
Ville Brofeldt ada66e30dd
fix(chart-data-api): ignore missing filters (#11112) 2020-09-30 09:34:23 +01:00
Bogdan 03eebd3019
fix: fix table existence validation function (#11066)
* Fix table existance validation function

* Drop left over table name index in mysql db

* Do not modify model

Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
2020-09-29 15:01:01 -07:00
Moriah Kreeger b8d616a9d2
feat: saved query list view + sort/filters (#11005) 2020-09-29 13:39:10 -07:00
Grace Guo 6633409a15
feat: enable ETag header for dashboard GET requests (#10963)
* feat: add etag for dashboard load requests

* fix review comments
2020-09-29 10:57:16 -07:00
Daniel Vaz Gaspar 5d08a426d3
fix(api): unable to delete virtual dataset, wrong permission name (#11019)
* fix(api): unable to delete virtual dataset because of wrong permission name

* Still delete the dataset even when no permission was found

* migration script to fix possible existing faulty permissions on the db

* black

* fix db migration and one more test

* add more comments to the migration script

* freeze a partial schema of the model on the migration step

* fix mig script

* Update superset/migrations/versions/3fbbc6e8d654_fix_data_access_permissions_for_virtual_.py

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

Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
2020-09-29 12:33:07 +01:00
Ville Brofeldt 80e395559d
fix: echarts timeseries groupby (#11103)
* fix: echarts timeseries groupby

* address review comment
2020-09-29 14:25:38 +03:00
Lily Kuang e337355162
refactor: table selector on dataset editor (#10914)
Co-authored-by: Maxime Beauchemin <maximebeauchemin@gmail.com>
2020-09-28 11:16:03 -07:00
ʈᵃᵢ 1dc05d4c12
feat(charts): modify custom api filter to include more fields (#11054) 2020-09-28 10:18:34 -07:00
Lily Kuang ea105bc23b
feat: add "created by" to dashboard CRUD view (#11030) 2020-09-24 14:33:55 -07:00
ʈᵃᵢ eded51b2f8
feat(saved_queries): add custom api filter for all string & text fields (#11031) 2020-09-24 11:05:25 -07:00
Bogdan b2fdf12f62
Support jinja templates (#11008)
Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
2020-09-24 10:29:44 -07:00
Ville Brofeldt a9eab33d64
feat: add ECharts Pie chart (#10966)
* feat: introduce echarts pie chart

* lint

* remove viz.py shim

* remove tests

* fix cypress test

* fix test
2020-09-22 19:27:40 +03:00
Ville Brofeldt bd140e018a
fix(presto): default unknown types to string type (#10753)
* fix(presto): default unknown types to string type

* lint
2020-09-22 13:16:54 +03:00
Ville Brofeldt 448a41a4e7
feat(row-level-security): add base filter type and filter grouping (#10946)
* feat(row-level-security): add filter type and group key

* simplify tests and add custom list widget

* address comments

* use enum value to ensure case sensitive value is used
2020-09-22 08:54:10 +03:00
Bogdan 56d001835e
fix: use nullpool even for user lookup in the celery (#10938)
* Use nullpool even for user lookup in the celery

* Address feedback

Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
2020-09-21 10:34:03 -07:00
Bogdan 801fb4063c
Allow empty observations in alerting (#10939)
Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
2020-09-21 08:48:02 -07:00
Daniel Vaz Gaspar e375ed4678
fix(jinja): make context attrs private on SQL templates (#10934)
* fix(jinja): make SQLAlchemy models private on SQL templates

* add missing privates

* fix test
2020-09-18 12:56:07 +01:00
Bogdan c3f1720456
fix: superset alerting misc fixes (#10891)
* Superset alerting misc fixes

* Test 0 threshold

Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
2020-09-16 11:09:11 -07:00
John Bodley b48dd4b7d9
chore: Using cache factory method (#10887)
Co-authored-by: John Bodley <john.bodley@airbnb.com>
2020-09-15 12:48:19 -07:00
Bogdan 9c420d6efe
feat: implement cache invalidation api (#10761)
* Add cache endpoints

* Implement cache endpoint

* Tests and address feedback

* Set cache config

* Address feedback

* Expose only invalidate endpoint

Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
2020-09-15 11:17:21 -07:00
Yongjie Zhao 38edb69d95
Feat: Adding table comment and columns comment for SQLLab (#10844)
* Adding table comment and columns comment for backend

* fix mypy

* Fix CI

* adding wider catch

* use logger

* fix lint
2020-09-14 21:11:48 -07:00
Daniel Vaz Gaspar 7b2200437e
fix(test): missing auth on tests (#10842)
* fix(test): missing auth on tests

* fix mock

* make test login more inline with other tests
2020-09-11 14:28:41 +01:00
Daniel Vaz Gaspar 136f90f87c
feat: SavedQuery REST API for bulk delete and new API fields (#10793)
* feat: SavedQuery REST API for bulk delete

* fix, singular msg and test

* remove 403 from OpenAPI spec

* filter by current user using created_by add sql_tables field

* fixes for new filter, add user field on pre_update, pre_add

* add lru cache to property

* Revert "add lru cache to property"

This reverts commit ad0d9428
2020-09-11 09:36:47 +01:00
Lily Kuang f0545bfe50
fix(databases): test connection api endpoint (#10824)
* fix test connection with extra

* fix lint and allow_none server_cert

* update test connection tests
2020-09-10 21:49:14 +01:00
Bogdan ac2937a6c5
fix: use nullpool in the celery workers (#10819)
* Use nullpool in the celery workers

* Address comments

Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
2020-09-10 13:29:57 -07:00
Daniel Vaz Gaspar e6a4808cb7
fix(tests): export dataset tests fails with presto (#10818)
* fix(tests): export dataset tests fails with presto

* debug

* debug

* skip dataset export test on presto

* add TODO on failing test
2020-09-09 21:46:28 -07:00
Lily Kuang 8a3ac70c06
feat(databases): test connection api (#10723)
* test connection api on databases

* update test connection tests

* update database api test and open api description

* moved test connection to commands

* update error message

* fix isort

* fix mypy

* fix black

* fix mypy pre commit
2020-09-09 13:37:48 -07:00
ʈᵃᵢ 50672bb11b
feat: database delete warning (#10800) 2020-09-08 18:54:02 -07:00
Ville Brofeldt 3ae80d3b98
test: add rls jinja extra cache key test (#10810) 2020-09-08 07:42:48 +03:00
Daniel Vaz Gaspar 5199423ad1
feat: CRUD REST API for saved queries (#10777)
* feat: CRUD REST API for saved queries

* debug test

* fix test

* use pytest fixtures
2020-09-03 15:46:27 -07:00
Ville Brofeldt 70c6764780
fix: pivot table timestamp grouping (#10774)
* fix: pivot table timestamp grouping

* address comments
2020-09-03 19:49:54 +03:00
Jason Davis 54ae3b044f
fix: add validator information to email/slack alerts (#10762)
* added validator info to alerts

* adjusted format of messages

* added nits

Co-authored-by: Jason Davis <@dropbox.com>
2020-09-03 08:15:05 -07:00
John Bodley 1ee87cc4d1
fix: dashboard extra filters (#10692)
Co-authored-by: John Bodley <john.bodley@airbnb.com>
2020-09-02 16:03:25 -07:00
ʈᵃᵢ 7bccb38a60
feat: SIP-34 table list view for databases (#10705) 2020-09-02 11:48:21 -07:00
ʈᵃᵢ 5a4370012b
refactor: convert DatasetList schema filter to use new distinct api (#10746) 2020-09-02 11:07:37 -07:00
Daniel Vaz Gaspar 77a3167412
feat(database): POST, PUT, DELETE API endpoints (#10741)
* feat(database): POST, PUT, DELETE API endpoints

* post tests

* more tests

* lint

* lint

* debug ci

* fix test

* fix test

* fix test

* fix test

* fix test

* fix test

* cleanup

* handle db connection failures

* lint

* skip hive and presto for connection fail test

* fix typo
2020-09-02 09:58:08 -07:00
Jason Davis b59f6b1833
feat: refractored SQL-based alerting framework (#10605)
* added new tables for alerting refractor

* reformatted inheritance structure

* added workflow for updated framework

* added suggested changes

* cleaned up changes

* added obervations to alert table to enable view

* added comments

* added requested changes

* fix tests

* added styling changes

* mypy

* added requested changes

* updated operator logic

* requested changes, 1 validator, styling changes

* refactored tests

* fix test alert workflow

* fixed create_alert in test

Co-authored-by: Jason Davis <@dropbox.com>
2020-09-01 13:36:02 -07:00
Bogdan 4572ebb600
chore: log cache keys to the logs (#10678)
* Log cache keys to the logs

* Add tests

* Use separate table for the cache keys

* Add migration for the cache lookup table

Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
2020-09-01 09:41:25 -07:00
Maxime Beauchemin 3d8857ecc8
style: rename 'Source' top nav item to 'Data' (#10715)
* style: rename 'Source' top nav item to 'Data'

* Fix tests

* tables -> datasets

* rename datasource -> dataset

* lint

* more renaming

* use npm ci
2020-08-29 18:09:47 -07:00
Bogdan 33fa9ebff1
Covert celery tests to the pytest (#10704)
Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
2020-08-28 17:04:30 -07:00
Ville Brofeldt 58b075bc17
fix(jinja): extract form_data from json body (#10684)
* fix(jinja): extract form_data from json body

* add test

* disable test for presto
2020-08-28 21:26:07 +03:00
Daniel Vaz Gaspar 3e374dab07
fix: change public role like gamma procedure (#10674)
* fix: change public role like gamma procedure

* lint and updating UPDATING with breaking change

* fix updating text

* add test and support PUBLIC_ROLE_LIKE_GAMMA

* fix, cleanup tests

* fix, new test

* fix, public default

* Update superset/config.py

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

* add simple public welcome page

Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
2020-08-28 10:49:10 +01:00
Bogdan 6ed36552e6
Use test name for the custom macros testing: (#10695)
:

Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
2020-08-27 13:12:24 -07:00
Bogdan 19a9bcc9c5
chore: ci Initial hive support (#10593)
* Initial hive support

* Clone hive setup

* Make hive tests work locally

* Debugging presto failure

* sleep in dataset test

* Address comments

* Address comments

* Pin ipython, exclude new pylint rules

Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
2020-08-27 09:49:18 -07:00
Lily Kuang bb92c1f84d
feat: chart and dashboard card list view e2e cypress test (#10669)
* card view cypress tests

* update test config

* chart filter cypress test

* move setting to superset test config

* update test description card view
2020-08-27 09:38:12 -07:00
John Bodley 502f4db6f9
feature: Adding extra_filters to warm_up_cache (#10675)
Co-authored-by: John Bodley <john.bodley@airbnb.com>
2020-08-25 15:19:34 -07:00
Ville Brofeldt 9461f9c1e0
fix(db_engine_specs): improve Presto column type matching (#10658)
* fix: improve Presto column type matching

* add optional callback to type map and add tests

* lint

* change private to public
2020-08-24 22:42:07 +03:00
Ville Brofeldt 0177c2f591
fix(db_engine_specs): mysql longtext type should not be numeric (#10661) 2020-08-24 21:24:43 +03:00
Daniel Vaz Gaspar 692266f4f5
feat: dataset REST API for distinct values (#10595)
* feat: dataset REST API for distinct values

* add tests and fix lint

* fix mypy, and tests

* fix docs

* fix test

* lint

* fix test
2020-08-17 15:46:59 +01:00
Ville Brofeldt acb00f509c
fix(chart-data-api): assert referenced columns are present in datasource (#10451)
* fix(chart-data-api): assert requested columns are present in datasource

* add filter tests

* add column_names to AnnotationDatasource

* add assertion for simple metrics

* lint
2020-08-14 20:58:24 +03:00
Ville Brofeldt c0ebd7f434
fix: show error if rolling window returns empty df (#10572)
* fix: show error if rolling window returns empty df

* add test
2020-08-13 20:51:03 +03:00
Daniel Vaz Gaspar 11da6ee812
fix: dataset delete and perm delete (#10578) 2020-08-13 10:18:13 +01:00
Craig Rueda 2aaa4d92d9
chore: Migrating reports to AuthWebdriverProxy (#10567)
* Migrating reports to AuthWebdriverProxy

* Extracting out webdriver proxy / Adding thumbnail tests to CI

* Adding license

* Adding license again

* Empty commit

* Adding thumbnail tests to CI

* Switching thumbnail test to Postgres

* Linting

* Adding mypy:ignore / removing thumbnail tests from CI

* Putting ignore statement back

* Updating docs

* First cut at authprovider

* First cut at authprovider mostly working - still needs more tests

* Auth provider tests added

* Linting

* Linting again...

* Linting again...

* Busting CI cache

* Reverting workflow change

* Fixing dataclasses

* Reverting back to master

* linting?

* Reverting installation.rst

* Reverting package-lock.json

* Addressing feedback

* Blacking

* Lazy logging strings

* UPDATING.md note
2020-08-12 13:28:41 -07:00
Ville Brofeldt 85c0cad816
fix: add None checking to cast_to_num (#10584)
* fix: add None checking to cast_to_num

* fix doctest
2020-08-12 19:58:14 +03:00
Jason Davis c0bb86d0d6
feat: slack integration for SQL-based alerts (#10566)
* add slack functionality

* deleted unused variable

* updated test

* black

* fix rebase

* added nits

* added slack no screenshot integration

* isort

* added namedtuple for screenshot

* added test

* fix precommit

Co-authored-by: Jason Davis <@dropbox.com>
2020-08-11 11:15:31 -07:00
Bogdan 0071d374da
chore: move load examples to the fixture (#10545)
* Move load examples to the fixture

* Update tests/celery_tests.py

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

* Address feedback

Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
2020-08-10 13:20:19 -07:00
Bogdan 101e5b670b
chore: clean up csv tests (#10556)
* Clean up csv tests

* Update tests/base_tests.py

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

* Update tests/base_tests.py

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

* import optional

* Fix mypy error

Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
2020-08-10 11:22:38 -07:00
Jason Davis 8b9292ed05
fix: add retry to SQL-based alerting celery task (#10542)
* added retry and minimized sqlalchemy object lives

* pylint

* added try catch

* adjusted naming

* added scoped session

* update tests for dbsession

* added requested changes

* nit todo

Co-authored-by: Jason Davis <@dropbox.com>
2020-08-10 10:20:43 -07:00
Ville Brofeldt 08358d623b
fix: handle query exceptions gracefully (#10548)
* fix: handle query exceptions gracefully

* add more recasts

* add test

* disable test for presto

* switch to SQLA error
2020-08-07 17:37:40 +03:00
Ville Brofeldt 363abfa1a5
fix: remove unnecessary exception when exploring non-legacy viz plugins (#10538)
* fix: remove unnecessary exception when exploring non-legacy viz plugins

* lint
2020-08-07 08:41:39 +03:00
Erik Ritter fd2d1c58c5
Revert "chore: Cleanup database sessions (#10427)" (#10537)
This reverts commit 7645fc85c3.
2020-08-06 15:33:48 -07:00
Bogdan 62b873e3da
feat: welcome presto to the suite of tested databases (#10498)
* Add presto to the CI

Sample test data

Datetime conversion

Sample test data

Fix tests

* TODO to switch to timestamps

* Address feedback

* Update requirements

* Add TODOs

Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
2020-08-06 12:07:22 -07:00
Jason Davis 9c5b0e1c86
fix: refactored SQL-based alerts to not pass sqlalchemy objects as args (#10506)
* refractored alerting to not pass sqlalchemy obj as args

* updated to pass only alert id as arg

* used object id instead of argument

* updated alerts_tests.py to reflect change

Co-authored-by: Jason Davis <@dropbox.com>
2020-08-04 09:52:32 -07:00
Bogdan ab404ea2cf
Sample test data (#10487)
Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
2020-08-03 09:08:49 -07:00
Jesse Yang ce10e13ec3
test: schedules test refactor (#10492) 2020-07-31 12:05:39 -07:00
Ville Brofeldt 9d9c34835a
fix: support non-string groupbys for pie chart (#10493)
* chore: add unit tests to pie chart

* refine logic for floats and nans and add more tests
2020-07-31 11:19:21 +03:00
John Bodley 7645fc85c3
chore: Cleanup database sessions (#10427)
Co-authored-by: John Bodley <john.bodley@airbnb.com>
2020-07-30 23:07:56 -07:00
Jesse Yang 7ff1757448
build: optimize GitHub Actions for building speed and stability (#10485) 2020-07-30 22:28:56 -07:00
Jason Davis 7a329c25e9
feat: add test email functionality to SQL-based email alerts (#10476)
* added test email functionality

* formatting changes

* more formatting

* applied requested changes

* mypy

Co-authored-by: Jason Davis <@dropbox.com>
2020-07-30 13:27:22 -07:00
Hossein Torabi 259a344fd1
test: upload excel (#10467) 2020-07-29 12:50:39 -07:00
ʈᵃᵢ 78cad9a4a8
refactor(listviews): use correct filter endpoints for charts and datasets (#10442) 2020-07-29 11:00:19 -07:00
Daniel Vaz Gaspar 671461d0d0
feat(api): database schemas migration to new API (#10436)
* fix(log): log crashes if expired or not authenticated

* fix lint and rison

* add tests

* more tests

* perm fix

* fix test not found

* JS lint

* fix Jest test
2020-07-29 09:33:15 +01:00
Jason Davis d065633c81
fix: Implement updates to SQL-based email alerts (#10454)
* implemented updates to alerting

* fixed imports and teardown

* changed unittest to pytest conventions

* add app_context to tests

Co-authored-by: Jason Davis <@dropbox.com>
2020-07-28 16:48:42 -07:00
Beto Dealmeida 4f678272d6
fix(presto): Handle ROW data stored as string (#10456)
* Handle ROW data stored as string

* Use destringify

* Fix mypy

* Fix mypy with cast

* Bypass pylint
2020-07-28 16:05:58 -07:00
Ville Brofeldt fc28c92f57
feat: support non-numeric columns in pivot table (#10389)
* fix: support non-numeric columns in pivot table

* bump package and add unit tests

* mypy
2020-07-28 10:40:53 +03:00
ʈᵃᵢ 6f56cd5e9d
feat(listviews): SIP-34 filters for charts, dashboards, datasets (#10335) 2020-07-27 10:14:11 -07:00
Daniel Vaz Gaspar 562012c586
fix(permissions): alpha role has all full features (#10241)
* fix(permissions): alpha role is inconsistent

* reverse and allow Alpha to access manager menu

* Bump FAB to 3.0.1rc1 to include del permission fix

* add docs, tests and UPDATING

* EOL

* Fix query view for Alpha
2020-07-27 10:32:30 +01:00
Ville Brofeldt 5b6ff4944c
fix: incorrect filter operator emitted by Filter Box (#10421)
* fix: equals operator in filter box

* fix time range endpoint schema

* fix test

* bump packages

* fix tests

* lint
2020-07-26 12:40:03 +03:00
Daniel Vaz Gaspar 2fd37b18e3
fix(api): fixes perf on charts and introduces sorting by database on datasets (#10392) 2020-07-23 11:19:05 -07:00
Daniel Vaz Gaspar 98a11e7cf2
fix(api): fixes openapi spec errors and adds a test to validate all spec (#10393) 2020-07-23 10:43:41 +01:00
Daniel Vaz Gaspar 961108625e
fix(datasets): sort and humanized modified by (#10380)
* fix(datasets): sort and humanized modified by

* size xl on changed_on_delta_humanized

* Fix, tests

* Fix, tests

* Fix, frontend tests

* remove debug flag
2020-07-22 11:34:47 +01:00
Maxime Beauchemin 85169f2f1c
chore: remove QueryView (ModelView) (#10162)
* chore: deprecate QueryView (ModelView)

* lint

* fix unit tests
2020-07-21 09:14:15 -07:00
Erik Ritter 5fa4680447
feat: update timeout error UX (#10274) 2020-07-20 15:32:17 -07:00
Bogdan 7075c2ff69
Pin slack client, breaking change (#10345)
Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
2020-07-20 09:20:05 -07:00
Ville Brofeldt 7af8b2b3f8
feat: add optional prophet forecasting functionality to chart data api (#10324)
* feat: add prophet post processing operation

* add tests

* lint

* whitespace

* remove whitespace

* address comments

* add note to UPDATING.md
2020-07-20 18:46:51 +03:00
bryanck 73797b8b64
check for empty dataframes before processing results (#10361)
Co-authored-by: Bryan Keller <bkeller@netflix.com>
2020-07-19 17:19:30 +03:00
Daniel Vaz Gaspar 74cb82e1ad
fix: humanised changed on UTC on dashboards and charts (#10321)
* fix: API marshmallow3 drop utc for naive datetime fields

* fix: API marshmallow3 drop utc for naive datetime fields

* fix, tests

* isort and test

* black

* add and fix test

* fix comment
2020-07-15 19:09:32 +01:00
Ville Brofeldt ac85aebe4a
chore: prefer allow/deny terminology (#10320)
* chore: prefer allow/deny terminology

* fix tests

* add PR reference
2020-07-15 19:22:46 +03:00
Ville Brofeldt 42b6347fca
fix: fix csv and query result type and QueryObject schema (#10312) 2020-07-14 16:37:19 +03:00
Ville Brofeldt c44ee06b5d
fix(chart-data-api): improve chart data endpoint errors (#10300)
* fix: improve chart data error response

* Populate error_message in QueryResult

* add tests

* Lint + fix incorrect raise

* add more tests
2020-07-14 12:40:00 +03:00
Bogdan 7abe3e5182
Add more fields to the log API (#10271)
Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
2020-07-13 18:06:33 -07:00
Ville Brofeldt b316f723a1
fix(chart-data-api): case insensitive evaluation of filter op (#10299)
* fix(chart-data-api): case insensitive evaluation of filter op

* fix(chart-data-api): case insensitive evaluation of filter op

* mypy

* remove print statement

* add test
2020-07-13 17:21:02 +03:00
Ville Brofeldt 14260f9843
feat: add contribution operation and fix cache_key bug (#10286)
* feat: add contribution operation and fix cache_key_bug

* Add contribution schema
2020-07-10 17:06:05 +03:00
serenajiang c67b1abfd8
fix(csv upload): hive params typo (#10273)
* fix(csv upload): fix :params typo

* fix tests
2020-07-09 11:25:35 -07:00
Daniel Vaz Gaspar 6224edd42d
fix: dashboard endpoint sig changed (#10220)
* fix(thumbnails): dashboard endpoint sig changed

* fix, flask get url for Superset.dashboard

* add simple test
2020-07-09 11:42:38 +01:00
Ville Brofeldt baeacc3c56
feat(chart-data-api): make pivoted columns flattenable (#10255)
* feat(chart-data-api): make pivoted columns flattenable

* Linting + improve tests
2020-07-08 13:35:53 +03:00
Daniel Vaz Gaspar 7ecff0e513
fix: datasets related objects, apply filter and openapi spec (#10252)
* fix, datasets related objects, apply filter and openapi spec

* fix, add 404 test

* fix, add 404 test

* fix test
2020-07-08 10:04:05 +01:00
Daniel Vaz Gaspar 878dbcda3f
feat(api): bump marshmallow and FAB to version 3 (#9964)
* feat(api): bump marshmallow and FAB to version 3

* revert query context tests changes

* obey mypy

* fix tests

* ignore types that collide with marshmallow

* preparing for RC2

* fix tests for marshmallow 3

* typing fixes for marshmallow

* fix tests and black

* fix tests

* bump to RC3 and lint

* Test RC4

* Final 3.0.0

* Address comments, fix tests, better naming, docs

* fix test

* couple of fixes, addressing comments

* bumping marshmallow
2020-07-07 13:26:54 +01:00
Lily Kuang b9e0678752
feat: dataset api endpoint for charts and dashboards count (#10235)
* create GET endpoint for charts and dashboards count associated to a dataset

* add test for chart and dashboard count dataset
2020-07-06 16:25:57 -07:00
Bogdan 84f8a51458
feat: support nulls in the csv uploads (#10208)
* Support more table properties for the hive upload

Refactor

Add tests, and refactor them to be pytest friendly

Use lowercase table names

Ignore isort

* Use sql params

Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
2020-07-06 13:26:43 -07:00
Maxime Beauchemin 318e5347bc
feat: Alerts! allowing users to set SQL-based email alerts with screenshots (#9944)
* feat: add support for alerts

* Add ModelViews

* First pass at adding scheduled Alert support

* Fix syntax errors

* Add log_retention and database to model

* Improving screenshots

* Still refactoring screenshots

* Pass down thumb_size properly

* Progress on screenshot endpoint

* Add alerts.last_eval_dttm and alert query logic

* Getting ready to split compute_screenshot and screenshot/{SHA}

* split the endpoints

* Improving alerting loop

* empty methods

* Add CLI command 'superset alert' that runs a sched loop

* Getting things to work

* email delivery

* A working email\!

* Add feature flag

* Add some description_columns to AlertModelView

* Little tweaks

* Use database.get_df, eval cells for truthiness

* Migrate thumbnail/screenshot functions to use new arg pattern

* Addressing PR feedback

* Update alerts DB migration down_revision

* Resolve _deliver_email arg conflict

* Make mypy happy

* Make isort happy

* Make pylint happy

Co-authored-by: Rob DiCiuccio <rob.diciuccio@gmail.com>
2020-07-06 13:12:27 -07:00
Bogdan b7c45fed80
fix: downgrade sqlparse and add unit test (#10165)
* Downgrade sqlparse and add unit test

* Explain why sqlparse is pinned

Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
2020-07-06 11:10:46 -07:00
Maxime Beauchemin 2314aad450
feat: add database dropdown to dashboard import (#10118)
* feat: add database dropdown to dashboard import

Currently, when importing a database from a JSON file, the process
looks at the database name from the source (the info is in the file)
and matches the datasources to that name. If no database by that name
exists, it simply fails.

With this PR, we add a database dropdown that allows the user to specify
which databases the datasources should target as the get upserted.

I want to stress that the code in this area is not in a great shape,
and that the challenge of serializing/deser the nested objects is
challenging, but that there should be a much better way to do this.
One of the improvement (out of scope for this PR) that would allow to
simplify those import/export would be to use UUIDs for
importable/exportable objects.

Another identified issue is the indirections between
`utils/import_expor_{model}.py` on top of `{Model}.import_object`. Not
addressing that here.

Next topic is the MVC stuff. Decided to stick with it for now as this is
more of a [obious missing feat:] than a rewrite.

* isort \!? 0%^$%Y$&?%$^?%0^?

* fix tests

* pre-committing to py3.6

* address dpgaspar's comments

* revert isort
2020-07-05 15:08:37 -07:00
John Bodley b181e48f5c
[log] Updating form-data logic (#10197)
Co-authored-by: John Bodley <john.bodley@airbnb.com>
2020-07-04 12:51:43 -07:00
Bogdan 77b36783e7
s/assertEqual/assertEquals (#10195)
Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
2020-06-29 16:38:06 -07:00
Bogdan 4e340c8368
feat: Switch from nosetest to pytest (#10177)
* Switch from nosetest to pytest

Fix schedule tests

Collect pytest coverage

Move pytest config into pytest.ini

Move cov to the pytest.ini

* Append coverage for the 2nd run

* Add coverage to all commands

* Coverage only for tests

* Get coverage from 1 place

* Rename classes to be  pytest compatible

* Test coverage for examples and tests

* Max diff to -1

* Explain how to run pytest for the whole project

* Do not append code coverage for the main run

* Do not run coverage on examples

Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
2020-06-29 15:36:06 -07:00
Jason Davis 72fc581b15
added explore database for ctas/cvas (#10174)
Co-authored-by: Jason Davis <@dropbox.com>
2020-06-29 11:13:54 -07:00
Ville Brofeldt 26d34727d3
fix: make time grain nullable in chart data endpoint (#10187)
* fix: make time grain nullable

* add test

* lint
2020-06-29 09:54:01 +03:00
Jesse Yang 9bdfa055ac
feat(viz): add query mode switch to table chart (#10113)
1, Replace table chart rendering from jquery.DataTables to react-table: apache-superset/superset-ui#623
2. Rearrange the control panel, replace GROUP BY and NOT GROUP BY with a "Query Mode" switch: apache-superset/superset-ui#609
2020-06-28 21:37:04 -07:00
Will Barrett 4965d87505
Break some static methods out of superset.views.core.Superset (#10175) 2020-06-26 14:34:45 -07:00
Jason Davis 9de9e1c19d
feat: Added configuration to SQL Lab results "Explore" button (#10164)
* added configuration to virtual table explore button

* added description to mixin

* fixed unit tests

Co-authored-by: Jason Davis <@dropbox.com>
2020-06-26 09:54:55 -07:00
Will Barrett df71fac1e0
refactor: Fix lint on superset/utils/core.py (#10120)
* Fix lint on superset/utils/core.py

* black

* mypy

* Fix some missing renames
2020-06-26 08:49:12 -07:00
Ville Brofeldt 410c5be2f8
fix: return slice owners for /user_slices ep (#10171)
* fix: return slice wowners for /user_slices ep

* put back created_by and changed_by

* improve comment
2020-06-26 18:10:56 +03:00
Maxime Beauchemin 1781ebbaa4
fix: [search query view] edit link is broken (#10128)
* fix: [search query view] edit link is broken

* eslint + mypy

* rever app.py changes

* addressing comments

* use api/v1/query

* fix test
2020-06-25 12:20:10 -07:00
Ville Brofeldt b205ce32b0
feat: Add new timegrains and convert_dttm to Druid engine spec (#10160)
* feat: Add new timegrains and convert_dttm to Druid engine spec

* Add TemporalType enum and fix test case

* Remove DATETIME for athena (original spec)
2020-06-25 12:18:37 +03:00
Jason Davis c544ebd876
fix: Fixed Attribute Error when running core_tests.py (#10154)
* fix: changed import order to fix core-test error

* reformatted using black

Co-authored-by: Jason Davis <@dropbox.com>
2020-06-24 12:46:38 -07:00
John Bodley 37777f382f
fix(security): dbs/clusters perm (#10130)
Co-authored-by: John Bodley <john.bodley@airbnb.com>
2020-06-24 10:06:25 -07:00