From c4d3d9c683f1f555a0216a401ddf32510181ed84 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 29 Mar 2024 17:14:56 +1000 Subject: [PATCH 1/4] Bump express from 4.18.2 to 4.19.2 (#6838) Bumps [express](https://github.com/expressjs/express) from 4.18.2 to 4.19.2. - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/master/History.md) - [Commits](https://github.com/expressjs/express/compare/4.18.2...4.19.2) --- updated-dependencies: - dependency-name: express dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 53 +++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 43 insertions(+), 10 deletions(-) diff --git a/yarn.lock b/yarn.lock index 992baad918..0b7ef8e5e3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3541,7 +3541,25 @@ bn.js@^5.0.0, bn.js@^5.2.1: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== -body-parser@1.20.1, body-parser@^1.18.3: +body-parser@1.20.2: + version "1.20.2" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.2.tgz#6feb0e21c4724d06de7ff38da36dad4f57a747fd" + integrity sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA== + dependencies: + bytes "3.1.2" + content-type "~1.0.5" + debug "2.6.9" + depd "2.0.0" + destroy "1.2.0" + http-errors "2.0.0" + iconv-lite "0.4.24" + on-finished "2.4.1" + qs "6.11.0" + raw-body "2.5.2" + type-is "~1.6.18" + unpipe "1.0.0" + +body-parser@^1.18.3: version "1.20.1" resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.1.tgz#b1812a8912c195cd371a3ee5e66faa2338a5c668" integrity sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw== @@ -4528,6 +4546,11 @@ content-type@~1.0.4: resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== +content-type@~1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.5.tgz#8b773162656d1d1086784c8f23a54ce6d73d7918" + integrity sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA== + convert-source-map@^1.1.0: version "1.6.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20" @@ -4554,10 +4577,10 @@ cookie-signature@1.0.6: resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= -cookie@0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b" - integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw== +cookie@0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.6.0.tgz#2798b04b071b0ecbff0dbb62a505a8efa4e19051" + integrity sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw== copy-anything@^2.0.1: version "2.0.6" @@ -6320,16 +6343,16 @@ expect@^24.9.0: jest-regex-util "^24.9.0" express@^4.16.3, express@^4.17.3: - version "4.18.2" - resolved "https://registry.yarnpkg.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59" - integrity sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ== + version "4.19.2" + resolved "https://registry.yarnpkg.com/express/-/express-4.19.2.tgz#e25437827a3aa7f2a827bc8171bbbb664a356465" + integrity sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q== dependencies: accepts "~1.3.8" array-flatten "1.1.1" - body-parser "1.20.1" + body-parser "1.20.2" content-disposition "0.5.4" content-type "~1.0.4" - cookie "0.5.0" + cookie "0.6.0" cookie-signature "1.0.6" debug "2.6.9" depd "2.0.0" @@ -11984,6 +12007,16 @@ raw-body@2.5.1: iconv-lite "0.4.24" unpipe "1.0.0" +raw-body@2.5.2: + version "2.5.2" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.2.tgz#99febd83b90e08975087e8f1f9419a149366b68a" + integrity sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA== + dependencies: + bytes "3.1.2" + http-errors "2.0.0" + iconv-lite "0.4.24" + unpipe "1.0.0" + raw-loader@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/raw-loader/-/raw-loader-0.5.1.tgz#0c3d0beaed8a01c966d9787bf778281252a979aa" From 24419863ecbe432728ba71a0324d5d298448aa93 Mon Sep 17 00:00:00 2001 From: Will Lachance Date: Fri, 29 Mar 2024 03:51:14 -0400 Subject: [PATCH 2/4] Handle decimal types in query results (#6837) 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 --- redash/query_runner/query_results.py | 3 +++ tests/query_runner/test_query_results.py | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/redash/query_runner/query_results.py b/redash/query_runner/query_results.py index ea83e5089b..b22bac556f 100644 --- a/redash/query_runner/query_results.py +++ b/redash/query_runner/query_results.py @@ -1,3 +1,4 @@ +import decimal import hashlib import logging import re @@ -105,6 +106,8 @@ def fix_column_name(name): def flatten(value): if isinstance(value, (list, dict)): return json_dumps(value) + elif isinstance(value, decimal.Decimal): + return float(value) else: return value diff --git a/tests/query_runner/test_query_results.py b/tests/query_runner/test_query_results.py index d9eb45ae42..756797492c 100644 --- a/tests/query_runner/test_query_results.py +++ b/tests/query_runner/test_query_results.py @@ -1,3 +1,4 @@ +import decimal import sqlite3 from unittest import TestCase @@ -107,6 +108,16 @@ def test_creates_table_with_non_ascii_in_column_name(self): create_table(connection, table_name, results) connection.execute("SELECT 1 FROM query_123") + def test_creates_table_with_decimal_in_column_value(self): + connection = sqlite3.connect(":memory:") + results = { + "columns": [{"name": "test1"}, {"name": "test2"}], + "rows": [{"test1": 1, "test2": decimal.Decimal(2)}], + } + table_name = "query_123" + create_table(connection, table_name, results) + connection.execute("SELECT 1 FROM query_123") + def test_shows_meaningful_error_on_failure_to_create_table(self): connection = sqlite3.connect(":memory:") results = {"columns": [], "rows": []} From fb348c71165567fc6ae46af0c227b33648df21ca Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 1 Apr 2024 00:27:13 +0000 Subject: [PATCH 3/4] Snapshot: 24.04.0-dev --- package.json | 2 +- pyproject.toml | 2 +- redash/__init__.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 8386da93a4..11f4666b2c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "redash-client", - "version": "24.03.0-dev", + "version": "24.04.0-dev", "description": "The frontend part of Redash.", "main": "index.js", "scripts": { diff --git a/pyproject.toml b/pyproject.toml index 1d5676ec76..cbeb9ae919 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ force-exclude = ''' [tool.poetry] name = "redash" -version = "24.03.0-dev" +version = "24.04.0-dev" description = "Make Your Company Data Driven. Connect to any data source, easily visualize, dashboard and share your data." authors = ["Arik Fraimovich "] # to be added to/removed from the mailing list, please reach out to Arik via the above email or Discord diff --git a/redash/__init__.py b/redash/__init__.py index 2b61823912..1e2c987777 100644 --- a/redash/__init__.py +++ b/redash/__init__.py @@ -14,7 +14,7 @@ from redash.destinations import import_destinations from redash.query_runner import import_query_runners -__version__ = "24.03.0-dev" +__version__ = "24.04.0-dev" if os.environ.get("REMOTE_DEBUG"): From a6074878bbcba41ee5dfcc6fe47ceb76da045802 Mon Sep 17 00:00:00 2001 From: Eric Radman Date: Mon, 1 Apr 2024 19:37:37 -0400 Subject: [PATCH 4/4] Use setup-python@v5, setup-node@v4 (#6842) To avoid warnings in the CI pipeline > Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20 Co-authored-by: github-actions --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c42929c27..7273b324e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: with: fetch-depth: 1 ref: ${{ github.event.pull_request.head.sha }} - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: '3.8' - run: sudo pip install black==23.1.0 ruff==0.0.287 @@ -82,7 +82,7 @@ jobs: with: fetch-depth: 1 ref: ${{ github.event.pull_request.head.sha }} - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: ${{ env.NODE_VERSION }} cache: 'yarn' @@ -109,7 +109,7 @@ jobs: with: fetch-depth: 1 ref: ${{ github.event.pull_request.head.sha }} - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: ${{ env.NODE_VERSION }} cache: 'yarn' @@ -142,7 +142,7 @@ jobs: with: fetch-depth: 1 ref: ${{ github.event.pull_request.head.sha }} - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: ${{ env.NODE_VERSION }} cache: 'yarn'