Commit Graph

1702 Commits

Author SHA1 Message Date
Daniel Vaz Gaspar 7e2e8b8ad9
fix: dataset after insert when db relation does not exist (#21492) 2022-09-17 17:16:18 +01:00
Yongjie Zhao 2dfcba04b0
fix: Time Offset in SQLite and refine logic in Date Type conversion (#21378) 2022-09-16 12:02:22 +08:00
Michael S. Molina 2c7323a87d
fix: Supports form_data param in old Explore endpoint (#21469) 2022-09-14 18:00:11 -03:00
Daniel Vaz Gaspar 64d216adb3
fix: permission sqlalchemy events (#21454) 2022-09-13 13:56:59 -07:00
Bogdan 44654e5abc
perf: Memoize the common_bootstrap_payload and include user param (#21018) (#21439)
Co-authored-by: Bogdan Kyryliuk <bogdankyryliuk@dropbox.com>
2022-09-13 08:52:08 -07:00
John Bodley eac6fdcd29
chore(sqllab): Cleanup /tables/... endpoint (#21284) 2022-09-13 08:22:12 -07:00
Ville Brofeldt 05b97fff4d
fix(cache): respect default cache timeout on v1 chart data requests (#21441) 2022-09-13 15:56:04 +02:00
Ville Brofeldt e1e9fda72b
fix: remove extras from all adhoc_filters controls (#21450)
Co-authored-by: Ville Brofeldt <ville.brofeldt@apple.com>
2022-09-13 15:52:21 +03:00
Daniel Vaz Gaspar 094400c308
fix: cached common bootstrap Revert (#21018) (#21419) 2022-09-10 01:02:24 +01:00
Hugh A. Miles II 14cd8a2160
chore: add test for SPA explore endpoints around missing datasets (#21303) 2022-09-09 10:54:39 -07:00
Yongjie Zhao ce3d38d2e7
feat: apply Time Grain to X-Axis column (#21163) 2022-09-07 16:24:15 +08:00
Zef Lin 286474c3d8
fix: revert permission refactoring PR (#21313) 2022-09-06 19:18:22 +01:00
Zef Lin 9be4870c7f
feat: only show active user for chart/dashboard/datasource owner drop… (#20837) 2022-09-06 19:17:50 +01:00
Daniel Vaz Gaspar c3f8417139
fix: disallow users from viewing other user's profile on config (#21302) 2022-09-05 13:32:48 +01:00
Beto Dealmeida 34a79add04
feat: filter parameters from DB API (#21248) 2022-09-02 11:50:04 -07:00
Yongjie Zhao f71ee2e7bc
fix: flaky test when sync metadata (#21306) 2022-09-02 17:22:49 +08:00
Zef Lin c4b6fc5a6a
chore: migrate available_domains to api/v1 (#21173) 2022-09-01 16:38:02 +01:00
Daniel Vaz Gaspar 9fd752057e
feat: adds TLS certificate validation option for SMTP (#21272) 2022-09-01 10:51:34 +01:00
Daniel Vaz Gaspar 3f2e894af3
fix: dataset name change and permission change (#21161)
* fix: dataset name change and permission change
2022-08-31 18:11:03 +01:00
Lily Kuang 05354a96bf
feat: filter with created_by for charts and dashboards (#21199)
* feat: filter with created_by for charts and dashboards

* add tests

* update tests

* update tests
2022-08-30 12:27:38 -07:00
ʈᵃᵢ 04dd8d414d
fix(celery cache warmup): add auth and use warm_up_cache endpoint (#21076) 2022-08-30 09:24:24 -07:00
Beto Dealmeida 8772e2cdb3
fix: improve get_db_engine_spec_for_backend (#21171)
* fix: improve get_db_engine_spec_for_backend

* Fix tests

* Fix docs

* fix lint

* fix fallback

* Fix engine validation

* Fix test
2022-08-29 11:42:42 -07:00
Geido f017f98b88
chore: E2E tests for the Drill to detail modal (#21187)
* Add example ECharts Dashboard

* [WIP] E2E test

* Add echarts interactions

* Lint

* DRY
2022-08-29 11:25:27 +03:00
Đặng Minh Dũng ccb293a083
fix(Trino): create `PrestoBaseEngineSpec` base class to share common code between Trino and Presto (#21066)
* chore: create `PrestoBaseEngineSpec` class that share common functions between Presto and Trino

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

* feat(Trino): support CertificateAuthentication

* chore(Presto): move `get_function_names` to `PrestoBaseEngineSpec`

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

* chores(Presto): remove `is_readonly_query`

* feat(Trino): implement `extra_table_metadata`

* feat(Trino): specify `User-Agent`

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

* fix: pylint

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

* chores(Presto): move `PrestoBaseEngineSpec` to `presto.py`

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

* fix(Presto): typing annotations

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

Signed-off-by: Đặng Minh Dũng <dungdm93@live.com>
2022-08-29 10:21:28 +03:00
Reese 16032ed3e2
feat: Virtual dataset duplication (#20309)
* Inital duplicate functionality

* Fix formatting

* Create dedicated duplicate API

* Make use of new API

* Make use of new api permissions

* Add integration tests for duplicating datasets

* Add licenses

* Fix linting errors

* Change confirm button to 'Duplicate'

* Fix HTTP status code and response

* Add missing import

* Use user id instead of user object

* Remove stray debug print

* Fix sqlite tests

* Specify type of extra

* Add frontend tests

* Add match statement to test
2022-08-26 16:07:56 -06:00
Bogdan ed6212a1f9
Reimplement permissions fetching to do it in a single transaction (#21156)
Co-authored-by: Bogdan Kyryliuk <bogdankyryliuk@dropbox.com>
2022-08-23 18:45:39 -07:00
Yongjie Zhao 11bf7b9125
feat: generate label map on the backend (#21124) 2022-08-22 21:00:02 +08:00
Diego Medina 15b9f83150
chore: support trailing slashes in database api (#21123) 2022-08-22 15:15:04 +08:00
AAfghahi dda1dcf8ee
feat: add header_data into emails (#20903)
* test sparkpost

* added logging info

* header function implementation

* added test

* daniel revisions

* daniel revision

* elizabeth review
2022-08-18 10:32:25 -04:00
Yongjie Zhao 1afcdfb9fa
fix: datetime value should be seconds in sqlite (#21113) 2022-08-18 11:42:58 +08:00
Bogdan 495a205dec
Memoize the common_bootstrap_payload (#21018)
Try patch

Co-authored-by: Bogdan Kyryliuk <bogdankyryliuk@dropbox.com>
2022-08-16 08:27:12 -07:00
Moriah Kreeger 83dd85166f
feat: add extension point for workspace home page (#21033)
* updates to allow insertion of workspace home sidescroll/table UI

* fix types

* fix User type import

* add welcome message to ui registry

* add extra fields to individual chart/query GET results (for workspace home required info)

* update list view card to support a subtitle

* add id to individual chart fetch

* update chart api test

* another test fix

* fix saved query test

* update extension types + insert point

* fix typing

* fix type name
2022-08-15 12:16:40 -07:00
Ville Brofeldt 5113b01031
feat(trino): add query cancellation (#21035) 2022-08-12 07:48:29 +03:00
Hugh A. Miles II e13c5b2b7b
fix: take form_data reference for metrics for pivot_v2 table reports (#21029)
* take form_data reference for form_data

* better

* remove comments

* remove comments

* Update superset/charts/post_processing.py

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>

* add test

* test

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
2022-08-11 12:08:40 -04:00
EugeneTorap a2b21b55be
fix: Validate required fields in sql_json API (#21003)
* fix: Validate required params for sql_json API

* Test required params in sql_json API

* Refactoring: use marshmallow Schema for validation sql_json API

* Update SqlJsonPayloadSchema

* Update SqlJsonPayloadSchema

* Refactoring

* Refactoring

* Refactoring
2022-08-11 23:37:53 +08:00
Elizabeth Thompson 7445eab5a2
add test for tab state (#20949) 2022-08-10 16:45:31 -04:00
Bogdan 17b58037f8
perf: Implement model specific lookups by id to improve performance (#20974)
* Implement model specific lookups by id to improve performance

* Address comments e.g. better variable names and test cleanup

* commit after cleanup

* even better name and test cleanup via rollback

Co-authored-by: Bogdan Kyryliuk <bogdankyryliuk@dropbox.com>
2022-08-09 09:59:31 -07:00
Beto Dealmeida bb3871ddaf
feat: per-db add metrics (#20990)
* feat: per-db add metrics

* Add unit tests
2022-08-08 12:07:16 -07:00
Yongjie Zhao 802b69f97b
feat: supports mulitple filters in samples endpoint (#21008) 2022-08-08 22:42:14 +08:00
Beto Dealmeida 7e501cd816
fix: BigQuery get_parameters_from_uri (#20966) 2022-08-03 17:27:40 -07:00
Jesse Yang 7e836e9b04
test: autouse app_context in unit tests (#20911) 2022-08-02 15:42:50 -07:00
Diego Medina 9291ad5d4c
fix: Change dataset name affect data access role set to this dataset (#20574) 2022-08-02 14:06:53 -06:00
Daniel Vaz Gaspar bfd2a3d79f
fix: database permissions on update and delete (avoid orphaned perms) (#20081)
* fix: database permissions on update and delete (avoid orphaned perms)

* fix event transaction

* fix test

* fix lint

* update datasource access permissions

* add tests

* fix import

* fix tests

* update slice and dataset perms also

* fix lint

* fix tests

* fix lint

* fix lint

* add test for edge case, small refactor

* add test for edge case, small refactor

* improve code

* fix lint
2022-08-02 18:28:46 +01:00
Hugh A. Miles II bc435e08d0
fix: overwrite update override columns on PUT /dataset (#20862)
* update override columns

* save

* fix overwrite with session.flush

* write test

* write test

* layup

* address concerns

* address concerns
2022-07-29 21:51:35 -04:00
Jesse Yang e739ff5076
feat: allow more HTML tags in report description (#20908) 2022-07-29 08:27:39 -07:00
Yongjie Zhao 718bc3062e
fix: invalid metric should raise an exception (#20882) 2022-07-28 08:15:43 +08:00
Jesse Yang 77db0651d8
feat(sql lab): display presto and trino tracking url (#20799) 2022-07-26 20:20:08 -07:00
Elizabeth Thompson cd578d2865
add having_druid back into the schema (#20879) 2022-07-26 17:54:46 -07:00
Jesse Yang 4d192e6e4d
feat(report): capture dashboard reports in specific states (#20552) 2022-07-26 17:01:56 -07:00
Jesse Yang 6e6d4e3169
test: suppress unnecessary fab and sqla logs (#20870) 2022-07-26 10:36:24 -07:00
Geido 6b0c3032b2
chore: Update color scheme when deleted or changed (#20589)
* feat(explore): Use v1/explore endpoint data instead of bootstrapData

* Add tests

* Fix ci

* Remove redundant dependency

* Use form_data_key in cypress tests

* Add auth headers to for data request

* Address comments

* Remove displaying danger toast

* Conditionally add auth headers

* Address comments

* Fix typing bug

* fix

* Fix opening dataset

* Fix sqllab chart create

* Run queries in parallel

* Fallback to default color scheme

* Fix dashboard id autofill

* Fix lint

* Fix test

* Fix hydrate action

* Update dashboard colors

* Add color scheme domain

* Add check for default scheme

* Make me pretty

* Clean up

* Nit

* Clean up

* Pretty

* Fix missing sequential

* Lint

* Enhance test

* Lint

Co-authored-by: Kamil Gabryjelski <kamil.gabryjelski@gmail.com>
2022-07-25 18:50:49 -04:00
Yongjie Zhao f011abae2b
feat: the samples endpoint supports filters and pagination (#20683) 2022-07-22 20:14:42 +08:00
Hugh A. Miles II 84b852c457
fix: properly set `owners` to Sqlatable.owners_data inside payload (#20794)
* properly set owners_data for sqlatabl

* fix test
2022-07-20 14:56:08 -04:00
Cody Leff 84d4302628
fix(explore): Fix chart standalone URL for report/thumbnail generation (#20673)
* Update explore URLs.

* More URL fixes.

* Make frontend accept true/false query params case-insensitively.

* Fix URL mistake.

Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>

Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>
2022-07-19 13:53:55 -03:00
John Bodley 8c0ac9017f
fix: Presto _show_columns return type (#20757) 2022-07-19 09:52:22 -07:00
Jesse Yang e2d3ea831a
fix(db): use paginated_update for area chart migration (#20761) 2022-07-19 07:20:46 -07:00
Beto Dealmeida e60083b45b
chore: upgrade SQLAlchemy to 1.4 (#19890)
* chore: upgrade SQLAlchemy

* Convert integration test to unit test

* Fix SQLite

* Update method names/docstrings

* Skip test

* Fix SQLite
2022-07-18 15:21:38 -07:00
Elizabeth Thompson bbaa4cc65d
use existing row when id is found (#20661) 2022-07-16 00:00:39 -07:00
Jesse Yang 2cb4fd31f1
refactor(test): add login_as_admin in global conftest (#20703) 2022-07-14 18:10:31 -07:00
Jesse Yang c3ac61271a
feat(dashboard): make permalink deterministic (#20632) 2022-07-12 16:33:18 -07:00
Elizabeth Thompson c2be54c335
fix: pandas bug when data is blank on post-processing (#20629)
* fix pandas bug when data is blank on post-processing

* account for multiple queries when data is blank
2022-07-08 16:33:53 -07:00
AAfghahi 0ce0c6e1eb
chore: removing Druid from front- and back- end (#20338)
* first pass at removing native Druid nosql

* removing having_druid

* addressing comments, linting

* fixed all tests

* addressing comments

* redirected to ui-core TimeGranularity type

* query form metric linting

* fixed broken chart type

* implementing feedback
2022-07-08 17:57:03 +02:00
Yongjie Zhao 4e6e87f62e
feat: Area viz migration (#20359) 2022-07-08 19:56:03 +08:00
John Bodley f0ca158989
fix: Refactor ownership checks and ensure consistency (#20499)
Co-authored-by: John Bodley <john.bodley@airbnb.com>
2022-07-07 11:04:27 -07:00
Smart-Codi e7b965a3b2
fix: Bad date type in email text report for table chart (#20119)
* fix bad date type in email text report for table chart

* fix test, pylint issue

* add test case for date type
2022-07-07 11:31:50 -06:00
Yongjie Zhao 7626c31372
feat: TreeMap migration (#20346) 2022-07-07 19:37:18 +08:00
Yongjie Zhao 414cc99ca2
fix: datetime.data in series (#20618) 2022-07-07 09:33:44 +08:00
Reese f9109583ce
fix: Allow dataset owners to explore their datasets (#20382)
* fix: Allow dataset owners to explore their datasets

* Re-order imports

* Give owners security manager permissions to their datasets

* Update test suite

* Add SqlaTable to is_owner types

* Add owners to datasource mock

* Fix VSCode import error

* Fix merge error
2022-07-06 11:27:50 -03:00
Daniel Vaz Gaspar f38dd1d42d
feat: add hooks on set_perm for new data permissions (#20600)
* feat: add hooks on set_perm for new data permissions

* fix lint
2022-07-06 09:54:18 +01:00
Rui Zhao 818962cc89
fix(embedded): Retry when executing alert queries to avoid sending transient errors to users as alert failure notifications (#20419)
Co-authored-by: Rui Zhao <zhaorui@dropbox.com>
2022-07-05 13:23:05 -07:00
Michael S. Molina 662bab1e6d
feat: Renders Explore in SPA (#20572)
* feat: Renders Explore in SPA

* Adds permalink support

* Replaces navigation from Welcome page

* Fix initializing feature flags

* Remove redundant import

* Adds saveSlice workaround

* Fixes paths

* Fixes lint error

* Fixes tests

* Fix url to explore from Datasets view

* Fix explore page height

Co-authored-by: Kamil Gabryjelski <kamil.gabryjelski@gmail.com>
2022-07-05 16:58:09 -03:00
John Bodley 94b3d2f0f0
refactor: Deprecate ensure_user_is_set in favor of override_user (#20502)
Co-authored-by: John Bodley <john.bodley@airbnb.com>
2022-07-05 10:57:40 -07:00
John Bodley ad308fbde2
chore(rls): Remove passing global username (#20344)
* chore(rls): Remove passing global username

* Update manager.py

* Update manager.py

* Update manager.py

* Update manager.py

Co-authored-by: John Bodley <john.bodley@airbnb.com>
2022-07-05 10:51:24 -07:00
Yongjie Zhao b870a21eaa
refactor: remove unused flatten function (#20582) 2022-07-01 19:17:55 +08:00
Jesse Yang cadd259788
feat: save active tabs in dashboard permalink (#19983) 2022-06-29 09:43:52 -07:00
John Bodley 3483446c28
refactor: Cleanup user get_id/get_user_id (#20492)
Co-authored-by: John Bodley <john.bodley@airbnb.com>
2022-06-24 17:57:04 -07:00
Michael S. Molina 20163361b9
feat: Adds the /explore endpoint to the v1 API (#20399)
* feat: Adds the /explore endpoint to the v1 API

* Fixes pylint errors

* Fixes tests

* Changes the tests logic

* Removes ABC reference

* Improves indentation

* Addresses review comments

* Rebases code

* Improves dataset and slice assertions

* Fixes tests

* Removes schema and table name assertions

* Removes fixed IDs

* Fixes datasource ID
2022-06-24 08:23:30 -03:00
Elizabeth Thompson 44f0b511dd
remove autoflush for queries during dual write (#20460) 2022-06-23 14:50:30 -07:00
Beto Dealmeida f3b289d3c3
fix: ensure column name in description is string (#20340)
* fix: ensure column name in description is string

* Add unit test
2022-06-21 10:10:46 -03:00
Hugh A. Miles II e3e37cb68f
chore: switching out ConnectorRegistry references for DatasourceDAO (#20380)
* rename and move dao file

* Update dao.py

* add cachekey

* Update __init__.py

* change reference in query context test

* add utils ref

* more ref changes

* add helpers

* add todo in dashboard.py

* add cachekey

* circular import error in dar.py

* push rest of refs

* fix linting

* fix more linting

* update enum

* remove references for connector registry

* big reafctor

* take value

* fix

* test to see if removing value works

* delete connectregistry

* address concerns

* address comments

* fix merge conflicts

* address concern II

* address concern II

* fix test

Co-authored-by: Phillip Kelley-Dotson <pkelleydotson@yahoo.com>
2022-06-21 13:22:39 +02:00
Daniel Vaz Gaspar 60eb1094a4
feat: add name, description and non null tables to RLS (#20432)
* feat: add name, description and non null tables to RLS

* add validation

* add and fix tests

* fix sqlite migration

* improve default value for name
2022-06-20 13:52:05 +01:00
John Bodley 8b0bee5e8b
[fbprophet] Fix frequencies (#20326) 2022-06-19 21:53:09 -07:00
Lily Kuang ab9f72f1a1
fix(embedded): CSV download for chart (#20261)
* move postForm to superset client

* lint

* fix lint

* fix type

* update tests

* add tests

* add test for form submit

* add test for request form

* lint

* fix test

* fix tests

* more tests

* more tests

* test

* lint

* more test for postForm

* lint

* Update superset-frontend/packages/superset-ui-core/test/connection/SupersetClientClass.test.ts

Co-authored-by: David Aaron Suddjian <1858430+suddjian@users.noreply.github.com>

* update tests

* remove useless test

* make test cover happy

* make test cover happy

* make test cover happy

* make codecov happy

* make codecov happy

Co-authored-by: David Aaron Suddjian <1858430+suddjian@users.noreply.github.com>
2022-06-17 20:01:08 -07:00
mohittt8 41bbf62e58
fix(presto): use correct timespec for presto (#20333) 2022-06-16 16:43:17 -07:00
Beto Dealmeida 998624b1a5
feat: allow setting db UUID (#20412)
* WIP

* feat: allow passing UUID when creating a DB

* Test

* Fix field
2022-06-16 15:53:59 -07:00
Elizabeth Thompson 12436e47c9
fix key error on permalink fetch for old permalinks (#20414) 2022-06-16 15:51:17 -07:00
Diego Medina 3fe53f735e
fix: Unable to export multiple Dashboards with the same name (#20383) 2022-06-15 00:27:24 -06:00
Elizabeth Thompson 5a137820d0
fix: catch some potential errors on dual write (#20351)
* catch some potential errors on dual write

* fix test for sqlite
2022-06-13 17:30:13 -07:00
Reese 11b33de61b
feat(api): Added "kind" to dataset/<pk> endpoint (#20113) 2022-06-10 13:03:48 -07:00
Craig Rueda d1c24f81f2
chore(migrations): Renaming migration files so that they're easier to keep track of (#20284)
* Renaming migration files so that they're easier to keep track of

* Fixing broken import

* Fixing broken import again

* Fixing broken tests
2022-06-07 10:30:09 -07:00
AAfghahi c131f025f8
chore: add event logger to reports/alerts CRUD (#20249)
* add event logger to report CRUD

* added assert metric to tests

* added unique name to action

* testing

* with inline log context
2022-06-06 16:13:22 +02:00
John Bodley b08e21efd9
[requirements] Resolve rebase conflicts (#20152)
Co-authored-by: John Bodley <john.bodley@airbnb.com>
2022-06-03 15:27:35 -07:00
Elizabeth Thompson 32bb1ce3ff
feat!: pass datasource_type and datasource_id to form_data (#19981)
* pass datasource_type and datasource_id to form_data

* add datasource_type to delete command

* add datasource_type to delete command

* fix old keys implementation

* add more tests
2022-06-02 16:48:16 -07:00
Diego Medina 8638f59b4c
fix: Box Plot Chart throws an error when the average (AVG) / SUM is being calculated on the Metrics (#20235)
* fix: Box Plot Chart throws an error when the average (AVG) / SUM is being calculated on the Metrics

* add test
2022-06-02 10:00:04 +08:00
Beto Dealmeida 05a138a191
feat: query datasets from SQL Lab (#15241)
* feat: Jinja2 macro for querying datasets

* Add docs

* Address comments
2022-06-01 15:18:40 -07:00
Smart-Codi 74c5479926
fix: datatype tracking issue on virtual dataset (#20088)
* Fix datatype tracking issue on virtual dataset

* fix pytest issue on postgresql
2022-06-01 13:43:11 -06:00
Yongjie Zhao 1530c34792
fix: failed samples should throw exception (#20228) 2022-06-01 18:24:01 +08:00
John Bodley 97ce920d49
fix(csv): Ensure df_to_escaped_csv handles NULL (#20151)
Co-authored-by: John Bodley <john.bodley@airbnb.com>
2022-05-31 09:56:25 -07:00
Daniel Vaz Gaspar 77ccec50cc
feat: add statsd metrics for notifications (#20158)
* feat: add statsd metrics for notifications

* fix import

* fix lint

* add decorator arg for custom prefix

* add tests
2022-05-26 15:43:05 +01:00
Ville Brofeldt 64c4226817
fix(temporary-cache): when user is anonymous (#20181)
* fix(temporary-cache): fail on anonymous user

* make exceptions generic

* fix test

* remove redundant bool return

* fix unit tests
2022-05-26 14:45:20 +03:00
Phillip Kelley-Dotson 0501ad25e8
fix: always create parameter json field (#19899)
* fix: always create parameter json field

* ensure validation for empty catalog

* check engine instead of name

* put validation in be

* fix test

* fix test

* remove test
2022-05-25 14:23:25 -07:00
Yongjie Zhao 40abb44ba1
feat: add samples endpoint (#20170) 2022-05-25 18:18:58 +08:00
cccs-tom b0c6935f06
fix: Allow dataset owners to see their datasets (#20135) 2022-05-25 09:58:15 +01:00
Hugh A. Miles II f8ea7788a9
feat: Add Certified filter to Datasets (#20136) 2022-05-23 17:58:15 -04:00
Daniel Vaz Gaspar b9a98aae79
fix: None dataset and schema permissions (#20108)
* fix: None dataset and schema permissions

* fix pylint

* add migration and test

* fix migration
2022-05-20 09:40:10 +01:00
Ville Brofeldt e2f11d3680
fix(presto,trino): use correct literal dttm separator (#20123)
* fix(presto,trino): use correct literal dttm separator

* remove redundant tests
2022-05-19 20:42:31 +03:00
Hugh A. Miles II 660af409a4
feat: Save column data into json_metadata for all Query executions (#20059)
* add save_metadata function to QueryDAO

* use set_extra_json_key

* added test

* Update queries_test.py

* fix pylint

* add to session

* add to session

* refactor

* forgot the return
2022-05-18 13:11:14 -04:00
AAfghahi e69f6292c2
chore: Set limit for a query in execute_sql_statement (#20066)
* test for query limit

* fixed tests
2022-05-16 17:56:46 -04:00
cccs-RyanS ddc01ea781
feat(business-types): initial implementation of SIP-78 (#18794)
* add BUSINESS_TYPE_ADDONS to config with example callback

* Removing uneeded whitespace

* [Work in progress] Modifying cidr function to allow for  single ip and adding port outline

* Added test REST endpoint, added some more ports

I've thrown in a test.py script as well that will try to connect to the
business_type endpoint.

* Moving code from config.py into the business api

Very simple api is exposed that will allow someone to call a checkport
endpoint and get back a response.

* Removing commented out bits.

* Adding fucntion dict back to the config

* Moving business_type endpoint to charts

* Adding schema for get endpoint

* Removing imports, updating docstring, fixing typo

Just some small changes as described in the title.  I've updated the
test.py as well so it functions with the endpoint changes.

* Adding translation dict

* Fixing ops

* Adding check for list

* Modifying changes to add quotes where needed

Also changed BusinessTypeResponse to resp.

* Adding in some code to call the filter config

If a column starts with "cidr_" it will call the code in config.py to
try to translate the filter.  Nothing is changed in the JSON being
executed, just some information is dumped to console.

* Porting Ryan's changes

* Adding migration script (as per Ryan's PR)

* Fixing typo

* Prettier fixes

* [CLDN-1043] Adding rough version of filter changes for business types

* fix down migration

* Fixing bugs after merge

* adding functionality to appy filters in back end

* Fixing linting issues

* fix down revision

* Changing conversion callback to handle multiple values at once

* Adding string representation of values

* Code cleanup plus fixing debouce to only be called once for each entry

* Removing non needed logginh

* Changing operator list to use sting values

* Using text value operators

* Removing clear operator call

* Moving business type endpoints

* fix down revision

* Adding port functions

* update migration

* fix bad rebase and add ff

* implement validator

* dont add invalid values to response

* [CLDN-1205] Added a new exception type for a business type translation error. Added the error message in the display_value field within the business type response. Modified the IP and Port business types to populate the error message field in the response if an error occurs

* [CLDN-1205] Added meaningful error message for port translation errors

* Removing status field from businesstype Response and adding in error message

* [CLDN-1205] Added check to make sure the port business type is within the valid range of ports, if it is not, it will populate the error message

* [CLDN-1205] Fixed the if statement that checks to see if the string_value is in the valid range of port numbers. It did not corrently verify this before now.

* [CLDN-1205] Fixed an error where it was trying to use string_value in <= statements. I just casted string_value to an integer if it is numeric, which allows <= operators to be used on it

* [CLDN-1207] Added unit tests for the cidr_func and port_translation_func functions which are located in /superset/config.py

* [CLDN-1207] removed the assertRaises line as it does not work with the cidr_func and port_translation_func functions

* [CLDN-1207] Added the skeleton of the test_cidr_translate_filter_func unit test, still need to update what the expected response from the function will be.

* [CLDN-1207] Added the remainder of the back-end unit tests for the business types

* [CLDN-1207] Fixed the syntax error which caused the test_cidr_translate_filter_func_NOT_IN_double unit test to fail

* [CLDN-1207] Removed the logging that was added for debugging purposes

* [CLDN-1207] Formatted the commands_tests.py file to make it nicer to look at/read through

* [CLDN-1207] Fixed the code so that it conformed to the pylint requirements (i.e., pylint no longer complains about the code in commands_tests.py)

* [CLDN-1207] Modified some of the docstrings so they made better use of the 100 character per line, line limit

* [CLDN-1207] Added the beginnings of the unit tests for the
business types API

* [CLDN-1207] Added a comment to the top of the commands_tests.py file explaining how to run the unit tests. This prevents the next person who tries to run them from having to waste time trying the different forms of testing that Superset supports (e.g., pytest, tox, etc.)

* [CLDN-1207] Added a grammar fix to the comments describing how to run the unit tests

* [CLDN-1207] Modified the description of the business_type API endpoints as they did not represent what the API was actually doing

* [CLDN-1207] Added further instructions on how to run the unit tests that are within the business_type/api_tests.py file

* add request validation

* disable request if business type missing

* [CLDN-1207] Unit tests for the business type API are now working, however, they need to be modified to make use of @mock as we don't want to have to run the server to be able to run the unit tests

* Removing businesss types deffinitons from config

* Adding select to only show valid business types

* Fixed Enzyme tests

* Added scalfolding for selecting filter dropdown

* Adding intigration tests

* fix revision

* fix typos and unnecessary requests

* break out useBusinessTypes

* Added front-end RTL unit tests for the business type API endpoint

* Fixed error from unit tests

* Added a unit test to ensure the operator list is updated after a business type API response is received

* Removing elect compoenet for business types

* Adding feature flag and allowing saving when no business type present

* fixing useEffect hooks

* Adding feature flag to model

* Changing behavior such that an empty string returns a default response

* add form validation

* Modified comments in unit test as command to run test has changed

* Modified comments in unit test as filename to run test has changed

* Modified the api_tests.py file to conform to the linting requirements

* Changed the name of one of the tests to reflect what the test is actually testing

* Added cypress back to the package.json

* Added informative comments

* Updated comments in files as well as removed imports which were not being used

* Changes made by npm run prettier

* Fixed spelling mistakes

* Updated models.py to remove placeholder comments used in development

* Added feature flag mocking in unit test

* Fixing open api failure

* Fixing business types to pass unit tests

* Reverting unsafe connections back to false

* Removing print statement

* Adding business tpye to export test

* setting default feature flag to false for business type

* Reverting pre commit

* Reverting pre commit and running pre commit

* Reverting pre commit and running pre commit

* Fixing formatting

* Adding license

* Fixing Linting

* Protecting api enpoints

* updating model

* Fixing code path when business type exists

* Linting

* Linting

* Fixing linting

* Fixing spelling

* Fixing schemas

* Fixing app import

* fixing item render

* Added RTL test to make sure business type operator list is updated after API response

* Fixing linting

* fix migration

* Changing unit tests

* Fixing import and DB migration after rebase

* Renaming to advanced types

* Fixing Linting

* More renaming

* Removing uneeded change

* Fixing linting and test errors

* Removing unused imports

* linting

* Adding more detailed name for migration

* Moving files to plugins

* more renaming

* Fixing schema name

* Disabling feature flag that should not be enabled by default

* Adding extra cehck

* NameChange

* formatting

* Fixing equals check

* Moveing all advanced type classes and types to one file, and converting tests to functional

* Adding advanced type to test and fix linitng

Co-authored-by: Ville Brofeldt <ville.v.brofeldt@gmail.com>
Co-authored-by: Dan Parent <daniel.parent@cse-cst.gc.ca>
Co-authored-by: GITHUB_USERNAME <EMAIL>
Co-authored-by: cccs-Dustin <96579982+cccs-Dustin@users.noreply.github.com>
2022-05-16 17:58:21 +03:00
thinhnd2104 85315460cb
fix: Athena timestamp literal format (#19970)
* Fix Athena timestamp literal format

related: [#19969]

* Update test_athena.py

Update test

* Update athena.py

* Resolving CI/CD

* lint

Co-authored-by: Thinh Nguyen Duc <thinhnd.it@tripi.vn>
Co-authored-by: Ville Brofeldt <ville.v.brofeldt@gmail.com>
2022-05-16 09:50:20 +03:00
Jesse Yang 6139057dcf
test: make tabbed dashboard a little more complex (#19966) 2022-05-13 17:31:23 -07:00
Hugh A. Miles II 21c5b26fc8
feat(sip-68): Add DatasourceDAO class to manage querying different datasources easier (#20030)
* restart

* update with enums

* address concerns

* remove any
2022-05-13 12:28:57 -04:00
John Bodley 89a844a40f
fix(reports): Clear last value when state is WORKING (#19941)
* fix(reports): Clear last value when state is WORKING

* Update cbe71abde154_fix_report_schedule_and_log.py

Co-authored-by: John Bodley <john.bodley@airbnb.com>
2022-05-12 21:54:23 -07:00
John Bodley 449d08b25e
fix: Refactor SQL username logic (#19914)
Co-authored-by: John Bodley <john.bodley@airbnb.com>
2022-05-12 21:03:05 -07:00
Beto Dealmeida f2881e5bbd
feat: RLS for SQL Lab (#19999)
* feat: RLS for SQL Lab

* Small fixes

* Pass username to security manager

* Update docstrings

* Add tests

* Remove type from docstring
2022-05-12 11:03:01 -07:00
AAfghahi fd611d7653
refactor: Refactor reports for Charts and Dashboards (#19130)
* bumping shillelagh

* pexdax refactor (#16333)

* refactor progress (#16339)

* fix: Header Actions test refactor (#16336)

* fixed tests

* Update index.tsx

Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>

* code dry (#16358)

* Fetch bug fixed (#16376)

* continued refactoring (#16377)

* pexdax refactor (#16333)

* refactor progress (#16339)

* fix: Header Actions test refactor (#16336)

* fixed tests

* Update index.tsx

Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>

* code dry (#16358)

* Fetch bug fixed (#16376)

* continued refactoring (#16377)

* refactor: Arash/new state report (#16987)

* code dry (#16358)

* pexdax refactor (#16333)

* refactor progress (#16339)

* fix: Header Actions test refactor (#16336)

* fixed tests

* Update index.tsx

Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>

* Fetch bug fixed (#16376)

* continued refactoring (#16377)

* refactor(reports): Arash/refactor reports (#16855)

* pexdax refactor (#16333)

* refactor progress (#16339)

* fix: Header Actions test refactor (#16336)

* fixed tests

* Update index.tsx

Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>

* code dry (#16358)

* Fetch bug fixed (#16376)

* continued refactoring (#16377)

* refactor: Reports - ReportModal (#16622)

* refactoring progress

* removed consoles

* Working, but with 2 fetches

* report pickup

Co-authored-by: Lyndsi Kay Williams <55605634+lyndsiWilliams@users.noreply.github.com>
Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>

* refactor(reports):  Arash/again refactor reports (#16872)

* pexdax refactor (#16333)

* refactor progress (#16339)

* fix: Header Actions test refactor (#16336)

* fixed tests

* Update index.tsx

Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>

* code dry (#16358)

* Fetch bug fixed (#16376)

* continued refactoring (#16377)

* refactor: Reports - ReportModal (#16622)

* refactoring progress

* removed consoles

* Working, but with 2 fetches

* it is still not working

Co-authored-by: Lyndsi Kay Williams <55605634+lyndsiWilliams@users.noreply.github.com>
Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>

* next changes

Co-authored-by: Lyndsi Kay Williams <55605634+lyndsiWilliams@users.noreply.github.com>
Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>

* refactor: Reports code clean 10-29 (#17424)

* Add delete functionality

* Report schema restructure progress

* Fix lint

* Removed console.log

* fix(Explore): Remove changes to the properties on cancel (#17184)

* Remove on close

* Fix lint

* Add tests

* fix(dashboard): don't show report modal for anonymous user (#17106)

* Added sunburst echart

* fix(dashboard):Hide reports modal for anonymous users

* Address comments

* Make prettier happy

Co-authored-by: Mayur <mayurp@kpmg.com>

* fix(explore): Metric control breaks when saved metric deleted from dataset (#17503)

* Add functionality is now working (#17578)

* Preset io ch28954 refactor reports (#19129)

* pexdax refactor (#16333)

* refactor progress (#16339)

* fix: Header Actions test refactor (#16336)

* fixed tests

* Update index.tsx

Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>

* code dry (#16358)

* Fetch bug fixed (#16376)

* continued refactoring (#16377)

* pexdax refactor (#16333)

* refactor progress (#16339)

* fix: Header Actions test refactor (#16336)

* fixed tests

* Update index.tsx

Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>

* code dry (#16358)

* Fetch bug fixed (#16376)

* continued refactoring (#16377)

* refactor: Arash/new state report (#16987)

* code dry (#16358)

* pexdax refactor (#16333)

* refactor progress (#16339)

* fix: Header Actions test refactor (#16336)

* fixed tests

* Update index.tsx

Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>

* Fetch bug fixed (#16376)

* continued refactoring (#16377)

* refactor(reports): Arash/refactor reports (#16855)

* pexdax refactor (#16333)

* refactor progress (#16339)

* fix: Header Actions test refactor (#16336)

* fixed tests

* Update index.tsx

Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>

* code dry (#16358)

* Fetch bug fixed (#16376)

* continued refactoring (#16377)

* refactor: Reports - ReportModal (#16622)

* refactoring progress

* removed consoles

* Working, but with 2 fetches

* report pickup

Co-authored-by: Lyndsi Kay Williams <55605634+lyndsiWilliams@users.noreply.github.com>
Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>

* refactor(reports):  Arash/again refactor reports (#16872)

* pexdax refactor (#16333)

* refactor progress (#16339)

* fix: Header Actions test refactor (#16336)

* fixed tests

* Update index.tsx

Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>

* code dry (#16358)

* Fetch bug fixed (#16376)

* continued refactoring (#16377)

* refactor: Reports - ReportModal (#16622)

* refactoring progress

* removed consoles

* Working, but with 2 fetches

* it is still not working

Co-authored-by: Lyndsi Kay Williams <55605634+lyndsiWilliams@users.noreply.github.com>
Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>

* next changes

Co-authored-by: Lyndsi Kay Williams <55605634+lyndsiWilliams@users.noreply.github.com>
Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>

* refactor: Reports code clean 10-29 (#17424)

* Add delete functionality

* Report schema restructure progress

* Fix lint

* Removed console.log

* fix(Explore): Remove changes to the properties on cancel (#17184)

* Remove on close

* Fix lint

* Add tests

* fix(dashboard): don't show report modal for anonymous user (#17106)

* Added sunburst echart

* fix(dashboard):Hide reports modal for anonymous users

* Address comments

* Make prettier happy

Co-authored-by: Mayur <mayurp@kpmg.com>

* fix(explore): Metric control breaks when saved metric deleted from dataset (#17503)

* Add functionality is now working (#17578)

* refactoring reports

* ready for review

* added testing

* removed user reducer

* elizabeth suggestions

Co-authored-by: Lyndsi Kay Williams <55605634+lyndsiWilliams@users.noreply.github.com>
Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>
Co-authored-by: Geido <60598000+geido@users.noreply.github.com>
Co-authored-by: Mayur <mayurnewase111@gmail.com>
Co-authored-by: Mayur <mayurp@kpmg.com>
Co-authored-by: Kamil Gabryjelski <kamil.gabryjelski@gmail.com>

* deleted additional folder

* fixing tests

* all but styling

* bumping shillelagh

* pexdax refactor (#16333)

* refactor progress (#16339)

* fix: Header Actions test refactor (#16336)

* fixed tests

* Update index.tsx

Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>

* code dry (#16358)

* Fetch bug fixed (#16376)

* continued refactoring (#16377)

* pexdax refactor (#16333)

* refactor progress (#16339)

* fix: Header Actions test refactor (#16336)

* fixed tests

* Update index.tsx

Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>

* code dry (#16358)

* Fetch bug fixed (#16376)

* continued refactoring (#16377)

* refactor: Arash/new state report (#16987)

* code dry (#16358)

* pexdax refactor (#16333)

* refactor progress (#16339)

* fix: Header Actions test refactor (#16336)

* fixed tests

* Update index.tsx

Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>

* Fetch bug fixed (#16376)

* continued refactoring (#16377)

* refactor(reports): Arash/refactor reports (#16855)

* pexdax refactor (#16333)

* refactor progress (#16339)

* fix: Header Actions test refactor (#16336)

* fixed tests

* Update index.tsx

Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>

* code dry (#16358)

* Fetch bug fixed (#16376)

* continued refactoring (#16377)

* refactor: Reports - ReportModal (#16622)

* refactoring progress

* removed consoles

* Working, but with 2 fetches

* report pickup

Co-authored-by: Lyndsi Kay Williams <55605634+lyndsiWilliams@users.noreply.github.com>
Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>

* refactor(reports):  Arash/again refactor reports (#16872)

* pexdax refactor (#16333)

* refactor progress (#16339)

* fix: Header Actions test refactor (#16336)

* fixed tests

* Update index.tsx

Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>

* code dry (#16358)

* Fetch bug fixed (#16376)

* continued refactoring (#16377)

* refactor: Reports - ReportModal (#16622)

* refactoring progress

* removed consoles

* Working, but with 2 fetches

* it is still not working

Co-authored-by: Lyndsi Kay Williams <55605634+lyndsiWilliams@users.noreply.github.com>
Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>

* next changes

Co-authored-by: Lyndsi Kay Williams <55605634+lyndsiWilliams@users.noreply.github.com>
Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>

* refactor: Reports code clean 10-29 (#17424)

* Add delete functionality

* Report schema restructure progress

* Fix lint

* Removed console.log

* fix(Explore): Remove changes to the properties on cancel (#17184)

* Remove on close

* Fix lint

* Add tests

* fix(dashboard): don't show report modal for anonymous user (#17106)

* Added sunburst echart

* fix(dashboard):Hide reports modal for anonymous users

* Address comments

* Make prettier happy

Co-authored-by: Mayur <mayurp@kpmg.com>

* fix(explore): Metric control breaks when saved metric deleted from dataset (#17503)

* Add functionality is now working (#17578)

* Preset io ch28954 refactor reports (#19129)

* pexdax refactor (#16333)

* refactor progress (#16339)

* fix: Header Actions test refactor (#16336)

* fixed tests

* Update index.tsx

Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>

* code dry (#16358)

* Fetch bug fixed (#16376)

* continued refactoring (#16377)

* pexdax refactor (#16333)

* refactor progress (#16339)

* fix: Header Actions test refactor (#16336)

* fixed tests

* Update index.tsx

Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>

* code dry (#16358)

* Fetch bug fixed (#16376)

* continued refactoring (#16377)

* refactor: Arash/new state report (#16987)

* code dry (#16358)

* pexdax refactor (#16333)

* refactor progress (#16339)

* fix: Header Actions test refactor (#16336)

* fixed tests

* Update index.tsx

Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>

* Fetch bug fixed (#16376)

* continued refactoring (#16377)

* refactor(reports): Arash/refactor reports (#16855)

* pexdax refactor (#16333)

* refactor progress (#16339)

* fix: Header Actions test refactor (#16336)

* fixed tests

* Update index.tsx

Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>

* code dry (#16358)

* Fetch bug fixed (#16376)

* continued refactoring (#16377)

* refactor: Reports - ReportModal (#16622)

* refactoring progress

* removed consoles

* Working, but with 2 fetches

* report pickup

Co-authored-by: Lyndsi Kay Williams <55605634+lyndsiWilliams@users.noreply.github.com>
Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>

* refactor(reports):  Arash/again refactor reports (#16872)

* pexdax refactor (#16333)

* refactor progress (#16339)

* fix: Header Actions test refactor (#16336)

* fixed tests

* Update index.tsx

Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>

* code dry (#16358)

* Fetch bug fixed (#16376)

* continued refactoring (#16377)

* refactor: Reports - ReportModal (#16622)

* refactoring progress

* removed consoles

* Working, but with 2 fetches

* it is still not working

Co-authored-by: Lyndsi Kay Williams <55605634+lyndsiWilliams@users.noreply.github.com>
Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>

* next changes

Co-authored-by: Lyndsi Kay Williams <55605634+lyndsiWilliams@users.noreply.github.com>
Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>

* refactor: Reports code clean 10-29 (#17424)

* Add delete functionality

* Report schema restructure progress

* Fix lint

* Removed console.log

* fix(Explore): Remove changes to the properties on cancel (#17184)

* Remove on close

* Fix lint

* Add tests

* fix(dashboard): don't show report modal for anonymous user (#17106)

* Added sunburst echart

* fix(dashboard):Hide reports modal for anonymous users

* Address comments

* Make prettier happy

Co-authored-by: Mayur <mayurp@kpmg.com>

* fix(explore): Metric control breaks when saved metric deleted from dataset (#17503)

* Add functionality is now working (#17578)

* refactoring reports

* ready for review

* added testing

* removed user reducer

* elizabeth suggestions

Co-authored-by: Lyndsi Kay Williams <55605634+lyndsiWilliams@users.noreply.github.com>
Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>
Co-authored-by: Geido <60598000+geido@users.noreply.github.com>
Co-authored-by: Mayur <mayurnewase111@gmail.com>
Co-authored-by: Mayur <mayurp@kpmg.com>
Co-authored-by: Kamil Gabryjelski <kamil.gabryjelski@gmail.com>

* deleted additional folder

* fixing tests

* all but styling

* fixed tests

Co-authored-by: Lyndsi Kay Williams <55605634+lyndsiWilliams@users.noreply.github.com>
Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>
Co-authored-by: Geido <60598000+geido@users.noreply.github.com>
Co-authored-by: Mayur <mayurnewase111@gmail.com>
Co-authored-by: Mayur <mayurp@kpmg.com>
Co-authored-by: Kamil Gabryjelski <kamil.gabryjelski@gmail.com>
2022-05-11 14:19:51 -04:00
Daniel Vaz Gaspar 87a4379d0a
feat: deprecate /superset/validate_sql_json migrate to api v1 (#19935)
* feat: deprecate /superset/validate_sql_json migrate to api v1

* use new error handling

* migrate SQLLAb frontend and add tests

* debug test

* debug test

* fix frontend test on sqllab

* fix tests

* fix frontend test on sqllab

* fix tests

* fix tests

* fix tests

* fix tests
2022-05-10 21:25:39 +01:00
Jesse Yang 7b88ec7e25
refactor(ReportModal): simplify state reducer and improve error handling (#19942) 2022-05-05 10:06:40 -07:00
Elizabeth Thompson 060b5c0e17
chore: remove druid datasource from the config (#19770)
* remove druid datasource from the config

* remove config related references to DruidDatasource

* Update __init__.py

* Update __init__.py

* Update manager.py

* remove config related references to DruidDatasource

* raise if instance type is not valid
2022-05-04 12:48:48 -07:00
Daniel Vaz Gaspar 4fdf230a56
feat: deprecate /superset/extra_table_metadata migrate to api v1 (#19921)
* feat: deprecate /superset/extra_table_metadata migrate to api v1

* use can_read to table_extra_metadata

* troubleshoot sqlite

* fix test

* fix test

* fix test

* fix frontend test on sqllab
2022-05-04 14:55:52 +01:00
Yeachan Park 8b72354654
fix(sqllab/charts): casting from timestamp[us] to timestamp[ns] would result in out of bounds timestamp (#18873)
* fix casting from timestamp[us] to timestamp[ns] would result in out of bounds timestamp from sqllab and charts

* Add unittests

* Lint changes and parameter variable rename

* Fix linting
2022-05-04 09:47:12 +03:00
David Aaron Suddjian 7f8279b4b3
chore: get embedded user with roles and permissions (#19813)
* feat: get user roles endpoint

* add tests

* fix test

* get user with permission and roles with full user

* frontend

* type juggling

* the hash slinging slasher

* user reducer and action

* make it happy

* result

* lint

Co-authored-by: Lily Kuang <lily@preset.io>
2022-05-03 12:58:06 -07:00
Beto Dealmeida 90130e4b4f
feat: simplify SQLite time grain (#19745) 2022-05-03 07:13:33 -07:00
Ville Brofeldt 99f1f9ec61
fix(sqla): replace custom dttm type with literal_column (#19917) 2022-05-03 07:19:36 +03:00
Beto Dealmeida 1ebdaac487
fix: memoize primitives (#19930) 2022-05-02 14:50:56 -07:00
Beto Dealmeida aff10a7fad
feat: simplify memoized_func (#19905) 2022-04-29 15:55:58 -07:00
Hugh A. Miles II 8b15b68979
fix: Alpha should not be able to edit datasets that they don't own (#19854)
* fix api for checking owners

* fix styles for disabling

* fix styles for disabling

* fix lint

* fix lint

* add owners key

* plzz

* remove

* update test

* add tooltip

* add type

* fix test

* fix user reference

* lit

* fix test

* work
2022-04-29 14:21:05 -07:00
Phillip Kelley-Dotson ad715429f9
chore: simplify error messaging in database modal (#19165)
* testing for dbconn modal error message

* remove consoles and error alert mapping

* lint fix

* update url message

* add modal fix

* update comments

* fix err msg bugs

* fix pylint

* fix line

* fix tests

* fix assertions
2022-04-21 12:44:21 -07:00
Yongjie Zhao 3c28cd4625
feat: add renameOperator (#19776) 2022-04-20 19:48:12 +08:00
Jesse Yang 231716cb50
perf: refactor SIP-68 db migrations with INSERT SELECT FROM (#19421) 2022-04-19 18:58:18 -07:00
Hugh A. Miles II a6f46013d9
feat: 10/15/30 min grain to Pinot (#19724)
* add new grains to pinot

* update test
2022-04-19 11:16:48 -07:00
Hugh A. Miles II 7e92340c70
fix: Fix migration for removing time_range_endpoints 3 (#19767)
* fix migration

* so dumb

* update test

* add code change

* retest
2022-04-19 09:49:50 -07:00
AAfghahi 57157c8b15
fix: remove expose (#19700)
* bumping shillelagh

* remove expose
2022-04-16 22:02:23 -07:00
David Aaron Suddjian ae70212df3
fix: deactivate embedding on a dashboard (#19626)
* fix tests

* commit it properly

* unnecessary commit, correct type in docstring

* unused import
2022-04-15 16:15:27 -07:00
Hugh A. Miles II 86642025ba
fix: Removetime_range_endpoints from query context object pt 2 (#19728) 2022-04-15 13:17:05 -04:00
Yongjie Zhao 9425dd2cac
fix: drop the first level of MultiIndex (#19716) 2022-04-14 23:40:38 +08:00
Lily Kuang 224769bd45
feat(embedded): API get embedded dashboard config by uuid (#19650)
* feat(embedded): get embedded dashboard config by uuid

* add tests and validation

* remove accidentally commit

* fix tests
2022-04-12 15:14:08 -07:00
Yongjie Zhao d7dd4119d4
fix: time comparision (#19659) 2022-04-12 18:19:22 +08:00
AAfghahi 4bf4d58423
fix: update Permissions for right nav (#19051)
* draft pr

* finished styling

* add filter

* added testing

* added tests

* added permissions tests

* Empty-Commit

* new test

* Update superset-frontend/src/views/components/MenuRight.tsx

Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>

* revisions

* added to CRUD view

Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>
2022-04-11 16:50:59 -04:00
Jesse Yang b45f89b954
refactor: consistent migration tests organization (#19635) 2022-04-09 07:50:52 -07:00
Jesse Yang ce2bd98442
test: freeze time for dashboard export test (#19634) 2022-04-09 07:49:39 -07:00
Jesse Yang 738bd04b4f
fix(test): make test_clean_requests_after_schema_grant more idempotent (#19625) 2022-04-09 07:48:37 -07:00
Ville Brofeldt 9a9e3b6e3b
test(jinja): refactor to functional tests (#19606) 2022-04-08 20:32:38 +03:00
Daniel Vaz Gaspar d6d2777ada
feat: deprecate old API and create new API for dashes created by me (#19434)
* feat: deprecate old API and create new API for dashes created by me

* add tests

* fix previous test

* fix test and lint

* fix sqlite test

* fix lint

* fix lint

* lint

* fix tests

* fix tests

* use dashboards get list instead

* clean unnecessary marshmallow schema

* Update superset/views/core.py

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

* lint

Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
2022-04-08 09:05:22 +01:00
Beto Dealmeida 83c3779a6c
feat: add a `where_in` filter for Jinja2 (#19574) 2022-04-07 07:27:23 -07:00
Elizabeth Thompson aa419b8119
fix: check type of url before performing string actions (#19569)
* ensure url is a string

* return url if param is a url
2022-04-06 17:32:10 -07:00
Craig Rueda f64d654de3
chore(database): Creating helper make_url_safe to wrap potential errors (#19526)
* Creating helper make_url_safe to wrap potential errors

* Fixing imports

* Fixing imports again

* Adding comment

* Linting

* Fixing test

* Fixing test again...

* Fixing import
2022-04-05 11:17:30 -07:00
Inclusive Coding Bot 5861bd399f
chore: Switch to gender neutral terms (#19460)
* Switch to gender neutral terms

* Update countries.md

Co-authored-by: inclusive-coding-bot <inclusive-coding-bot@github.com>
2022-04-04 20:17:34 -04:00
Yongjie Zhao a2e921bd03
fix: flaky test for dashboard changed on (#19483) 2022-04-01 16:47:56 +08:00
Yongjie Zhao d954c3df86
fix: can't sync temporal flag on virtual table (#19366) 2022-04-01 16:40:50 +08:00
David Aaron Suddjian ab3770667c
chore!: remove `ROW_LEVEL_SECURITY` feature flag (permanently enable) (#19230)
* permanently turn on rls feature flag

* unused imports

* docs

* docs

* unused import
2022-03-31 14:05:17 -07:00
Beto Dealmeida 6828624f61
feat: improve adhoc SQL validation (#19454)
* feat: improve adhoc SQL validation

* Small changes

* Add more unit tests
2022-03-31 11:55:19 -07:00
James Turton 85e330e94b
fix(drill): specify an SA URL parm of `impersonation_target` for drill+sadrill (#19252)
* Update drill+sadrill to specify an SA URL parm of "impersonation_target".

Sqlalchemy-drill is being updated to support impersonation with the
drill+sadrill driver, where previously it did not.  The way that callers
should specify impersonation matches that for the drill+jdbc driver in that
a SA URL parameter of impersonation_target should be set to the username
of the user to be impersonated, while the stadard SA username and password
should be those of the proxy user.

* Remove lint.

* Address review comments.

* Use idiomatic pytest to test for a raised exception.

* Fix import statement order in drill.py.
2022-03-31 19:42:27 +03:00
David Aaron Suddjian 8e29ec5a66
feat: Embedded dashboard configuration (#19364)
* embedded dashboard model

* embedded dashboard endpoints

* DRY up using the with_dashboard decorator elsewhere

* wip

* check feature flags and permissions

* wip

* sdk

* urls

* dao option for id column

* got it working

* Update superset/embedded/view.py

* use the curator check

* put back old endpoint, for now

* allow access by either embedded.uuid or dashboard.id

* keep the old endpoint around, for the time being

* openapi

* lint

* lint

* lint

* test stuff

* lint, test

* typo

* Update superset-frontend/src/embedded/index.tsx

* Update superset-frontend/src/embedded/index.tsx

* fix tests

* bump sdk
2022-03-30 12:34:05 -07:00
Daniel Vaz Gaspar fa35109bf2
fix: add missing init on python pkg key_value (#19428)
* fix: add missing init on python pkg key_value

* fix lint issues

* fix lint issues
2022-03-30 12:46:42 +01:00
Beto Dealmeida 63b5e2e4fa
perf: improve perf in SIP-68 migration (#19416)
* chore: improve perf in SIP-68 migration

* Small fixes

* Create tables referenced in SQL

* Update logic in SqlaTable as well

* Fix unit tests
2022-03-29 22:33:15 -07:00
Phillip Kelley-Dotson 0968f86584
chore: remove deprecated config keys and endpoints code 2.0 (#19361)
* remove depracted keys and associated methods

* remove api methods and tablemodel views

* remove deprecated api and unsued vars

* reremove schedules

* readd code

* fix pylint

* run black

* remove test

* core select start test

* add suggested changes
2022-03-29 13:23:05 -07:00
Ville Brofeldt a619cb4ea9
chore: upgrade black (#19410) 2022-03-29 20:03:09 +03:00
Beto Dealmeida d304849b46
feat: disable edits on external assets (#19344)
* feat: disable edits on external assets

* Update tests
2022-03-28 16:32:57 -07:00
Yongjie Zhao a39dd4493e
feat: linear imputation in Resample (#19393) 2022-03-28 22:30:45 +08:00
Phillip Kelley-Dotson 394c9a19fd
chore: remove old alerts and configs keys (#19261)
* remove templates

* remove models and more templates

* remove view

* remove tasks

* remove views

* remove schedule models

* remove views, init files config code

* remove supersetapp init code

* remove tests and clean up pylint errors

* remove unused import

* pylint

* run black

* remove deprecate notice
2022-03-25 13:25:44 -07:00
Ville Brofeldt f4b71abb22
feat: introduce hashids permalink keys (#19324)
* feat: introduce hashids permalink keys

* implement dashboard permalinks

* remove shorturl notice from UPDATING.md

* lint

* fix test

* introduce KeyValueResource

* make filterState optional

* fix test

* fix resource names
2022-03-24 21:53:09 +02:00
Beto Dealmeida c7f9060a2f
feat: import external management columns (#19315)
* feat: import flags

* Add tests
2022-03-24 10:41:22 -07:00
Daniel Vaz Gaspar f37fc1a7f0
chore: bump majors on celery and Flask (#19168)
* chore: bump celery, Flask, flask-jwt-extended, pyJWT

* fix pyJWT breaking change

* fix pyJWT breaking change 2

* test

* fixed test

* fixed test

* fixed test

* revert since mypy won't pick the correct signature

* lint 1

* fix test

* fix test

* docs and celery config migration

* bump FAB to 4.0.0rc3, remove AUTH_STRICT_RESPONSE_CODES

* update docs for new celery config keys

* downgrade celery to 5.2.2

* ref FAB to final 4.0.0 release

* remove conflict left over
2022-03-24 09:16:53 +00:00
Yongjie Zhao 375c03e084
feat(advanced analysis): support MultiIndex column in post processing stage (#19116) 2022-03-23 13:46:28 +08:00
Beto Dealmeida b05e7dbf2a
feat: API for asset sync (#19220)
* feat: API for asset sync

* Add unit tests.

* Improve tests

* Move files

* Add more tests
2022-03-22 08:29:24 -07:00
Ville Brofeldt 72b9a7fa5b
feat(key-value): add superset metastore cache (#19232) 2022-03-21 19:46:56 +02:00
John Bodley 82a6811e7e
fix(presto/trino): Add TIME/TIMESTAMP WITH TIME ZONE (#19263)
Co-authored-by: John Bodley <john.bodley@airbnb.com>
2022-03-22 06:33:38 +13:00
Elizabeth Thompson 88029e21b6
fix dataset update table (#19269) 2022-03-21 09:43:51 -07:00
PApostol c07a707eab
Various docstring fixes (#18221) 2022-03-21 13:01:57 -03:00
Stephen Liu dc575080d7
feat: improve color consistency (save all labels) (#19038) 2022-03-21 15:20:04 +08:00
Elizabeth Thompson d645579cdd
chore!: update mutator to take kwargs (#19083)
* update mutator to take kwargs

* update updating.md

* lint

* test that the database name is properly passed in to the mutator
2022-03-18 16:01:27 -07:00
Ville Brofeldt f341025d80
feat: add support for comments in adhoc clauses (#19248)
* feat: add support for comments in adhoc clauses

* sanitize remaining freeform clauses

* sanitize adhoc having in frontend

* address review comment
2022-03-18 15:08:06 -07:00
David Aaron Suddjian 97abc28a1f
chore!: remove `ENABLE_REACT_CRUD_VIEWS` feature flag (permanently enable) (#19231)
* remove ENABLE_REACT_CRUD_VIEWS feature flag

* docs

* deal with problematic tests

* empty test suite

* skip test

* test conditions changed

* removing the tests instead of skipping
2022-03-18 14:00:23 -07:00
Lily Kuang 50902d51f5
fix: allow subquery in ad-hoc SQL (WIP) (#19242)
* allow adhoc subquery

* add config for allow ad hoc subquery

* default to true allow adhoc subquery

* fix test

* Update superset/errors.py

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>

* Update superset/connectors/sqla/utils.py

Co-authored-by: David Aaron Suddjian <1858430+suddjian@users.noreply.github.com>

* rename and add doc string

* fix for big query test

* Update superset/connectors/sqla/utils.py

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>

* Apply suggestions from code review

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>

* add test

* update validate adhoc subquery

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
Co-authored-by: David Aaron Suddjian <1858430+suddjian@users.noreply.github.com>
2022-03-18 10:04:55 -07:00
Yongjie Zhao b5e9fad11a
fix: adhoc column in legacy chart (#19234) 2022-03-18 14:05:30 +08:00
Jesse Yang f6291545fb
chore: turn on SQLLAB_BACKEND_PERSISTENCE by default (#19107)
* chore: turn on SQLLAB_BACKEND_PERSISTENCE by default

* Rewrite SQL tabs test to make it more rerunnable
2022-03-17 21:51:47 -07:00
Beto Dealmeida 51061f0d67
feat: import/export assets commands (#19217)
* feat: import/export assets commands

* Add overwrite test

* Fix tests
2022-03-17 10:51:17 -07:00
AAfghahi c345029fbc
chore!: turn on Versioned Export in config.py (#19142)
* turning off versioned export

* deleted two tests that required version export false

* added tests

* test suggestions
2022-03-17 13:32:50 -04:00
Craig Rueda 4b34817b19
feat(ui): Adding manifest prefix config (#19141)
* Adding manifest prefix config

* Fixing broken tests

* Fixing import

* Adding prefix for remaining assets

* Changing static prefix strategy

* Fixing DST test

* Fixing up formatting

* Fixing up async_query_manager.py types
2022-03-17 08:58:48 -07:00
cccs-Dustin 02ef9ca4cd
feat(sqllab): Add a configuration option to disable data preview (#19104) 2022-03-17 15:22:57 +02:00
Yongjie Zhao e4c9a0d8ae
fix: time filter should be [start, end) (#19166) 2022-03-17 10:02:50 +08:00
Ville Brofeldt b7a0559aaf
feat: add permalink to dashboard and explore (#19078)
* rename key_value to temporary_cache

* add migration

* create new key_value package

* add commands

* lots of new stuff

* fix schema reference

* remove redundant filter state from bootstrap data

* add missing license headers

* fix pylint

* fix dashboard permalink access

* use valid json mocks for filter state tests

* fix temporary cache tests

* add anchors to dashboard state

* lint

* fix util test

* fix url shortlink button tests

* remove legacy shortner

* remove unused imports

* fix js tests

* fix test

* add native filter state to anchor link

* add UPDATING.md section

* address comments

* address comments

* lint

* fix test

* add utils tests + other test stubs

* add key_value integration tests

* add filter box state to permalink state

* fully support persisting url parameters

* lint, add redirects and a few integration tests

* fix test + clean up trailing comma

* fix anchor bug

* change value to LargeBinary to support persisting binary values

* fix urlParams type and simplify urlencode

* lint

* add optional entry expiration

* fix incorrect chart id + add test
2022-03-17 01:15:52 +02:00
Beto Dealmeida d01fdad1d8
feat: add export_related flag (#19215)
* feat: add export_related flag

* Fix lint
2022-03-16 16:03:06 -07:00
David Aaron Suddjian 54b60ded8e
chore(embedded): refresh the guest token (#19132)
* refresh the guest token

* put back the date logic

* version

* fix time hijinks

* test

* Update superset-embedded-sdk/src/guestTokenRefresh.ts
2022-03-14 09:32:25 -07:00
Beto Dealmeida 8234395466
feat: helper functions for RLS (#19055)
* feat: helper functions for RLS

* Add function to inject RLS

* Add UNION tests

* Add tests for schema

* Add more tests; cleanup

* has_table_query via tree traversal

* Wrap existing predicate in parenthesis

* Clean up logic

* Improve table matching
2022-03-11 14:47:11 -08:00
Ville Brofeldt 999c2c6826
fix(dashboard): import handle missing excluded charts (#19088) 2022-03-10 12:59:29 +02:00
Elizabeth Thompson c143b37128
chore: log multiple errors (#14064)
* log all errors from db create

* return unique set of errors

* sort set for exceptions list

* run black
2022-03-08 17:31:19 -08:00
Karthikeyan Singaravelan 864bafc655
chore: Fix deprecated unittest aliases. (#19042) 2022-03-07 09:38:19 +02:00
Hugh A. Miles II 8c52fe3476
feat: Allow users to bust cache in report dashboard + alerts charts + alert dashboards (#18795)
* wip

* add force cahce bypass option to alerts

* remove default for alerts to bypass cache

* save for now

* save for now

* fix

* commenting out for now

* fix linting

* remove link

* add back force id test

* add frontend test

* address
2022-03-04 12:30:40 -08:00
John Bodley 26486d01c1
chore: Remove legacy SIP-15 interim logic/flags (#18936)
* chore: Remove legacy SIP-15 logic

* Update ab9a9d86e695_deprecate_time_range_endpoints.py

* Update UPDATING.md

* Update UPDATING.md

* Update UPDATING.md

Co-authored-by: John Bodley <john.bodley@airbnb.com>
2022-03-04 09:15:36 +13:00
Ville Brofeldt a04f1d4c87
chore(cache): default to SimpleCache in debug mode (#18976)
* chore(cache): default to SimpleCache in debug mode

* lint

* clean up type

* use util

* fix integration test cache configs

* remove util from cache manager

* remove trailing comma

* fix more tests

* fix truthiness check

* fix tests and improve deprecation notice

* fix default cache threshold

* move debug check to cache_manager

* remove separate getter

* update docs

* remove default cache config
2022-03-02 19:38:34 +02:00
Ville Brofeldt bd63a1bd98
fix(chart): deprecate persisting url_params (#18960)
* fix(chart): deprecate peristing url_params

* remove duplicated backend logic

* use omitBy

* simplify omit
2022-03-02 07:44:36 +02:00
Craig Rueda 5fc7adb55b
fix(packages): Fixing users packages (#18973)
* Fixing users packages

* Linting me() fn

* Fixing tests / moving packages

* Fixing imports
2022-03-01 09:47:13 -08:00
serenajiang 760dab9abd
feat(TimeTableViz): sort by first metric (#18896) 2022-02-28 10:26:24 -08:00
John Bodley 099421770c
fix: bump Helm chart release version (#18751) (#18758)
Co-authored-by: wiktor2200 <wiktor2200@users.noreply.github.com>
2022-02-26 07:12:04 +13:00
Beto Dealmeida 00c99c91ec
feat: new dataset/table/column models (#17543)
* feat: new models for SIP-68

* feat: new dataset models DB migration

* Add shadow write (WIP)

* Physical dataset shadow write (WIP)

* Virtual dataset shadow write (WIP)

* Update migration to populate models

* Cascade delete columns

* after_delete

* Update hook

* Add metric test

* Do not rename tables

* Small fixes

* Fix migration

* Fix tests

* Fix more tests

* Even more tests

* Addressing comments (WIP)

* Fix migration

* Rebase and update head

* Fix unit tests

* Add external management cols

* Small fixes
2022-02-24 11:02:01 -08:00
David Aaron Suddjian da3bc48803
feat: On window focus, redirect to login if the user has been logged out (#18773)
* /me api

* test it

* watch for window activation and check auth

* simplify

* more comment

* making ci happy

* mypy should ignore tests
2022-02-24 10:09:41 -08:00
Corbin Robb 0ae1ca7e02
chore(tests-backend): migrate snowflake and sqlite to unit tests (#18854)
* migrate snowflake and sqlite

* change structure to better match the other unit tests

Co-authored-by: Corbin Robb <corbin@Corbins-MacBook-Pro.local>
2022-02-23 11:11:10 -06:00
Sujith Kumar S 7e51b200b4
fix(mssql): support top syntax for limiting queries (#18746)
* SQL-TOP Fix For Database Engines

MSSQL is not supporting LIMIT syntax in SQLs. For limiting the rows, MSSQL having a different keyword TOP. Added fixes for handling the TOP and LIMIT clauses based on the database engines.

* Teradata code for top clause handling removed from teradata.py

Teradata code for top clause handling removed from teradata.py file, since we added generic section in base engine for the same.

* Changes to handle CTE along with TOP in complex SQLs

Added changes to handle TOP command in CTEs, for DB Engines which are not supporting inline CTEs.

* Test cases for TOP unit testing in MSSQL

Added multiple unit test cases for MSSQL top command handling and also along with CTEs

* Corrected the select_keywords name key in basengine

Corrected the select_keywords name key in basengine

* Changes based on as per review.

made the required corrections based on code review to keep good code readability and code cleanliness.

* Review changes to correct lint and typo issues

Made the changes according to the review comments.

* fix linting errors

* fix teradata tests

* add coverage

* lint

* Code cleanliness

Moved the top/limit flag check from sql_lab to core.

* Changed for code cleanliness

Changes for keeping code cleanliness

* Corrected lint issue

Corrected lint issue.

* Code cleanliness

Code cleanliness

Co-authored-by: Ville Brofeldt <ville.v.brofeldt@gmail.com>
2022-02-21 09:58:39 +02:00
Yongjie Zhao 987740aa8d
fix: contribution operator meets nan value (#18782) 2022-02-18 23:28:28 +08:00
Yongjie Zhao 38cd696981
refactor: move date_parser to unittest (#18810) 2022-02-18 20:15:31 +08:00
Hugh A. Miles II 5d2e726f76
fix: update standalone url for slack reports (#18756)
* update url for slack reports

* fix test

* update text to be dynamic
2022-02-17 15:48:57 -05:00
Yongjie Zhao 30a9d14639
refactor: postprocessing move to unit test (#18779) 2022-02-17 20:05:41 +08:00
Phillip Kelley-Dotson 2421d176a2
chore: move data nav menu to plus menu (#18629)
* more data nav menu

* fix lint and fix nav css

* update test and remove icons

* Update superset-frontend/src/views/components/Menu.test.tsx

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

* Apply suggestions from code review

* use backend app.link to show new nav changes

* fix lint

* update test

* usetheme and remove chaining

* add more suggestions

* fix lint

* add allowed extensions to bootstrap and hard code links

* remove backend links

* fix test

* add extensions to frontend conf

* fix test and add be changes

* test is python test passes

* update python test and reremove app links

* fix ts and add t's

Co-authored-by: Hugh A. Miles II <hughmil3s@gmail.com>
2022-02-16 17:37:14 -08:00
Grace Guo 59b811ac5b
fix: report list search by created_by (#18725) 2022-02-15 19:37:17 -08:00
Lily Kuang b2613f648c
feat(embedded): make guest token JWT audience callable or str (#18748)
* feat(embedded): make guest token JWT audience callable

* reset GUEST_TOKEN_JWT_AUDIENCE after test

* helper method for get audience
2022-02-15 17:47:32 -08:00
Michael S. Molina 48a80950de
feat: Improve state key generation for dashboards and charts (#18576)
* feat: Improve state key generation for dashboards and charts
2022-02-14 17:09:06 -03:00
Lily Kuang e6ea197e9f
feat(embedded): aud claim and type for guest token (#18651)
* add aud claim and type for guest token

* update test

* lint

* make jwt audience configurable

* lint

* Apply suggestions from code review

Co-authored-by: David Aaron Suddjian <1858430+suddjian@users.noreply.github.com>

* verify aud

* add tests for aud and type claim

Co-authored-by: David Aaron Suddjian <1858430+suddjian@users.noreply.github.com>
2022-02-14 10:43:35 -08:00
Sujith Kumar S b8aef10098
fix(mssql): support cte in virtual tables (#18567)
* Fix for handling regular CTE queries with MSSQL,#8074

* Moved the get_cte_query function from mssql.py to base.py for using irrespetcive of dbengine

* Fix for handling regular CTE queries with MSSQL,#8074

* Moved the get_cte_query function from mssql.py to base.py for using irrespetcive of dbengine

* Unit test added for the db engine CTE SQL parsing.

Unit test added for the db engine CTE SQL parsing.  Removed additional spaces from the CTE parsing SQL generation.

* implement in sqla model

* lint + cleanup

Co-authored-by: Ville Brofeldt <ville.v.brofeldt@gmail.com>
2022-02-10 10:28:05 +02:00
Victor Arbues 5ee070c402
feat: datasource access to allow more granular access to tables on SQL Lab (#18064) 2022-02-09 22:05:25 +08:00
Ville Brofeldt fdbcbb5c84
fix(csv-export): pivot v2 with verbose names (#18633)
* fix(csv-export): pivot v2 with verbose names

* refine logic + add test

* add missing verbose_map
2022-02-09 14:01:57 +02:00
Hugh A. Miles II 7194a01040
fix: user UUIDs on export for Native Filter Configuration (#18562)
* saving work for import

* update

* move logic to update ref

* remove export updates

* remove unneeded code

* cleanup

* Update superset/dashboards/commands/importers/v1/utils.py

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>

* Update tests/unit_tests/dashboards/commands/importers/v1/utils_test.py

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
2022-02-08 13:10:40 -08:00
Ville Brofeldt 125be78ee6
feat(chart-data-api): download multiple csvs as zip (#18618)
* feat(chart-data-api): download multiple csvs as zip

* break out util

* check for empty request
2022-02-08 14:25:06 -05:00
ofekisr 41f3c95345
feat: log decorator util - adding automatic logs out of the box (#18620)
* feat: add logger utils

* fix bad definitions of under_info and debug_enable

* fix pre-commit
2022-02-08 18:38:57 +02:00
Ville Brofeldt 55cd7fb412
fix(sqla): avoid unnecessary groupby for when no metrics (#18579) 2022-02-04 10:47:47 +02:00
Ville Brofeldt 7ad38d5ba1
chore(tests): migrate mssql tests to pytest (#18251)
* move test

* migrate to pytest
2022-02-02 13:19:58 +02:00
Dave McNulla 8c376548e3
fix(teradata): LIMIT syntax (#18240)
Co-authored-by: Mccush, Jack <jack.mccush@teradata.com>
Co-authored-by: Jack McCush <33156805+mccushjack@users.noreply.github.com>
Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
Co-authored-by: David McNulla <david.mcnulla@teradata.com>
2022-01-31 19:15:42 -08:00
Adam Dobrawy dad6f78419
refactor: extract json_required view decorator (#18170)
* refactor: extract json_required view decorator

* chore: rename json_required to requires_json

* refactor: add requires_form_data decorator and use it

* fix: fix lint issue, raise InvalidPayloadFormatError for invalid payload
2022-01-31 08:53:48 -03:00
Stephen Liu 9671384efe
fix(sql): unable to filter text with quotes (#17881) 2022-01-28 21:49:22 +08:00
Adam Dobrawy 84db896797
Remove walrus operator for Python 3.7 compatiblity (#18205) 2022-01-28 10:03:22 +02:00
cccs-joel 8b83c7fe0a
fix: Assign an owner when creating a dataset from a csv, excel or tabular (#17986)
* Assign an owner when creating a dataset from a csv, excel or columnar

* Added some unit tests

* Code cleanup

* Removed blank line

* Attempt to fix a broken test

* Attempt # 2 to fix a broken test

* Attempt # 3 to fix a broken test

* Attempt # 4 to fix a broken test

* Attempt # 5 to fix a broken test

* Attempt # 6 to fix a broken test

* Broken test fixed, code cleanup
2022-01-27 17:55:20 +02:00
Yongjie Zhao 20b4ae1ef9
fix: null value and empty string in filter (#18171) 2022-01-27 22:58:06 +08:00
AAfghahi fa11a97585
fix: remove standalone (#18157)
* removed standalone

* Update tests/integration_tests/reports/commands_tests.py

* changed standalone

* added tests

* made function more generic

* Update superset/reports/notifications/email.py

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
2022-01-26 13:04:26 -05:00
David Aaron Suddjian 4ad5ad045a
feat: embedded dashboard core (#17530)
* feat(dashboard): embedded dashboard UI configuration (#17175) (#17450)

* setup embedded provider

* update ui configuration

* fix test

* feat: Guest token (for embedded dashboard auth) (#17517)

* generate an embed token

* improve existing tests

* add some auth setup, and rename token

* fix the stuff for compatibility with external request loaders

* docs, standard jwt claims, tweaks

* black

* lint

* tests, and safer token decoding

* linting

* type annotation

* prettier

* add feature flag

* quiet pylint

* apparently typing is a problem again

* Make guest role name configurable

* fake being a non-anonymous user

* just one log entry

* customizable algo

* lint

* lint again

* 403 works now!

* get guest token from header instead of cookie

* Revert "403 works now!"

This reverts commit df2f49a6d4.

* fix tests

* Revert "Revert "403 works now!""

This reverts commit 883dff38f1.

* rename method

* correct import

* feat: entry for embedded dashboard (#17529)

* create entry for embedded dashboard in webpack

* add cookies

* lint

* token message handshake

* guestTokenHeaderName

* use setupClient instead of calling configure

* rename the webpack chunk

* simplified handshake

* embedded entrypoint: render a proper app

* make the embedded page accept anonymous connections

* format

* lint

* fix test
# Conflicts:
#	superset-frontend/src/embedded/index.tsx
#	superset/views/core.py

* lint

* Update superset-frontend/src/embedded/index.tsx

Co-authored-by: David Aaron Suddjian <1858430+suddjian@users.noreply.github.com>

* comment out origins checks

* move embedded for core to dashboard

* pylint

* isort

Co-authored-by: David Aaron Suddjian <aasuddjian@gmail.com>
Co-authored-by: David Aaron Suddjian <1858430+suddjian@users.noreply.github.com>

* feat: Authorizing guest access to embedded dashboards (#17757)

* helper methods and dashboard access

* guest token dashboard authz

* adjust csrf exempt list

* eums don't work that way

* Remove unnecessary import

* move row level security tests to their own file

* a bit of refactoring

* add guest token security tests

* refactor tests

* clean imports

* variable names can be too long apparently

* missing argument to get_user_roles

* don't redefine builtins

* remove unused imports

* fix test import

* default to global user when getting roles

* missing import

* mock it

* test get_user_roles

* infer g.user for ease of tests

* remove redundant check

* tests for guest user security manager fns

* use algo to get rid of warning messages

* tweaking access checks

* fix guest token security tests

* missing imports

* more tests

* more testing and also some small refactoring

* move validation out of parsing

* fix dashboard access check again

* add more test

Co-authored-by: Lily Kuang <lily@preset.io>

* feat: Row Level Security rules for guest tokens (#17836)

* helper methods and dashboard access

* guest token dashboard authz

* adjust csrf exempt list

* eums don't work that way

* Remove unnecessary import

* move row level security tests to their own file

* a bit of refactoring

* add guest token security tests

* refactor tests

* clean imports

* variable names can be too long apparently

* missing argument to get_user_roles

* don't redefine builtins

* remove unused imports

* fix test import

* default to global user when getting roles

* missing import

* mock it

* test get_user_roles

* infer g.user for ease of tests

* remove redundant check

* tests for guest user security manager fns

* use algo to get rid of warning messages

* tweaking access checks

* fix guest token security tests

* missing imports

* more tests

* more testing and also some small refactoring

* move validation out of parsing

* fix dashboard access check again

* rls rules for guest tokens

* test guest token rls rules

* more flexible rls rules

* lint

* fix tests

* fix test

* defaults

* fix some tests

* fix some tests

* lint

Co-authored-by: Lily Kuang <lily@preset.io>

* SupersetClient guest token test

* Apply suggestions from code review

Co-authored-by: Lily Kuang <lily@preset.io>

Co-authored-by: Lily Kuang <lily@preset.io>
2022-01-25 16:41:32 -08:00
cccs-Dustin 2dd64f9a93
fix(import_datasources): --sync flag works correctly (#18046)
* Added code that properly accepts the -s flag on the import-datasources cli command. Also added unit tests for all of the edge cases (with both metrics & columns, with just columns, and with just metrics)

* Files were reformated using the 'pre-commit run --all-files' command

* added '*args: Any' back into v0.py as it did not need to be removed. Removing it might cause headaches for someone trying to work on this particular piece of code in the future

* Fixed the merge conflict as the cli.py was moved to another directory

* Modified my created unit tests to work with the new format of uni tests since the merge

* Modified my created unit tests to work with the new format of uni tests since the merge

* Fixed errors which were encountered while using the unit tests
2022-01-25 15:53:44 +01:00
Michael S. Molina f018c826b8
refactor: Moves the Explore form_data endpoint (#18151)
* refactor: Moves the Explore form_data endpoint

* Removes unused imports

* Fixes openapi schema error

* Fixes typo

* Renames and UPDATING.md
2022-01-25 11:14:50 -03:00
Michael S. Molina 959b15eeca
feat: Adds a key-value endpoint to store charts form data (#17882)
* feat: Adds a key-value endpoint to store charts form data

* Fixes linting problems

* Removes the query_params from the endpoints

* Refactors the commands

* Removes unused imports

* Changes the parameters to use dataclass

* Adds more access tests

* Gets the first dataset while testing

* Adds unit tests for the check_access function

* Changes the can_access check

* Always check for dataset access
2022-01-20 16:27:57 -03:00
Beto Dealmeida 9e2bc72fb9
chore: split CLI into multiple files (#18082)
* chore: split CLI into multiple files

* Update tests

* Who fixes the fixtures?

* Add subcommands dynamically

* Rebase
2022-01-19 11:27:16 -08:00
ofekisr 810cfc13db
fix can't use examples helpers on non app context based environment (#18086) 2022-01-19 20:16:15 +02:00
ofekisr 4675ca31c5
refactor(example_data): replace the way the birth_names data is loaded to DB (#18060)
* refactor: replace the way the birth_names data is loaded to DB

* fix failed unit test

* fix failed unit test

* fix failed tests

* fix pass wrong flag of support datetime type

* remove unused fixture
2022-01-18 23:21:04 +02:00
Yongjie Zhao 0c7f7288d8
feat(advanced analytics): support groupby in resample (#18045) 2022-01-17 18:42:59 +08:00
ofekisr e53a50a155
chore(supeset.utils.core): move all database utils to database utils module (#18058) 2022-01-16 08:32:50 +02:00
Đặng Minh Dũng 0b67fe1beb
feat: Trino Authentications (#17593)
* feat: support Trino Authentications

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

* docs: Trino Authentications

Signed-off-by: Đặng Minh Dũng <dungdm93@live.com>
2022-01-14 21:02:47 -08:00
Erik Ritter 14b9298ef7
fix: revert #17654 to fix subselect table name parsing (#18017) 2022-01-12 21:28:23 -08:00
Beto Dealmeida 51090c3f1b
feat: shorter timeout on test_connection (#18001)
* feat: shorter timeout on test_connection

* pip-compile-multi --no-upgrade

* Fix for SQLite

* Return 408

* Add test
2022-01-12 13:01:34 -08:00
John Bodley 63ca09e345
fix: Workaround for sqlparse issue #652 (#17995)
* fix: Workaround for sqlparse issue #652

* Update superset/sql_parse.py

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

* Update sql_parse.py

Co-authored-by: John Bodley <john.bodley@airbnb.com>
Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
2022-01-12 14:03:56 +13:00
Ajay M bdc35a2214
feat(alerts): Select tabs to send backend (#17749)
* Adding the extra config and validation

* wip

* reports working

* Tests working

* fix type

* Fix lint errors

* Fixing type issues

* add licence header

* fix the fixture deleting problem

* scope to session

* fix integration test

* fix review comments

* fix review comments patch 2

Co-authored-by: Grace Guo <grace.guo@airbnb.com>
2022-01-11 10:48:50 -08:00
ofekisr 7fc6a2f36c
refactor: examples data loading for tests (#17893)
* refactor: replace the way the birth_names data is generated

* refactor: replace the way the birth_names data is generated

* refactor structure
add tests for common
2022-01-11 14:16:09 +02:00
Michael S. Molina 3a9bd12e3d
fix: Returns 404 instead of 500 for unknown dashboard filter state keys (#17878)
* fix: Returns 404 instead of 500 for unknown dashboard filter state keys

* Reduces hierarchies of if-expression

* Removes unnecessary check

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

* Removes unused variable

* Fixes type error

* Removes unused import

Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
2022-01-10 14:24:22 -03:00
Daniel Vaz Gaspar d35da1fc73
fix: css template API response, less data (#17980)
* fix: css template API response, less data

* add test
2022-01-10 13:00:39 +00:00
Mikhail Kumachev d2d4f8eb44
feat: Add support for Azure Data Explorer (Kusto) db engine spec (#17898)
* Add two Kusto engine specs: KQL and SQL. Some minor changes in core code to support Kusto engine specs.

* Remove redundant imports and logging.

* docs: Kusto sqlalchemy docs

* fix: Fix mypy and linting errors

* fix: Handle Black vs Pylint checks

* fix: isort problem

* refactor: Merge kustosql and kustokql in the single kusto module

* test: Add tests for Kusto db spec

* feat: Schema override does not require in KQL anymore

* Removed redundant imports.

* Added ".show" queries to readonly query determination.

* Fixed some bugs.
Added tests for convert_dttm.

* Fixed major sqlalchemy-kusto version.

* Fixed by isort.

Co-authored-by: Eugene Bikkinin <xnegxneg@gmail.com>
Co-authored-by: k.tomak <k.tomak@dodopizza.com>
Co-authored-by: Eugene Bikkinin <e.bikkinin@dodopizza.com>
2022-01-10 14:42:20 +02:00
Amit Miran 4954d52329
ci: make presto hive tests to cover only chartData and sqljson (#17782)
* chore: make presto hive tests to cover only chartData and sqljson

* fix: single quote

* fix: add eval for arguments

* fix: add double quotes on args

* chore: add @pytest.mark.sql_json_flow

* fix: pre-commit
2021-12-31 07:17:54 +02:00
Michael S. Molina 8ebec6016e
fix: Removes duplicated import in dashboard filter state tests (#17887) 2021-12-29 13:10:56 -03:00
ofekisr 886e4ef7f5
fix: tests can failed on different order executions (#17885) 2021-12-29 17:54:12 +02:00
Beto Dealmeida 2cd8054358
feat: add force option to report screenshots (#17853)
* Update existing tests

* Add backend test

* feat: add force option to report screenshots

* Add tests

* Rebase fixes

* Do not force screenshot on dashboard alerts
2021-12-22 12:16:04 -08:00
Beto Dealmeida 30c0459808
fix: extra column in metrics (#17784) 2021-12-22 10:39:29 -08:00
Beto Dealmeida c49545aec1
fix: dataset extra import/export (#17740)
* fix: dataset extra import/export

* Update superset/datasets/commands/importers/v1/utils.py
2021-12-22 09:41:31 -08:00
Beto Dealmeida b7707e8ff7
feat: bypass cache on screenshots for alerts (#17695)
* feat: bypass cache on screenshots for alerts

* Update existing tests

* Add backend test

* Add frontend test
2021-12-22 08:26:38 -08:00
Elizabeth Thompson b82da5c016
accept null params for validation (#17788) 2021-12-17 10:52:00 -08:00