* Add column type to a query result of InfluxDB
* Remove an unused import
* Migrate to pytest
* Rename test names to descriptive
---------
Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
__file__ will resolve to tests/test_cli.py, which is already opened by Python.
When tests are run on a network file system the test runner may deadlock while
waiting for an advisory lock to be released on this file.
* Check all Trino catalogs if no catalog configured
- If catalog is not set, query 'SHOW CATALOGS' to get catalogs
- For each catalog, discover schema, table, columns
- If catalog has a `.`, then quote the catalog name
- New table name returned includes catalog name
- If catalog is set, same result as before
* Use self._handle_run_query_error(error)
* Fix lint problem & format w/ black
* Fix condition so catalog_prefixes are [""] when catalog is set
* Fix for loop / Remove default values for catalog & schema
* Add untested tests for Trino's get_schema
* Black formatting
* Add test_get_schema_catalog_set test & fix tests
* Parameterize the side_effect fn thoroughly
* Get catalogs (not catalog_prefixes) bc confusing
* Trino._get_catalogs added for testability
* convert unexpected validation errors to InvalidParameterError
* get rid of local except blocks - any failure to validate is caught in _valid()
* avoid bare exception
* don't assign exception if we're not going to use it
* preferentially raise querydetachedfromdatasource error if it is present
---------
Co-authored-by: Omer Lachish <omer@rauchy.net>
Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
* Use multi_byte_search_enabled option for My Queries search and Favorite List search
* make format
* add search by user tests
---------
Co-authored-by: Justin Clift <justin@postgresql.org>
Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
* Support to find a worksheet by the title for google_spreadsheets
* Add tests for parse_query
* Fix types
* Add tests when finding a worksheet by a title is failed
* Proxy by a wrapper instead of using spreadsheet directly. Do not use gspread in tests
* Add tests. Fix format of quoted strings for titles
* Fix an error format
* Add a newline
* Fix formatting
---------
Co-authored-by: Justin Clift <justin@postgresql.org>
* Add Asana alert destination
* change icon
* fix format
* add except in log
* fix flake8
* add metadata kwarg to notify
* update asana image
* make pat and project id required
* rename asana destination icon
* reuse Alert
* extract api base url to property method
* use required options
* add asana destination test
* make format
* define metadata
* fix test
* remove json.dumps from asana test
---------
Co-authored-by: Konstantin Smirnov <46676677+konnectr@users.noreply.github.com>
Co-authored-by: konnectr <1konnectrl@gmail.com>
Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
* increase duplicate column names based on the original column name and not the number of duplicates detected
* add fetch columns test for base query runner
---------
Co-authored-by: Omer Lachish <omer@rauchy.net>
Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
* Fix python query runner crashing the GUI due to missing 'rows' and/or 'columns' in the JSON returned data.
* Fix typo of previous commit.
* Throw exception when python query runner has invalid result.
* Update test_python.py
---------
Co-authored-by: YuhengChen <yuheng.chen@imaygou.com>
* add try except for data_source
* add try except for data_source
* fix errir handle
* add test for no data source
* changed error handle
* fix format
* fix test
---------
Co-authored-by: Konstantin Smirnov <46676677+konnectr@users.noreply.github.com>
Co-authored-by: konnectr <1konnectrl@gmail.com>
- Escape all variables by default since Mustache only has a syntax for raw values
- Generate a generic HTML result table to allow an alert template to display any query
- Optionally allow alert template to be defined to be set using REDASH_ALERTS_DEFAULT_MAIL_BODY_TEMPLATE
- Formatting updated by black
- A runner supporting the newest versions of ES,
aggregation, nested aggregations and nested fields.
- A runner for the SQL OpenDistro flavor
- A runner for the SQL X-Pack flavor
Co-authored-by: Nicolas Le Manchet <nicolas@lemanchet.fr>
Co-authored-by: wwl717195673 <717195673@qq.com>
ClickHouse query runner splits query into several and execute each query in turn. The result of the last execution is returned. Implementation uses ClickHouse sessions in the HTTP protocol. `session_id` is generated for the first query and then it is used with the subsequent queries (together with the `session_check` parameter).
If query runner gets a success response with empty body from ClickHouse (for example, in case of temporary table creation request) query runner returns empty response.
authored-by: Liubov Ulitina <ulitinalm@vl.ru>
* Fix: pagination is broken on the dashboard list page (#5516)
* Add test that reproduces issue #5466
* Fix: Duplicate dashboard rows were returned by Dashboard.all() (#5466)
* Update changelog for V10
* Update changelog for #5516
* reset failure counter when query completes successfully via adhoc
* Use "query_id" in metadata, but still allow "Query ID" for transition/legacy support
* Add My Dashboards filter option to the Dashboards list. Added API endpoint to get the list of a user's dashboards, similar to the My Queries feature.
* Update empty dashboard list state to show an invite to create a new dashboard, like My Queries
* Update to Levko's suggested approach. Clean up some of the formatting for consistency. Put the 'My Queries/Dashboards' item before the Favorites since that organization seems cleaner to me.
* Address Levko's comments