* fix(destinations): Handle unicode characters in webhook notifications
Previously, webhook notifications would fail if they contained unicode characters in the alert data. This was because the JSON payload was not UTF-8 encoded before being sent.
This commit fixes the issue by explicitly encoding the JSON data to UTF-8 and adds a test to verify the fix.
* move test function to new file
---------
Co-authored-by: gaojingyu <gaojingyu>
* Update Azure Data Explorer query runner to latest version
* Fix black issue
* downgrade azure-kusto-data to 4.6.3
* Freeze numpy to 1.24.4 because of 2.0.0 incompatibility
* Fix failing test
* Reformat test
* Sanitize NaN, Infinite, -Infinite causing error when saving as PostgreSQL JSON #7339 (2nd try)
* Move json nsanitaize to on the top of json_dumps
* Fix comment
* prevent text values in payload being detected as 'set' on send.
Webex send ERROR:: Object of type set is not JSON serializable
Signed-off-by: Matt Nelson <metheos@gmail.com>
* add support for formatted QUERY_RESULT_TABLE in webex card
Signed-off-by: Matt Nelson <metheos@gmail.com>
* don't try to send to blank destinations
Signed-off-by: Matt Nelson <metheos@gmail.com>
* fix handling of the encoded QUERY_RESULTS_TABLE text
Signed-off-by: Matt Nelson <metheos@gmail.com>
* re-sort imports for ruff
Signed-off-by: Matt Nelson <metheos@gmail.com>
* change formatter to black
Signed-off-by: Matt Nelson <metheos@gmail.com>
* Add additional tests for Webex notification handling
ensure blank entries are handled for room IDs and person emails.
ensure that the API is not called when no valid destinations are provided.
ensure proper attachment formatting for alerts containing 2D arrays.
Signed-off-by: Matt Nelson <metheos@gmail.com>
* Add test for Webex notification with 1D array handling
This commit introduces a new test case to verify that the Webex
notification function correctly handles a 1D array input in the alert body.
The test ensures that the expected payload is constructed properly and that
the requests.post method is called with the correct parameters.
Signed-off-by: Matt Nelson <metheos@gmail.com>
---------
Signed-off-by: Matt Nelson <metheos@gmail.com>
I've experience this on my Redash in production. I'm not sure what can cause the value to exist, but be None. I guess it depends on the SQL query.
I followed the same idea of returning a self.UNKNOWN_STATE for cases that we can't know what's happening.
Updated from Python 3.8 to 3.10. Python 3.10 is the default for Ubuntu 22. This change necessitated upgrading to
SQLAlchemy_Utils 0.38.3, and importing the sort_query function from an older version of SQLAlchemy_Utils because it was dropped in newer versions.
Co-authored-by: Ezra Odio <eodio@starfishstorage.com>
"Query in queue" should switch to "Executing query", but does not.
Commands:
git revert --no-commit bd17662005
git revert --no-commit 5ac5d86f5e
vim tests/handlers/test_query_results.py
git add tests/handlers/test_query_results.py
Co-authored-by: Justin Clift <justin@postgresql.org>
This reverts commit bd115e7f5f, as
it turns out to be a useful security feature.
In order to remove this in a better way, we'll need to replace it
with something that provides equivalent functionality.
Format the Slack message using the "mrkdwn" type, which will make
hyperlinks clickable.
New test for Slack destination.
Co-authored-by: github-actions <github-actions@github.com>
Since #6687, we don't serialize query results as JSON
before returning them. This is fine, except for the
query results data source which needs to pass the
data directly to sqlite3, and doesn't know how to
do that with the decimal types that are occasionally
returned by (at least) the PostgreSQL query runner:
https://www.psycopg.org/docs/faq.html#problems-with-type-conversions
* Fixed notification template
* Made if-clause equal to append
Like Slack and email notification
* Add custom_body attribute to discord test
* Add missing attribute
* Adds ssl support for prometheus query runner.
- Adds possibilty to upload and use of ssl cert, key and ca file in redash ui
* Extends test cases for prometheus query runner.
- Adds secret attribute to configuration schema.
* Fixes wrong timestamps in different timezones in prometheus' testcases.
- Dynamically calculates timestamps in testcases to be robust in
different timezones.
- Adds now datetime function to make it more testable.
* Fixes timestamp in prometheus' testcases which can be wrong depending on timezone.
---------
Co-authored-by: Masayuki Takahashi <masayuki038@gmail.com>
* Snapshot: 23.11.0-dev
* dataframe_to_result function moved outside python query runner
* added yandex disk query runner
* moved file_extension check
* skip unsupported extensions in schema
* removed unused variable
* added support for xlsx with multiple sheets
* moved pandas-converters to utils file
* added tests
* fixed backend tests
* fixed pandas to redash type conversion
* added more tests
* added tests for pandas
* added tests for pandas converter and yandex disk
* added tests for read_file and multiple sheets
* pandas: do not load if lib is not installed
* added test for yaml read
* fixed test for yaml read
---------
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>