Commit Graph

292 Commits

Author SHA1 Message Date
Beto Dealmeida
1b95da7487
fix: table schema permissions (#23356) 2023-03-14 15:18:18 -07:00
Hugh A. Miles II
b820eb8235
chore: Update pre-commit packages (#23173) 2023-03-13 17:05:13 -06:00
John Bodley
5f0c320415
chore: Deprecate show_native_filters (#23228) 2023-03-02 07:29:51 +13:00
Daniel Vaz Gaspar
b479e93b49
fix: add disallowed query params for engines specs (#23217)
Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
2023-02-28 12:00:22 +00:00
Daniel Vaz Gaspar
79274eb5bc
fix: memoized decorator memory leak (#23139) 2023-02-27 15:59:11 +00:00
Antonio Rivero
3484e8ea7b
feat(ssh_tunnel): Import/Export Databases with SSHTunnel credentials (#23099) 2023-02-24 09:36:21 -08:00
Ville Brofeldt
d0c54cddb0
fix(clickhouse): add clickhouse connect driver (#23185) 2023-02-24 14:04:12 +02:00
Beto Dealmeida
fbf10c35a9
feat: return UUID on database creation (#23143) 2023-02-21 17:36:16 -08:00
Elizabeth Thompson
434b445e31
chore: increment statsd as warn (#23041) 2023-02-16 15:43:18 -08:00
Elizabeth Thompson
4ddf67fc14
chore: move dashboard screenshot standalone logic (#23003) 2023-02-15 14:35:08 -08:00
Daniel Vaz Gaspar
7a0f350028
fix: add new config to allow for specific import data urls (#22942) 2023-02-06 08:17:08 -08:00
JUST.in DO IT
ad1ffbd723
fix(explore): unable to update linked charts (#22896) 2023-02-03 07:07:17 +13:00
Ville Brofeldt
cd6fc35f60
chore(db_engine_specs): clean up column spec logic and add tests (#22871) 2023-01-31 15:54:07 +02:00
Elizabeth Thompson
f2b61fca15
fix: edit pyarrow stringify to better handle emojis and accents (#22881) 2023-01-30 12:29:19 -08:00
Artem Shumeiko
c839d0daf5
chore: Localization of superset pt. 2 (#22772) 2023-01-30 09:20:43 -07:00
Diego Medina
14878a160f
chore: Migrate /superset/queries/<last_updated_ms> to API v1 (#22611) 2023-01-27 13:20:56 -05:00
Antonio Rivero Martinez
d6a4a5da79
feat(ssh_tunnel): Add feature flag to SSH Tunnel API (#22805) 2023-01-26 16:53:36 -08:00
Geido
3fd4718ecb
fix: Convert TIMESTAMP_* to TIMESTAMP in Snowflake (#22872) 2023-01-26 19:49:44 +01:00
Evan Rusackas
6998f65e1d
chore: removing unnecessary double spaces, a.k.a. "shotgun holes" (#22852) 2023-01-26 11:48:41 -07:00
Josh Soref
02e5dcbbf2
chore(misc): Spelling (#19678)
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2023-01-25 16:35:08 -07:00
Geido
9ed2326a20
feat: Move cross filters to Dashboard (#22785) 2023-01-25 18:01:06 +01:00
Beto Dealmeida
6f0fed77cf
feat: export/import allow_dml flag (#22806) 2023-01-24 19:16:46 -08:00
Elizabeth Thompson
d091a68909
fix: better logic to extract errors on databricks (#22792) 2023-01-20 15:35:09 -08:00
Diego Medina
3ed288d4ee
chore: Migrate /superset/stop_query/ to API v1 (#22624) 2023-01-16 14:07:52 +00:00
Elizabeth Thompson
cd1f6d469b
fix: remove whitespace from http_path for databricks (#22671) 2023-01-13 14:50:18 -08:00
Hugh A. Miles II
2de19f1d66
feat: Add logging for ssh tunneling test_connection attempts (#22625) 2023-01-12 21:49:35 +00:00
Elizabeth Thompson
804e89d725
fix: stringify ValueErrors for NaT types (#22628) 2023-01-06 15:15:12 -08:00
Hugh A. Miles II
ebaad10d6c
feat(ssh-tunnelling): Setup SSH Tunneling Commands for Database Connections (#21912)
Co-authored-by: Antonio Rivero Martinez <38889534+Antonio-RiveroMartnez@users.noreply.github.com>
Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>
2023-01-03 17:22:42 -05:00
Ville Brofeldt
b6d39d194c
feat(trino): support early cancellation of queries (#22498) 2022-12-24 06:31:46 +02:00
Hugh A. Miles II
9b26794419
chore: Update dataset_id & dataset_type datasource_id & datasource_type for SPA explore (#22461) 2022-12-22 19:46:00 -05:00
Stan
7d8fff87b5
fix(assets api): import replaces dashboard (#22208)
Co-authored-by: Stan Houcke <stan.houcke@skyscanner.net>
2022-12-21 15:36:40 -08:00
Beto Dealmeida
bdeedaaf80
chore: set Snowflake user agent (#22432) 2022-12-15 17:08:34 -08:00
Ville Brofeldt
aa0cae9b49
feat(thumbnails): add support for user specific thumbs (#22328) 2022-12-14 15:02:31 +02:00
Antonio Rivero Martinez
60a617eaba
fix(bigquery): Properly display errors for BigQuery DBs (#22349) 2022-12-07 13:34:30 -05:00
Elizabeth Thompson
1c20206057
fix: convert <NA> values to None instead of stringifying (#22321) 2022-12-02 17:15:20 -08:00
Elizabeth Thompson
5c77f1ad2a
feat: add databricks form (#21573) 2022-12-02 10:36:27 -08:00
EugeneTorap
7bc5f04368
chore: Bump bigquery libs (#21466) 2022-12-02 12:48:36 +02:00
Yongjie Zhao
22fab5e58c
feat: Axis sort in the Bar Chart V2 (#21993) 2022-11-26 22:06:26 +08:00
EugeneTorap
394fb2f2d0
fix: slug is empty if filename is non-ASCII (#22118) 2022-11-16 10:53:30 -08:00
EugeneTorap
38a3fbdc33
feat: use a new official CH driver: clickhouse-connect (#22039) 2022-11-16 10:53:15 -08:00
Peng Ren
b32de3dd9e
feat: Add a new database driver for Amazon DynamoDB (#22077) 2022-11-14 20:57:04 -08:00
Elizabeth Thompson
ce145c676c
refactor: use exception status for logging (#21971) 2022-11-14 14:14:24 -08:00
Elizabeth Thompson
86d52fcbc4
chore: remove shadow write of new sip 68 dataset models (#21986) 2022-11-14 09:55:53 -08:00
Antonio Rivero Martinez
95b4c7b7fe
chore(bigquery): Add extra logging for BigQuery exceptions so we can have better insight on exceptions (#22024) 2022-11-09 22:56:08 -05:00
Daniel Vaz Gaspar
e33a08693b
fix: datasource save, improve data validation (#22038) 2022-11-07 10:33:24 +00:00
Yongjie Zhao
a9b229dd1d
feat: support mulitple temporal filters in AdhocFilter and move the Time Section away (#21767) 2022-11-02 08:21:17 +08:00
Ville Brofeldt
a02a778cc3
feat(reports): execute as other than selenium user (#21931)
Co-authored-by: Ville Brofeldt <ville.brofeldt@apple.com>
2022-10-31 14:32:49 +02:00
AAfghahi
33fc57854d
fix: error_parsing (#21946) 2022-10-28 19:43:37 -04:00
Beto Dealmeida
a88dfe24c7
fix: check that imports are ZIPs (#21875) 2022-10-26 12:15:46 -07:00
Beto Dealmeida
1388f21ee3
fix: accept old database payload (#21923) 2022-10-25 10:29:29 -07:00
Elizabeth Thompson
f58227a912
feat: add denylist for db engines (#21486) 2022-10-08 19:45:21 -07:00
Hugh A. Miles II
882bfb67ae
fix: gsheets editing with dynamic forms (#21710) 2022-10-06 19:57:12 -07:00
Elizabeth Thompson
e98943e580
refactor: pass all properties to validate_parameters (#21487) 2022-10-03 17:48:54 -07:00
Elizabeth Thompson
ef78ec6b30
fix: catch error when masking encrypted extra is none (#21570) 2022-10-02 19:49:01 -07:00
Erik Cederstrand
82bd5a31b8
chore(deps): Unpin sqlparse dependency (#21581)
Co-authored-by: Erik Cederstrand <erik@adamatics.com>
Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
2022-09-26 17:41:04 +03:00
John Bodley
eac6fdcd29
chore(sqllab): Cleanup /tables/... endpoint (#21284) 2022-09-13 08:22:12 -07: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
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
Beto Dealmeida
34a79add04
feat: filter parameters from DB API (#21248) 2022-09-02 11:50:04 -07: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
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
Đặ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
Yongjie Zhao
11bf7b9125
feat: generate label map on the backend (#21124) 2022-08-22 21:00:02 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Yongjie Zhao
9425dd2cac
fix: drop the first level of MultiIndex (#19716) 2022-04-14 23:40:38 +08:00
Yongjie Zhao
d7dd4119d4
fix: time comparision (#19659) 2022-04-12 18:19:22 +08:00
Ville Brofeldt
9a9e3b6e3b
test(jinja): refactor to functional tests (#19606) 2022-04-08 20:32:38 +03: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
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
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
Ville Brofeldt
a619cb4ea9
chore: upgrade black (#19410) 2022-03-29 20:03:09 +03:00
Yongjie Zhao
a39dd4493e
feat: linear imputation in Resample (#19393) 2022-03-28 22:30:45 +08: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
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
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
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
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
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
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
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
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
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
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
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
Yongjie Zhao
30a9d14639
refactor: postprocessing move to unit test (#18779) 2022-02-17 20:05:41 +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
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
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
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