Commit Graph

1224 Commits

Author SHA1 Message Date
Hugh A. Miles II 2e29f36e78
fix: RBAC for export for dashboard viewers (#17527)
* set out export

* update test

* use default dataset

* update test

* these test work

* fix test

* update

* fix

* fix test

* make the test better
2021-11-25 20:10:41 -08:00
aniaan 5a1c68177e
fix(elasticsearch): time_zone setting does not work for cast datetime expressions (#17048)
* fix(elasticsearch): cast does not take effect for time zone settings

* test(elasticsearch): add test

* fix(test): fix typo

* docs(elasticsearch): add annotation

* docs(elasticsearch): add time_zone desc

* docs(elasticsearch): fix typo

* refactor(db_engine): change convert_dttm signature

* fix(test): fix test

* fix(es): add try catch

* fix(test): fix caplog

* fix(test): fix typo
2021-11-25 11:58:44 +02:00
Geido 83e49fc9ee
feat: Certify Charts and Dashboards (#17335)
* Certify charts

* Format

* Certify dashboards

* Format

* Refactor card certification

* Clear details when certified by empty

* Show certification in detail page

* Add RTL tests

* Test charts api

* Enhance integration tests

* Lint

* Fix dashboards count

* Format

* Handle empty value

* Handle empty slice

* Downgrade migration

* Indent

* Use alter

* Fix revision

* Fix revision
2021-11-24 13:42:52 +02:00
Michael S. Molina 76024313c6
fix: Dashboard access when DASHBOARD_RBAC is disabled (#17511)
* fix: Dashboard access when RBAC is disabled

* Sends 403 when forbidden

* Fixes issort

* Changes assertion

* Allow access to unpublished dashboards that don't have roles

* Fixes the test_get_dashboard_changed_on test
2021-11-23 11:45:32 -03:00
Long Le Xich bc855f4040
fix(hive): Update _latest_partition_from_df in HiveEngineSpec to work on tables with multiple indexes (#14302)
* Fix _latest_partition_from_df in HiveEngineSpec

* Add test HiveEngineSpec._latest_partition_from_df

* Fix formatting to pass black

Co-authored-by: Ville Brofeldt <ville.v.brofeldt@gmail.com>
2021-11-23 10:07:47 +02:00
ofekisr 16e012fe5d
refactor(chart.commands): separate commands into two different modules (#17509)
refactor: move imports under TYPE_CHECKING
2021-11-22 19:57:52 +02:00
Kamil Gabryjelski 1f8eff72de
fix: Always use temporal type for dttm columns [ID-2] (#17458)
* fix: Always use temporal type for dttm columns

* move inference and implement in chart postproc

* fix test

* fix test case

Co-authored-by: Ville Brofeldt <ville.v.brofeldt@gmail.com>
2021-11-22 15:40:38 +01:00
ofekisr 66d756955b
refactor(QueryContext): separate all processing concerns into QueryContextProcessor (#17497) 2021-11-22 10:01:01 +02:00
Rafał Ganczarek 8da982bc7c
fix(presto): expand data with null item (#17470)
* fix(presto): expand data with null item

* Fixed pre-commit check
2021-11-21 20:10:35 +02:00
AAfghahi 69c3cc712d
chore(sql_lab): Added Unit Test for stop query exception (#17464)
* added unit test

* feedback implemented
2021-11-19 12:58:12 -05:00
Daniel Vaz Gaspar 69f9ee8f5e
fix: feature flags typing (#15254)
* fix: feature flags typing

* fix tests

* add note in UPDATING.md

* fix frontend

* also move SCHEDULED_QUERIES to top level

* fix test

Co-authored-by: Ville Brofeldt <ville.v.brofeldt@gmail.com>
2021-11-19 15:56:16 +00:00
ofekisr 683d1dab13
refactor(QueryObject): decouple from superset (#17479)
* refactor: queryObject - decouple from superset

* refactor: queryObject - decouple from superset
2021-11-18 19:53:56 +02:00
ofekisr 377db1bd71
refactor: queryObject - add QueryObjectFactory (#17466) 2021-11-18 17:38:17 +02:00
binome74 211b32a4cd
fix(mssql): week time grain should respect datefirst setting (#10811)
* "P1W" grain should respect DATEFIRST setting in MS SQL Server

* Added "week_start_sunday" and "week_start_monday" grains support. Adjusted the "week" grain for better backward compatibility with MS SQL 2005/2008.

* Stylistic and linter-requested changes

* fix test

Co-authored-by: Valeriy Aleksashkin <v.aleksashkin@gmail.com>
Co-authored-by: Ville Brofeldt <ville.v.brofeldt@gmail.com>
2021-11-16 09:36:37 +02:00
Ville Brofeldt e2a429b0c8
feat(explore): adhoc column expressions [ID-3] (#17379)
* add support for adhoc columns to api and sqla model

* fix some types

* fix duplicates in column names

* fix more lint

* fix schema and dedup

* clean up some logic

* first pass at fixing viz.py

* Add frontend support for adhoc columns

* Add title edit

* Fix showing custom title

* Use column name as default value in sql editor

* fix: Adds a loading message when needed in the Select component (#16531)

* fix(tests): make parquet select deterministic with order by (#16570)

* bump emotion to help with cache clobbering (#16559)

* fix: Support Jinja template functions in global async queries (#16412)

* Support Jinja template functions in async queries

* Pylint

* Add tests for async tasks

* Remove redundant has_request_context check

* fix: impersonate user label/tooltip (#16573)

* docs: update for small typos (#16568)

* feat: Add Aurora Data API engine spec (#16535)

* feat: Add Aurora Data API engine spec

* Fix lint

* refactor: sql_json view endpoint: encapsulate ctas parameters (#16548)

* refactor sql_json view endpoint: encapsulate ctas parameters

* fix failed tests

* fix failed tests and ci issues

* refactor sql_json view endpoint: separate concern into ad hod method (#16595)

* feat: Experimental cross-filter plugins (#16594)

* fix:fix get permission function

* feat: add cross filter chart in charts gallery under FF

* chore(deps): bump superset-ui to 0.18.2 (#16601)

* update type guard references

* fix imports

* update series_columns schema

* Add changes that got lost in rebase

* Use current columns name or expression as sql editor init value

* add integration test and do minor fixes

* Bump superset-ui

* fix linting issue

* bump superset-ui to 0.18.22

* resolve merge conflict

* lint

* fix select filter infinite loop

* bump superset-ui to 0.18.23

* Fix auto setting column popover title

* Enable adhoc columns only if UX_BETA enabled

* put back removed test

* Move popover height and width to constants

* Refactor big ternary expression

Co-authored-by: Kamil Gabryjelski <kamil.gabryjelski@gmail.com>
Co-authored-by: Michael S. Molina <70410625+michael-s-molina@users.noreply.github.com>
Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>
Co-authored-by: Rob DiCiuccio <rob.diciuccio@gmail.com>
Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
Co-authored-by: joeADSP <75027008+joeADSP@users.noreply.github.com>
Co-authored-by: ofekisr <35701650+ofekisr@users.noreply.github.com>
Co-authored-by: simcha90 <56388545+simcha90@users.noreply.github.com>
2021-11-15 12:50:08 +02:00
ofekisr 5d3e1b5c2c
refactor: ChartDataCommand into two separate commands (#17425) 2021-11-15 01:00:08 +02:00
ofekisr d8851c9a89
refactor(TestChartApi): move chart data api tests into TestChartDataApi (#17407)
* refactor charts api tests

* move new added test

* refactor charts api tests
2021-11-14 23:35:23 +02:00
Ville Brofeldt ad8a7c42f9
fix: avoid escaping bind-like params containing colons (#17419)
* fix: avoid escaping bind-like params containing colons

* fix query for mysql

* address comments
2021-11-13 09:01:49 +02:00
Elizabeth Thompson f10bc6d8fe
fix: add fallback and validation for report and cron timezones (#17338)
* add fallback and validation for report and cron timezones

* add logging to exception catch

* Run black

Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
2021-11-12 12:28:17 -08:00
John Bodley bcef8fa13b
feature: Add quarter unit to datetrunc (#17416)
Co-authored-by: John Bodley <john.bodley@airbnb.com>
2021-11-12 09:46:55 -08:00
ofekisr 9ce6b7de83
refactor ChartDataCommand - separate loading query_context form cache into different module (#17405) 2021-11-12 14:44:21 +02:00
ofekisr 45480f7ae5
refactor move ChartDataResult enums to common (#17399) 2021-11-11 11:41:37 +02:00
Francesco Frassinelli 0d77f36679
fix: handle TIME column serialization (#16869)
* Add support for datetime.time in json_int_dttm_ser

* Test base_json_conv support for datetime.time

* Group types by conversion function for JSON dump
2021-11-11 10:35:00 +02:00
Christian Pfarr 333b1371f7
feat: Drill ODBC/JDBC Impersonation feature (#17353)
* Added Drill ODBC Impersonation feature and necessary translations/docs

* Code Cleanup

* add jdbc impersonation_target parameter

* add unittests for DrillEngineSpec.modify_url_for_impersonation method

* reformat test_drill.py with black formatter

* run pre-commit locally

Co-authored-by: Christian Pfarr <Christian.Pfarr@deutschebahn.com>
Co-authored-by: Christian Pfarr <z0ltrix+gitlab@pm.me>
2021-11-10 08:45:16 +02:00
Kamil Gabryjelski fa51b3234e
fix(dashboard): Return columns and verbose_map for groupby values of Pivot Table v2 [ID-7] (#17287)
* fix(dashboard): Return columns and verbose_map for groupby values of Pivot Table v2

* Refactor

* Fix test and lint

* Fix test

* Refactor

* Fix lint
2021-11-05 16:05:48 +01:00
Hugh A. Miles II e5fe18660c
fix: Show sqllab state when deleting databases (#17331)
* saving

* fix ts

* update test

* update test

* log unit

* updated test
2021-11-04 20:17:08 -04:00
Beto Dealmeida 1fbce88a46
fix: set correct schema on config import (#16041)
* fix: set correct schema on config import

* Fix lint

* Fix test

* Fix tests

* Fix another test

* Fix another test

* Fix base test

* Add helper function

* Fix examples

* Fix test

* Fix test

* Fixing more tests
2021-11-04 11:09:08 -07:00
Beto Dealmeida 03a2c6ee8a
feat: apply d3NumberFormat to table reports (#17336) 2021-11-04 08:18:01 -07:00
John Bodley 36f489eea0
fix: Normalize prequery result type (#17312)
Co-authored-by: John Bodley <john.bodley@airbnb.com>
2021-11-03 13:58:40 -07:00
Beto Dealmeida cb34a22684
fix: import should accept old keys (#17330)
* fix: import should accept old keys

* Fix lint

* Preserve V1 schema
2021-11-03 11:25:30 -07:00
Geido 2199ef2dd7
chore: Test cases for annotations and annotation layers incorrect creation through API (#17246)
* Add/Refactor tests

* Add return type

* Update api tests
2021-11-03 09:11:41 +00:00
Beto Dealmeida 93bafa0e6a
feat: improve logic in is_select (#17329)
* feat: improve logic in is_select

* Add more edge cases
2021-11-02 17:30:12 -07:00
Étienne Boisseau-Sierra f0c0ef7048
fix(cli): fail CLI script on failed import/export (#16976)
* Test that failing export or import is done properly

For each CLI entry-point we will modify, we make sure that:

- a failing process exits with a non-0 exit code,
- an error is logged.

Signed-off-by: Étienne Boisseau-Sierra <etienne.boisseau-sierra@unipart.io>

* Exit process with error if export/import failed

Bubble exception up when failing import or export

During a CLI import or export of dashboards, if the process fails, the
exception it caught and a simple message is sent to the logger.
This makes that from a shell point of view, the script was successfull —
cf. #16956.

To prevent this, we want to ensure that the process exits with an error
(i.e., a non-0 exit-code) should the export or import fail mid-flight.

Signed-off-by: Étienne Boisseau-Sierra <etienne.boisseau-sierra@unipart.io>
2021-10-29 08:56:29 +01:00
Ville Brofeldt 4316fe6ae6
fix(annotataion): handle required fields properly (#17234) 2021-10-27 08:42:28 +03:00
Shiva Raisinghani ef3afbde82
refactor: Repeated boilerplate code between upload to database forms (#16756)
* abstract boilerplate code into class and rename csv to file

* add db migration

* fix some stuff

* more renaming of csv to file

* rename in translations

* update down revision

* update down revision

* bump chart version

* switch to alter column name approach in db migration

* fix db migration for MySQL

* db migration conflict
2021-10-25 13:53:06 +03:00
Yongjie Zhao 4f1d202430
chore: use official isort in pre-commmit (#17215) 2021-10-25 17:57:38 +08:00
Yongjie Zhao bedb8f4dff
fix(bigquery): calculated column cannot orderby in BigQuery (#17196)
* fix(bigquery): calculated column cannot orderby in BigQuery

* typo

* add ut

* fix lint
2021-10-22 22:42:58 +08:00
Yongjie Zhao 4c708af710
fix: avoid filters containing null value (#17168) 2021-10-21 18:20:38 +08:00
Amit Miran 029ed90afb
fix: preventing sql lab None limit value (#17155)
* fix: preventing sql lab None limit value

* test: create a test for the fix

* pylint (#17172)

* add test (#17173)

Co-authored-by: Hugh A. Miles II <hughmil3s@gmail.com>
2021-10-20 23:43:14 +03:00
Ville Brofeldt d7834f17e3
fix(filter-indicator): show filters handled by jinja as applied (#17140) 2021-10-18 19:28:05 +02:00
John Bodley 565ee2318d
chore(druid): Explicitly cast col to TIMESTAMP (#17101)
Co-authored-by: John Bodley <john.bodley@airbnb.com>
2021-10-18 10:06:04 -07:00
Beto Dealmeida 83a2f8346e
chore: enable BQ tests (#17017) 2021-10-14 08:07:47 -07:00
John Bodley b9ff85d9ea
chore(engine): Translate fractional time grains—requires @superset-ui bump (#17078)
* chore(engine): Translate fractional time grains

* Bump @superset-ui

Co-authored-by: John Bodley <john.bodley@airbnb.com>
2021-10-12 21:40:48 -07:00
John Bodley 5e85f48515
chore(druid): Standardizing time grain transformations (#17050)
* chore(druid): Standardizing time grain transformations

* Update druid_tests.py

* Update druid_tests.py

Co-authored-by: John Bodley <john.bodley@airbnb.com>
2021-10-12 08:34:28 -07:00
Elizabeth Thompson c2e1ab6550
add logging on successful data uploads (#17065) 2021-10-11 16:28:07 -07:00
Yongjie Zhao fd8461406d
fix: rolling and cum operator on multiple series (#16945)
* fix: rolling and cum operator on multiple series

* add UT

* updates
2021-10-07 16:42:08 +08:00
Beto Dealmeida c993c5845f
fix(BigQuery): explicitly quote columns in select_star (#16822)
* fix (BigQuery): explicitly quote columns in select_star

* Fix test

* Fix SELECT * in BQ

* Add unit tests

* Remove type changes
2021-10-06 07:43:32 -07:00
Yongjie Zhao 387ac2b6d3
fix: replace absolute difference with difference in compareOperator (#16930)
* fix: replace absolute difference with difference in compareOperator

* fix ut
2021-10-04 13:31:19 +08:00
ofekisr 0d0c759cfe
refactor: sql lab command: separate concerns into different modules (#16917)
* chore move sql_execution_context to sqllab package

* add new helper methods into base Dao

* refactor separate get existing query concern from command

* refactor separate query access validation concern

* refactor separate get query's database concern from command

* refactor separate get query rendering concern from command

* refactor sqllab_execution_context

* refactor separate creating payload for view

* chore decouple command from superset app

* fix pylint issues

* fix failed tests

* fix pylint issues

* fix failed test

* fix failed black

* fix failed black

* fix failed test
2021-10-03 11:15:46 +03:00
apurva-sigmoid 420eff42b8
feat: add Firebolt DB engine spec (#16903)
* New branch from superset for integration with firebolt sqlalchemy adapter

* Added db_engine_spec file for Firebolt

* Removed firebolt code from superset repo

* Deleted virtual env commit

* Adding time grain changes to firebolt.py

* Updated README.md

Added steps to install and run Superset with Firebolt SQLAlchemy Adapter

* Update README.md

Reduced installation steps. Using PyPi installation for adapter now

* Revert "Update README.md"

This reverts commit 5ed17c7a45.

* Revert "Updated README.md"

This reverts commit 45c5072649.

* added epoch methods, added test cases for firebolt db engine spec and edited setup.py

* Added license to files

* Added documentation for Firebolt-SQLAlchemy

* Removed trailing whitespace

Co-authored-by: raghavsharma <raghavs@sigmoidanalytics.com>
Co-authored-by: raghavSharmaSigmoid <88667094+raghavSharmaSigmoid@users.noreply.github.com>
2021-10-01 19:43:15 +03:00