You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by mi...@apache.org on 2025/03/05 13:11:24 UTC
(superset) branch 5.0 updated (e8246ea786 -> 588e2e644b)
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a change to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git
from e8246ea786 fix: oauth2 trino (#31993)
new b2bd39cc28 fix: revert "fix: remove sort values on stacked totals (#31333)" (#32337)
new 7aa4cd4eef fix(fe/dashboard-list): display modifier info for `Last modified` data (#32035)
new 724f2dc5fe fix(roles): Add SqlLabPermalinkRestApi as default sqlab roles. (#32284)
new 7ef38fed24 fix(SSHTunnelForm): make the password tooltip visible (#32356)
new 3eda2223ca fix(firebolt): allow backslach escape for single quotes (#32350)
new 98c82ad24e fix(docker): Configure nginx for consistent port mapping and hot reloading (#32362)
new 09a93d2803 fix: clickhouse-connect engine SSH parameter (#32348)
new 654062db27 fix: ensure metric_macro expands templates (#32344)
new 4c2da53886 fix: bump FAB to 4.5.4 (#32325)
new d98570ff6a fix(pinot): revert join and subquery flags (#32382)
new a8899c4bf3 fix: prevent nested transactions (#32401)
new 10e0e69370 fix(viz): update nesting logic to handle multiple dimensions in PartitionViz (#32290)
new 35cf8290b7 fix(clickhouse): get_parameters_from_uri failing when secure is true (#32423)
new 51450b000d fix(com/grid-comp/markdown): pin `remark-gfm` to v3 to allow inline code block by backticks in Markdown (#32420)
new 2199c73b89 fix(plugin-chart-echarts): remove erroneous upper bound value (#32473)
new 0a35d3efa4 fix(tooltip): displaying <a> tags correctly (#32488)
new f70bb5e52f fix: skip DB filter when doing OAuth2 (#32486)
new 588e2e644b fix: dashboard, chart and dataset import validation (#32500)
The 18 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.github/dependabot.yml | 4 +
docker/nginx/nginx.conf | 6 +
pyproject.toml | 2 +-
requirements/base.txt | 2 +-
requirements/development.txt | 2 +-
superset-frontend/package-lock.json | 878 ++++++++++++++++++++-
.../packages/superset-ui-core/package.json | 4 +-
.../superset-ui-core/src/query/getMetricLabel.ts | 24 +-
.../src/MixedTimeseries/transformProps.ts | 13 +-
.../src/Timeseries/transformProps.ts | 7 +-
.../src/Timeseries/transformers.ts | 11 +-
.../plugin-chart-echarts/src/utils/series.ts | 6 +-
.../test/Timeseries/transformProps.test.ts | 34 +-
.../plugin-chart-echarts/test/utils/series.test.ts | 118 ---
.../src/plugin/controlPanel.tsx | 2 +-
.../plugin-chart-table/src/controlPanel.tsx | 2 +-
.../src/components/Form/LabeledErrorBoundInput.tsx | 3 +-
.../databases/DatabaseModal/SSHTunnelForm.tsx | 10 +-
.../src/pages/DashboardList/DashboardList.test.jsx | 2 +-
.../src/pages/DashboardList/index.tsx | 5 +-
superset/commands/chart/importers/v1/utils.py | 7 +-
superset/commands/dashboard/importers/v1/utils.py | 7 +-
superset/commands/dataset/importers/v1/utils.py | 8 +
superset/databases/api.py | 2 +-
superset/db_engine_specs/clickhouse.py | 24 +-
superset/db_engine_specs/pinot.py | 2 +
superset/jinja_context.py | 45 +-
superset/security/manager.py | 2 +
superset/sql/dialects/firebolt.py | 5 +-
superset/utils/decorators.py | 7 +
superset/viz.py | 10 +-
tests/integration_tests/security_tests.py | 2 +
.../sql_lab/permalink/api_tests.py | 22 +
tests/integration_tests/viz_tests.py | 21 +
.../charts/commands/importers/v1/import_test.py | 51 +-
.../commands/importers/v1/import_test.py | 53 +-
tests/unit_tests/databases/api_test.py | 70 ++
.../datasets/commands/importers/v1/import_test.py | 52 ++
tests/unit_tests/jinja_context_test.py | 194 ++++-
tests/unit_tests/sql/parse_tests.py | 21 +
tests/unit_tests/utils/test_decorators.py | 53 ++
41 files changed, 1554 insertions(+), 239 deletions(-)
(superset) 12/18: fix(viz): update nesting logic to handle multiple dimensions in PartitionViz (#32290)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 10e0e693702a2c2bde6f7b9a2b75f8cedfbf6f69
Author: Damian Pendrak <dp...@gmail.com>
AuthorDate: Fri Feb 28 16:57:11 2025 +0100
fix(viz): update nesting logic to handle multiple dimensions in PartitionViz (#32290)
(cherry picked from commit 6317a91541ea7251e5455ced09d9b58c34ca0983)
---
superset/viz.py | 10 ++++++++--
tests/integration_tests/viz_tests.py | 21 +++++++++++++++++++++
2 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/superset/viz.py b/superset/viz.py
index a42ce94203..f014ce442a 100644
--- a/superset/viz.py
+++ b/superset/viz.py
@@ -2293,10 +2293,16 @@ class PartitionViz(NVD3TimeSeriesViz):
]
if level >= len(levels):
return []
- dim_level = levels[level][metric][[dims[0]]]
+
+ dim_level = levels[level][metric]
+ for d in dims:
+ if d not in dim_level:
+ return []
+ dim_level = dim_level[d]
+
return [
{
- "name": i,
+ "name": [*dims, i],
"val": dim_level[i],
"children": self.nest_values(levels, level + 1, metric, dims + [i]),
}
diff --git a/tests/integration_tests/viz_tests.py b/tests/integration_tests/viz_tests.py
index dde6a1dec8..1631f8d7e0 100644
--- a/tests/integration_tests/viz_tests.py
+++ b/tests/integration_tests/viz_tests.py
@@ -442,6 +442,27 @@ class TestPartitionViz(SupersetTestCase):
assert 1 == len(nest[0]["children"][0]["children"])
assert 1 == len(nest[0]["children"][0]["children"][0]["children"])
+ def test_nest_values_returns_hierarchy_when_more_dimensions(self):
+ raw = {}
+ raw["category"] = ["a", "a", "a"]
+ raw["subcategory"] = ["a.2", "a.1", "a.2"]
+ raw["sub_subcategory"] = ["a.2.1", "a.1.1", "a.2.2"]
+ raw["metric1"] = [5, 10, 15]
+ raw["metric2"] = [50, 100, 150]
+ raw["metric3"] = [500, 1000, 1500]
+ df = pd.DataFrame(raw)
+ test_viz = viz.PartitionViz(Mock(), {})
+ groups = ["category", "subcategory", "sub_subcategory"]
+ levels = test_viz.levels_for("agg_sum", groups, df)
+ nest = test_viz.nest_values(levels)
+ assert 3 == len(nest)
+ for i in range(0, 3):
+ assert "metric" + str(i + 1) == nest[i]["name"]
+ assert 1 == len(nest[0]["children"])
+ assert 2 == len(nest[0]["children"][0]["children"])
+ assert 1 == len(nest[0]["children"][0]["children"][0]["children"])
+ assert 2 == len(nest[0]["children"][0]["children"][1]["children"])
+
def test_nest_procs_returns_hierarchy(self):
raw = {}
raw[DTTM_ALIAS] = [100, 200, 300, 100, 200, 300, 100, 200, 300]
(superset) 05/18: fix(firebolt): allow backslach escape for single quotes (#32350)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 3eda2223ca995fb5a6564e5c05e9b3a8b7001323
Author: Beto Dealmeida <ro...@dealmeida.net>
AuthorDate: Mon Feb 24 11:12:34 2025 -0500
fix(firebolt): allow backslach escape for single quotes (#32350)
(cherry picked from commit 22fe985cfc36a8d798fd53a3e21559511d382ebe)
---
superset/sql/dialects/firebolt.py | 5 ++++-
tests/unit_tests/sql/parse_tests.py | 21 +++++++++++++++++++++
2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/superset/sql/dialects/firebolt.py b/superset/sql/dialects/firebolt.py
index a4767596f4..cfdfc2dfe6 100644
--- a/superset/sql/dialects/firebolt.py
+++ b/superset/sql/dialects/firebolt.py
@@ -17,7 +17,7 @@
from __future__ import annotations
-from sqlglot import exp, generator, parser
+from sqlglot import exp, generator, parser, tokens
from sqlglot.dialects.dialect import Dialect
from sqlglot.helper import csv
from sqlglot.tokens import TokenType
@@ -84,6 +84,9 @@ class FireboltOld(Firebolt):
function.
"""
+ class Tokenizer(tokens.Tokenizer):
+ STRING_ESCAPES = ["'", "\\"]
+
class Parser(Firebolt.Parser):
TABLE_ALIAS_TOKENS = Firebolt.Parser.TABLE_ALIAS_TOKENS - {TokenType.UNNEST}
diff --git a/tests/unit_tests/sql/parse_tests.py b/tests/unit_tests/sql/parse_tests.py
index 2df24a1b3a..8dc06aeea3 100644
--- a/tests/unit_tests/sql/parse_tests.py
+++ b/tests/unit_tests/sql/parse_tests.py
@@ -1164,3 +1164,24 @@ def test_firebolt_old() -> None:
*
FROM t1 UNNEST(col1 AS foo)"""
)
+
+
+def test_firebolt_old_escape_string() -> None:
+ """
+ Test the dialect for the old Firebolt syntax.
+ """
+ from superset.sql.dialects import FireboltOld
+ from superset.sql.parse import SQLGLOT_DIALECTS
+
+ SQLGLOT_DIALECTS["firebolt"] = FireboltOld
+
+ # both '' and \' are valid escape sequences
+ sql = r"SELECT 'foo''bar', 'foo\'bar'"
+
+ # but they normalize to ''
+ assert (
+ SQLStatement(sql, "firebolt").format()
+ == """SELECT
+ 'foo''bar',
+ 'foo''bar'"""
+ )
(superset) 17/18: fix: skip DB filter when doing OAuth2 (#32486)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit f70bb5e52f6710c7bb7b2ac65e295674ced8ed9c
Author: Beto Dealmeida <ro...@dealmeida.net>
AuthorDate: Tue Mar 4 13:33:53 2025 -0500
fix: skip DB filter when doing OAuth2 (#32486)
(cherry picked from commit 813e79fa9fcba502fc55d21a84c0628e1bb42493)
---
superset/databases/api.py | 2 +-
tests/unit_tests/databases/api_test.py | 70 ++++++++++++++++++++++++++++++++++
2 files changed, 71 insertions(+), 1 deletion(-)
diff --git a/superset/databases/api.py b/superset/databases/api.py
index f9c1dfd122..f47293e891 100644
--- a/superset/databases/api.py
+++ b/superset/databases/api.py
@@ -1390,7 +1390,7 @@ class DatabaseRestApi(BaseSupersetModelRestApi):
state = decode_oauth2_state(parameters["state"])
# exchange code for access/refresh tokens
- database = DatabaseDAO.find_by_id(state["database_id"])
+ database = DatabaseDAO.find_by_id(state["database_id"], skip_base_filter=True)
if database is None:
return self.response_404()
diff --git a/tests/unit_tests/databases/api_test.py b/tests/unit_tests/databases/api_test.py
index 63d61ce82a..4656ea9b86 100644
--- a/tests/unit_tests/databases/api_test.py
+++ b/tests/unit_tests/databases/api_test.py
@@ -728,6 +728,76 @@ def test_oauth2_happy_path(
assert token.refresh_token == "ZZZ" # noqa: S105
+def test_oauth2_permissions(
+ mocker: MockerFixture,
+ session: Session,
+ client: Any,
+) -> None:
+ """
+ Test the OAuth2 endpoint works for users without DB permissions.
+
+ Anyone should be able to authenticate with OAuth2, even if they don't have
+ permissions to read the database (which is needed to get the OAuth2 config).
+ """
+ from superset.databases.api import DatabaseRestApi
+ from superset.models.core import Database, DatabaseUserOAuth2Tokens
+
+ DatabaseRestApi.datamodel.session = session
+
+ # create table for databases
+ Database.metadata.create_all(session.get_bind()) # pylint: disable=no-member
+ db.session.add(
+ Database(
+ database_name="my_db",
+ sqlalchemy_uri="sqlite://",
+ uuid=UUID("7c1b7880-a59d-47cd-8bf1-f1eb8d2863cb"),
+ )
+ )
+ db.session.commit()
+
+ mocker.patch.object(
+ SqliteEngineSpec,
+ "get_oauth2_config",
+ return_value={"id": "one", "secret": "two"},
+ )
+ get_oauth2_token = mocker.patch.object(SqliteEngineSpec, "get_oauth2_token")
+ get_oauth2_token.return_value = {
+ "access_token": "YYY",
+ "expires_in": 3600,
+ "refresh_token": "ZZZ",
+ }
+
+ state = {
+ "user_id": 1,
+ "database_id": 1,
+ "tab_id": 42,
+ }
+ decode_oauth2_state = mocker.patch("superset.databases.api.decode_oauth2_state")
+ decode_oauth2_state.return_value = state
+
+ mocker.patch("superset.databases.api.render_template", return_value="OK")
+
+ with freeze_time("2024-01-01T00:00:00Z"):
+ response = client.get(
+ "/api/v1/database/oauth2/",
+ query_string={
+ "state": "some%2Estate",
+ "code": "XXX",
+ },
+ )
+
+ assert response.status_code == 200
+ decode_oauth2_state.assert_called_with("some%2Estate")
+ get_oauth2_token.assert_called_with({"id": "one", "secret": "two"}, "XXX")
+
+ token = db.session.query(DatabaseUserOAuth2Tokens).one()
+ assert token.user_id == 1
+ assert token.database_id == 1
+ assert token.access_token == "YYY" # noqa: S105
+ assert token.access_token_expiration == datetime(2024, 1, 1, 1, 0)
+ assert token.refresh_token == "ZZZ" # noqa: S105
+
+
def test_oauth2_multiple_tokens(
mocker: MockerFixture,
session: Session,
(superset) 14/18: fix(com/grid-comp/markdown): pin `remark-gfm` to v3 to allow inline code block by backticks in Markdown (#32420)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 51450b000d70fb76ee6243e550de7423709fc905
Author: Đỗ Trọng Hải <41...@users.noreply.github.com>
AuthorDate: Sun Mar 2 05:55:31 2025 +0700
fix(com/grid-comp/markdown): pin `remark-gfm` to v3 to allow inline code block by backticks in Markdown (#32420)
Signed-off-by: hainenber <do...@gmail.com>
---
.github/dependabot.yml | 4 +
superset-frontend/package-lock.json | 878 ++++++++++++++++++++-
.../packages/superset-ui-core/package.json | 4 +-
3 files changed, 881 insertions(+), 5 deletions(-)
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 089473a3a3..102c158b98 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -322,6 +322,10 @@ updates:
- package-ecosystem: "npm"
directory: "/superset-frontend/packages/superset-ui-core/"
+ ignore:
+ # not until React >= 18.0.0
+ - dependency-name: "react-markdown"
+ - dependency-name: "remark-gfm"
schedule:
interval: "monthly"
labels:
diff --git a/superset-frontend/package-lock.json b/superset-frontend/package-lock.json
index 75f9f39d16..19ad64ba8e 100644
--- a/superset-frontend/package-lock.json
+++ b/superset-frontend/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "superset",
- "version": "0.0.0-dev",
+ "version": "5.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "superset",
- "version": "0.0.0-dev",
+ "version": "5.0.0",
"license": "Apache-2.0",
"workspaces": [
"packages/*",
@@ -34399,6 +34399,7 @@
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-3.0.2.tgz",
"integrity": "sha512-Tmd1Vg/m3Xz43afeNxDIhWRtFZgM2VLyaf4vSTYwudTyeuTneoL3qtWMA5jeLyz/O1vDJmmV4QuScFCA2tBPwg==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"@types/mdast": "^4.0.0",
@@ -34415,6 +34416,7 @@
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz",
"integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==",
+ "dev": true,
"license": "MIT",
"engines": {
"node": ">=12"
@@ -34427,6 +34429,7 @@
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.2.tgz",
"integrity": "sha512-uZhTV/8NBuw0WHkPTrCqDOl0zVe1BIng5ZtHoDk49ME1qqcjYmmLmOf0gELgcRMxN4w2iuIeVso5/6QymSrgmA==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"@types/mdast": "^4.0.0",
@@ -34451,12 +34454,14 @@
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz",
"integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==",
+ "dev": true,
"license": "MIT"
},
"node_modules/mdast-util-gfm": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-3.0.0.tgz",
"integrity": "sha512-dgQEX5Amaq+DuUqf26jJqSK9qgixgd6rYDHAv4aTBuA92cTknZlKpPfa86Z/s8Dj8xsAQpFfBmPUHWJBWqS4Bw==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"mdast-util-from-markdown": "^2.0.0",
@@ -34476,6 +34481,7 @@
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-2.0.1.tgz",
"integrity": "sha512-5HVP2MKaP6L+G6YaxPNjuL0BPrq9orG3TsrZ9YXbA3vDw/ACI4MEsnoDpn6ZNm7GnZgtAcONJyPhOP8tNJQavQ==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"@types/mdast": "^4.0.0",
@@ -34493,6 +34499,7 @@
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-2.0.0.tgz",
"integrity": "sha512-5jOT2boTSVkMnQ7LTrd6n/18kqwjmuYqo7JUPe+tRCY6O7dAuTFMtTPauYYrMPpox9hlN0uOx/FL8XvEfG9/mQ==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"@types/mdast": "^4.0.0",
@@ -34510,6 +34517,7 @@
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-2.0.0.tgz",
"integrity": "sha512-mKKb915TF+OC5ptj5bJ7WFRPdYtuHv0yTRxK2tJvi+BDqbkiG7h7u/9SI89nRAYcmap2xHQL9D+QG/6wSrTtXg==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"@types/mdast": "^4.0.0",
@@ -34525,6 +34533,7 @@
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-2.0.0.tgz",
"integrity": "sha512-78UEvebzz/rJIxLvE7ZtDd/vIQ0RHv+3Mh5DR96p7cS7HsBhYIICDBCu8csTNWNO6tBWfqXPWekRuj2FNOGOZg==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"@types/mdast": "^4.0.0",
@@ -34542,6 +34551,7 @@
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-2.0.0.tgz",
"integrity": "sha512-IrtvNvjxC1o06taBAVJznEnkiHxLFTzgonUdy8hzFVeDun0uTjxxrRGVaNFqkU1wJR3RBPEfsxmU6jDWPofrTQ==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"@types/mdast": "^4.0.0",
@@ -34558,6 +34568,7 @@
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz",
"integrity": "sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"@types/mdast": "^4.0.0",
@@ -34651,6 +34662,7 @@
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.2.tgz",
"integrity": "sha512-xj68wMTvGXVOKonmog6LwyJKrYXZPvlwabaryTjLh9LuvovB/KAH+kvi8Gjj+7rJjsFi23nkUxRQv1KqSroMqA==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"@types/mdast": "^4.0.0",
@@ -34672,12 +34684,14 @@
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz",
"integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==",
+ "dev": true,
"license": "MIT"
},
"node_modules/mdast-util-to-markdown/node_modules/unist-util-visit": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.0.0.tgz",
"integrity": "sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"@types/unist": "^3.0.0",
@@ -34693,6 +34707,7 @@
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz",
"integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"@types/mdast": "^4.0.0"
@@ -35196,6 +35211,7 @@
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.1.tgz",
"integrity": "sha512-eBPdkcoCNvYcxQOAKAlceo5SNdzZWfF+FcSupREAzdAh9rRmE239CEQAiTwIgblwnoM8zzj35sZ5ZwvSEOF6Kw==",
+ "dev": true,
"funding": [
{
"type": "GitHub Sponsors",
@@ -35231,6 +35247,7 @@
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.2.tgz",
"integrity": "sha512-FKjQKbxd1cibWMM1P9N+H8TwlgGgSkWZMmfuVucLCHaYqeSvJ0hFeHsIa65pA2nYbes0f8LDHPMrd9X7Ujxg9w==",
+ "dev": true,
"funding": [
{
"type": "GitHub Sponsors",
@@ -35265,6 +35282,7 @@
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-3.0.0.tgz",
"integrity": "sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"micromark-extension-gfm-autolink-literal": "^2.0.0",
@@ -35285,6 +35303,7 @@
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-2.1.0.tgz",
"integrity": "sha512-oOg7knzhicgQ3t4QCjCWgTmfNhvQbDDnJeVu9v81r7NltNCVmhPy1fJRX27pISafdjL+SVc4d3l48Gb6pbRypw==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"micromark-util-character": "^2.0.0",
@@ -35301,6 +35320,7 @@
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-2.1.0.tgz",
"integrity": "sha512-/yPhxI1ntnDNsiHtzLKYnE3vf9JZ6cAisqVDauhp4CEHxlb4uoOTxOCJ+9s51bIB8U1N1FJ1RXOKTIlD5B/gqw==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"devlop": "^1.0.0",
@@ -35321,6 +35341,7 @@
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-2.1.0.tgz",
"integrity": "sha512-ADVjpOOkjz1hhkZLlBiYA9cR2Anf8F4HqZUO6e5eDcPQd0Txw5fxLzzxnEkSkfnD0wziSGiv7sYhk/ktvbf1uw==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"devlop": "^1.0.0",
@@ -35339,6 +35360,7 @@
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-2.1.1.tgz",
"integrity": "sha512-t2OU/dXXioARrC6yWfJ4hqB7rct14e8f7m0cbI5hUmDyyIlwv5vEtooptH8INkbLzOatzKuVbQmAYcbWoyz6Dg==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"devlop": "^1.0.0",
@@ -35356,6 +35378,7 @@
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-2.0.0.tgz",
"integrity": "sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"micromark-util-types": "^2.0.0"
@@ -35369,6 +35392,7 @@
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-2.1.0.tgz",
"integrity": "sha512-qIBZhqxqI6fjLDYFTBIa4eivDMnP+OZqsNwmQ3xNLE4Cxwc+zfQEfbs6tzAo2Hjq+bh6q5F+Z8/cksrLFYWQQw==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"devlop": "^1.0.0",
@@ -35386,6 +35410,7 @@
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.1.tgz",
"integrity": "sha512-Xe6rDdJlkmbFRExpTOmRj9N3MaWmbAgdpSrBQvCFqhezUn4AHqJHbaEnfbVYYiexVSs//tqOdY/DxhjdCiJnIA==",
+ "dev": true,
"funding": [
{
"type": "GitHub Sponsors",
@@ -35407,6 +35432,7 @@
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-2.0.1.tgz",
"integrity": "sha512-VFMekyQExqIW7xIChcXn4ok29YE3rnuyveW3wZQWWqF4Nv9Wk5rgJ99KzPvHjkmPXF93FXIbBp6YdW3t71/7Vg==",
+ "dev": true,
"funding": [
{
"type": "GitHub Sponsors",
@@ -35429,6 +35455,7 @@
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.1.tgz",
"integrity": "sha512-zRkxjtBxxLd2Sc0d+fbnEunsTj46SWXgXciZmHq0kDYGnck/ZSGj9/wULTV95uoeYiK5hRXP2mJ98Uo4cq/LQg==",
+ "dev": true,
"funding": [
{
"type": "GitHub Sponsors",
@@ -35449,6 +35476,7 @@
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-2.0.1.tgz",
"integrity": "sha512-5bZ+3CjhAd9eChYTHsjy6TGxpOFSKgKKJPJxr293jTbfry2KDoWkhBb6TcPVB4NmzaPhMs1Frm9AZH7OD4Cjzw==",
+ "dev": true,
"funding": [
{
"type": "GitHub Sponsors",
@@ -35471,6 +35499,7 @@
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-2.0.1.tgz",
"integrity": "sha512-Ob0nuZ3PKt/n0hORHyvoD9uZhr+Za8sFoP+OnMcnWK5lngSzALgQYKMr9RJVOWLqQYuyn6ulqGWSXdwf6F80lQ==",
+ "dev": true,
"funding": [
{
"type": "GitHub Sponsors",
@@ -35513,6 +35542,7 @@
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-2.0.1.tgz",
"integrity": "sha512-QUNFEOPELfmvv+4xiNg2sRYeS/P84pTW0TCgP5zc9FpXetHY0ab7SxKyAQCNCc1eK0459uoLI1y5oO5Vc1dbhA==",
+ "dev": true,
"funding": [
{
"type": "GitHub Sponsors",
@@ -35532,6 +35562,7 @@
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-2.0.1.tgz",
"integrity": "sha512-K0kHzM6afW/MbeWYWLjoHQv1sgg2Q9EccHEDzSkxiP/EaagNzCm7T/WMKZ3rjMbvIpvBiZgwR3dKMygtA4mG1Q==",
+ "dev": true,
"funding": [
{
"type": "GitHub Sponsors",
@@ -35553,6 +35584,7 @@
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-2.0.1.tgz",
"integrity": "sha512-OnAnH8Ujmy59JcyZw8JSbK9cGpdVY44NKgSM7E9Eh7DiLS2E9RNQf0dONaGDzEG9yjEl5hcqeIsj4hfRkLH/Bg==",
+ "dev": true,
"funding": [
{
"type": "GitHub Sponsors",
@@ -35573,6 +35605,7 @@
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.2.tgz",
"integrity": "sha512-ccUbYk6CwVdkmCQMyr64dXz42EfHGkPQlBj5p7YVGzq8I7CtjXZJrubAYezf7Rp+bjPseiROqe7G6foFd+lEuw==",
+ "dev": true,
"funding": [
{
"type": "GitHub Sponsors",
@@ -35592,6 +35625,7 @@
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-2.0.1.tgz",
"integrity": "sha512-nDV/77Fj6eH1ynwscYTOsbK7rR//Uj0bZXBwJZRfaLEJ1iGBR6kIfNmlNqaqJf649EP0F3NWNdeJi03elllNUQ==",
+ "dev": true,
"funding": [
{
"type": "GitHub Sponsors",
@@ -35630,6 +35664,7 @@
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-2.0.1.tgz",
"integrity": "sha512-2cNEiYDhCWKI+Gs9T0Tiysk136SnR13hhO8yW6BGNyhOC4qYFnwF1nKfD3HFAIXA5c45RrIG1ub11GiXeYd1xA==",
+ "dev": true,
"funding": [
{
"type": "GitHub Sponsors",
@@ -35646,6 +35681,7 @@
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.1.tgz",
"integrity": "sha512-sxPqmo70LyARJs0w2UclACPUUEqltCkJ6PhKdMIDuJ3gSf/Q+/GIe3WKl0Ijb/GyH9lOpUkRAO2wp0GVkLvS9Q==",
+ "dev": true,
"funding": [
{
"type": "GitHub Sponsors",
@@ -35665,6 +35701,7 @@
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.1.tgz",
"integrity": "sha512-VdQyxFWFT2/FGJgwQnJYbe1jjQoNTS4RjglmSjTUlpUMa95Htx9NHeYW4rGDJzbjvCsl9eLjMQwGeElsqmzcHg==",
+ "dev": true,
"funding": [
{
"type": "GitHub Sponsors",
@@ -35705,6 +35742,7 @@
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.0.4.tgz",
"integrity": "sha512-N6hXjrin2GTJDe3MVjf5FuXpm12PGm80BrUAeub9XFXca8JZbP+oIwY4LJSVwFUCL1IPm/WwSVUN7goFHmSGGQ==",
+ "dev": true,
"funding": [
{
"type": "GitHub Sponsors",
@@ -43327,6 +43365,7 @@
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-4.0.0.tgz",
"integrity": "sha512-U92vJgBPkbw4Zfu/IiW2oTZLSL3Zpv+uI7My2eq8JxKgqraFdU8YUGicEJCEgSbeaG+QDFqIcwwfMTOEelPxuA==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"@types/mdast": "^4.0.0",
@@ -43345,12 +43384,14 @@
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz",
"integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==",
+ "dev": true,
"license": "MIT"
},
"node_modules/remark-gfm/node_modules/is-plain-obj": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz",
"integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==",
+ "dev": true,
"license": "MIT",
"engines": {
"node": ">=12"
@@ -43363,6 +43404,7 @@
"version": "11.0.0",
"resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-11.0.0.tgz",
"integrity": "sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"@types/mdast": "^4.0.0",
@@ -43379,6 +43421,7 @@
"version": "11.0.5",
"resolved": "https://registry.npmjs.org/unified/-/unified-11.0.5.tgz",
"integrity": "sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"@types/unist": "^3.0.0",
@@ -43398,6 +43441,7 @@
"version": "6.0.3",
"resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz",
"integrity": "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"@types/unist": "^3.0.0",
@@ -43412,6 +43456,7 @@
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz",
"integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"@types/unist": "^3.0.0",
@@ -44089,6 +44134,7 @@
"version": "11.0.0",
"resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-11.0.0.tgz",
"integrity": "sha512-1OSmLd3awB/t8qdoEOMazZkNsfVTeY4fTsgzcQFdXNq8ToTN4ZGwrMnlda4K6smTFKD+GRV6O48i6Z4iKgPPpw==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"@types/mdast": "^4.0.0",
@@ -44104,12 +44150,14 @@
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz",
"integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==",
+ "dev": true,
"license": "MIT"
},
"node_modules/remark-stringify/node_modules/is-plain-obj": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz",
"integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==",
+ "dev": true,
"license": "MIT",
"engines": {
"node": ">=12"
@@ -44122,6 +44170,7 @@
"version": "11.0.5",
"resolved": "https://registry.npmjs.org/unified/-/unified-11.0.5.tgz",
"integrity": "sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"@types/unist": "^3.0.0",
@@ -44141,6 +44190,7 @@
"version": "6.0.3",
"resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz",
"integrity": "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"@types/unist": "^3.0.0",
@@ -44155,6 +44205,7 @@
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.2.tgz",
"integrity": "sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"@types/unist": "^3.0.0",
@@ -52344,7 +52395,7 @@
"react-markdown": "^8.0.7",
"rehype-raw": "^7.0.0",
"rehype-sanitize": "^6.0.0",
- "remark-gfm": "^4.0.0",
+ "remark-gfm": "^3.0.1",
"reselect": "^4.0.0",
"rison": "^0.1.1",
"seedrandom": "^3.0.5",
@@ -52388,6 +52439,15 @@
"tinycolor2": "*"
}
},
+ "packages/superset-ui-core/node_modules/@types/mdast": {
+ "version": "3.0.15",
+ "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.15.tgz",
+ "integrity": "sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/unist": "^2"
+ }
+ },
"packages/superset-ui-core/node_modules/d3-color": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/d3-color/-/d3-color-2.0.0.tgz",
@@ -52434,6 +52494,18 @@
"d3-time": "1 - 2"
}
},
+ "packages/superset-ui-core/node_modules/escape-string-regexp": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz",
+ "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"packages/superset-ui-core/node_modules/fetch-mock": {
"version": "11.1.5",
"resolved": "https://registry.npmjs.org/fetch-mock/-/fetch-mock-11.1.5.tgz",
@@ -52456,6 +52528,806 @@
}
}
},
+ "packages/superset-ui-core/node_modules/mdast-util-find-and-replace": {
+ "version": "2.2.2",
+ "resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-2.2.2.tgz",
+ "integrity": "sha512-MTtdFRz/eMDHXzeK6W3dO7mXUlF82Gom4y0oOgvHhh/HXZAGvIQDUvQ0SuUx+j2tv44b8xTHOm8K/9OoRFnXKw==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/mdast": "^3.0.0",
+ "escape-string-regexp": "^5.0.0",
+ "unist-util-is": "^5.0.0",
+ "unist-util-visit-parents": "^5.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "packages/superset-ui-core/node_modules/mdast-util-from-markdown": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-1.3.1.tgz",
+ "integrity": "sha512-4xTO/M8c82qBcnQc1tgpNtubGUW/Y1tBQ1B0i5CtSoelOLKFYlElIr3bvgREYYO5iRqbMY1YuqZng0GVOI8Qww==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/mdast": "^3.0.0",
+ "@types/unist": "^2.0.0",
+ "decode-named-character-reference": "^1.0.0",
+ "mdast-util-to-string": "^3.1.0",
+ "micromark": "^3.0.0",
+ "micromark-util-decode-numeric-character-reference": "^1.0.0",
+ "micromark-util-decode-string": "^1.0.0",
+ "micromark-util-normalize-identifier": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0",
+ "unist-util-stringify-position": "^3.0.0",
+ "uvu": "^0.5.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "packages/superset-ui-core/node_modules/mdast-util-gfm": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-2.0.2.tgz",
+ "integrity": "sha512-qvZ608nBppZ4icQlhQQIAdc6S3Ffj9RGmzwUKUWuEICFnd1LVkN3EktF7ZHAgfcEdvZB5owU9tQgt99e2TlLjg==",
+ "license": "MIT",
+ "dependencies": {
+ "mdast-util-from-markdown": "^1.0.0",
+ "mdast-util-gfm-autolink-literal": "^1.0.0",
+ "mdast-util-gfm-footnote": "^1.0.0",
+ "mdast-util-gfm-strikethrough": "^1.0.0",
+ "mdast-util-gfm-table": "^1.0.0",
+ "mdast-util-gfm-task-list-item": "^1.0.0",
+ "mdast-util-to-markdown": "^1.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "packages/superset-ui-core/node_modules/mdast-util-gfm-autolink-literal": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-1.0.3.tgz",
+ "integrity": "sha512-My8KJ57FYEy2W2LyNom4n3E7hKTuQk/0SES0u16tjA9Z3oFkF4RrC/hPAPgjlSpezsOvI8ObcXcElo92wn5IGA==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/mdast": "^3.0.0",
+ "ccount": "^2.0.0",
+ "mdast-util-find-and-replace": "^2.0.0",
+ "micromark-util-character": "^1.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "packages/superset-ui-core/node_modules/mdast-util-gfm-footnote": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-1.0.2.tgz",
+ "integrity": "sha512-56D19KOGbE00uKVj3sgIykpwKL179QsVFwx/DCW0u/0+URsryacI4MAdNJl0dh+u2PSsD9FtxPFbHCzJ78qJFQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/mdast": "^3.0.0",
+ "mdast-util-to-markdown": "^1.3.0",
+ "micromark-util-normalize-identifier": "^1.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "packages/superset-ui-core/node_modules/mdast-util-gfm-strikethrough": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-1.0.3.tgz",
+ "integrity": "sha512-DAPhYzTYrRcXdMjUtUjKvW9z/FNAMTdU0ORyMcbmkwYNbKocDpdk+PX1L1dQgOID/+vVs1uBQ7ElrBQfZ0cuiQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/mdast": "^3.0.0",
+ "mdast-util-to-markdown": "^1.3.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "packages/superset-ui-core/node_modules/mdast-util-gfm-table": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-1.0.7.tgz",
+ "integrity": "sha512-jjcpmNnQvrmN5Vx7y7lEc2iIOEytYv7rTvu+MeyAsSHTASGCCRA79Igg2uKssgOs1i1po8s3plW0sTu1wkkLGg==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/mdast": "^3.0.0",
+ "markdown-table": "^3.0.0",
+ "mdast-util-from-markdown": "^1.0.0",
+ "mdast-util-to-markdown": "^1.3.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "packages/superset-ui-core/node_modules/mdast-util-gfm-task-list-item": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-1.0.2.tgz",
+ "integrity": "sha512-PFTA1gzfp1B1UaiJVyhJZA1rm0+Tzn690frc/L8vNX1Jop4STZgOE6bxUhnzdVSB+vm2GU1tIsuQcA9bxTQpMQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/mdast": "^3.0.0",
+ "mdast-util-to-markdown": "^1.3.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "packages/superset-ui-core/node_modules/mdast-util-phrasing": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-3.0.1.tgz",
+ "integrity": "sha512-WmI1gTXUBJo4/ZmSk79Wcb2HcjPJBzM1nlI/OUWA8yk2X9ik3ffNbBGsU+09BFmXaL1IBb9fiuvq6/KMiNycSg==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/mdast": "^3.0.0",
+ "unist-util-is": "^5.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "packages/superset-ui-core/node_modules/mdast-util-to-markdown": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-1.5.0.tgz",
+ "integrity": "sha512-bbv7TPv/WC49thZPg3jXuqzuvI45IL2EVAr/KxF0BSdHsU0ceFHOmwQn6evxAh1GaoK/6GQ1wp4R4oW2+LFL/A==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/mdast": "^3.0.0",
+ "@types/unist": "^2.0.0",
+ "longest-streak": "^3.0.0",
+ "mdast-util-phrasing": "^3.0.0",
+ "mdast-util-to-string": "^3.0.0",
+ "micromark-util-decode-string": "^1.0.0",
+ "unist-util-visit": "^4.0.0",
+ "zwitch": "^2.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "packages/superset-ui-core/node_modules/mdast-util-to-string": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-3.2.0.tgz",
+ "integrity": "sha512-V4Zn/ncyN1QNSqSBxTrMOLpjr+IKdHl2v3KVLoWmDPscP4r9GcCi71gjgvUV1SFSKh92AjAG4peFuBl2/YgCJg==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/mdast": "^3.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "packages/superset-ui-core/node_modules/micromark": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/micromark/-/micromark-3.2.0.tgz",
+ "integrity": "sha512-uD66tJj54JLYq0De10AhWycZWGQNUvDI55xPgk2sQM5kn1JYlhbCMTtEeT27+vAhW2FBQxLlOmS3pmA7/2z4aA==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "@types/debug": "^4.0.0",
+ "debug": "^4.0.0",
+ "decode-named-character-reference": "^1.0.0",
+ "micromark-core-commonmark": "^1.0.1",
+ "micromark-factory-space": "^1.0.0",
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-chunked": "^1.0.0",
+ "micromark-util-combine-extensions": "^1.0.0",
+ "micromark-util-decode-numeric-character-reference": "^1.0.0",
+ "micromark-util-encode": "^1.0.0",
+ "micromark-util-normalize-identifier": "^1.0.0",
+ "micromark-util-resolve-all": "^1.0.0",
+ "micromark-util-sanitize-uri": "^1.0.0",
+ "micromark-util-subtokenize": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.1",
+ "uvu": "^0.5.0"
+ }
+ },
+ "packages/superset-ui-core/node_modules/micromark-core-commonmark": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-1.1.0.tgz",
+ "integrity": "sha512-BgHO1aRbolh2hcrzL2d1La37V0Aoz73ymF8rAcKnohLy93titmv62E0gP8Hrx9PKcKrqCZ1BbLGbP3bEhoXYlw==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "decode-named-character-reference": "^1.0.0",
+ "micromark-factory-destination": "^1.0.0",
+ "micromark-factory-label": "^1.0.0",
+ "micromark-factory-space": "^1.0.0",
+ "micromark-factory-title": "^1.0.0",
+ "micromark-factory-whitespace": "^1.0.0",
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-chunked": "^1.0.0",
+ "micromark-util-classify-character": "^1.0.0",
+ "micromark-util-html-tag-name": "^1.0.0",
+ "micromark-util-normalize-identifier": "^1.0.0",
+ "micromark-util-resolve-all": "^1.0.0",
+ "micromark-util-subtokenize": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.1",
+ "uvu": "^0.5.0"
+ }
+ },
+ "packages/superset-ui-core/node_modules/micromark-extension-gfm": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-2.0.3.tgz",
+ "integrity": "sha512-vb9OoHqrhCmbRidQv/2+Bc6pkP0FrtlhurxZofvOEy5o8RtuuvTq+RQ1Vw5ZDNrVraQZu3HixESqbG+0iKk/MQ==",
+ "license": "MIT",
+ "dependencies": {
+ "micromark-extension-gfm-autolink-literal": "^1.0.0",
+ "micromark-extension-gfm-footnote": "^1.0.0",
+ "micromark-extension-gfm-strikethrough": "^1.0.0",
+ "micromark-extension-gfm-table": "^1.0.0",
+ "micromark-extension-gfm-tagfilter": "^1.0.0",
+ "micromark-extension-gfm-task-list-item": "^1.0.0",
+ "micromark-util-combine-extensions": "^1.0.0",
+ "micromark-util-types": "^1.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "packages/superset-ui-core/node_modules/micromark-extension-gfm-autolink-literal": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-1.0.5.tgz",
+ "integrity": "sha512-z3wJSLrDf8kRDOh2qBtoTRD53vJ+CWIyo7uyZuxf/JAbNJjiHsOpG1y5wxk8drtv3ETAHutCu6N3thkOOgueWg==",
+ "license": "MIT",
+ "dependencies": {
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-sanitize-uri": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "packages/superset-ui-core/node_modules/micromark-extension-gfm-footnote": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-1.1.2.tgz",
+ "integrity": "sha512-Yxn7z7SxgyGWRNa4wzf8AhYYWNrwl5q1Z8ii+CSTTIqVkmGZF1CElX2JI8g5yGoM3GAman9/PVCUFUSJ0kB/8Q==",
+ "license": "MIT",
+ "dependencies": {
+ "micromark-core-commonmark": "^1.0.0",
+ "micromark-factory-space": "^1.0.0",
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-normalize-identifier": "^1.0.0",
+ "micromark-util-sanitize-uri": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0",
+ "uvu": "^0.5.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "packages/superset-ui-core/node_modules/micromark-extension-gfm-strikethrough": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-1.0.7.tgz",
+ "integrity": "sha512-sX0FawVE1o3abGk3vRjOH50L5TTLr3b5XMqnP9YDRb34M0v5OoZhG+OHFz1OffZ9dlwgpTBKaT4XW/AsUVnSDw==",
+ "license": "MIT",
+ "dependencies": {
+ "micromark-util-chunked": "^1.0.0",
+ "micromark-util-classify-character": "^1.0.0",
+ "micromark-util-resolve-all": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0",
+ "uvu": "^0.5.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "packages/superset-ui-core/node_modules/micromark-extension-gfm-table": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-1.0.7.tgz",
+ "integrity": "sha512-3ZORTHtcSnMQEKtAOsBQ9/oHp9096pI/UvdPtN7ehKvrmZZ2+bbWhi0ln+I9drmwXMt5boocn6OlwQzNXeVeqw==",
+ "license": "MIT",
+ "dependencies": {
+ "micromark-factory-space": "^1.0.0",
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0",
+ "uvu": "^0.5.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "packages/superset-ui-core/node_modules/micromark-extension-gfm-tagfilter": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-1.0.2.tgz",
+ "integrity": "sha512-5XWB9GbAUSHTn8VPU8/1DBXMuKYT5uOgEjJb8gN3mW0PNW5OPHpSdojoqf+iq1xo7vWzw/P8bAHY0n6ijpXF7g==",
+ "license": "MIT",
+ "dependencies": {
+ "micromark-util-types": "^1.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "packages/superset-ui-core/node_modules/micromark-extension-gfm-task-list-item": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-1.0.5.tgz",
+ "integrity": "sha512-RMFXl2uQ0pNQy6Lun2YBYT9g9INXtWJULgbt01D/x8/6yJ2qpKyzdZD3pi6UIkzF++Da49xAelVKUeUMqd5eIQ==",
+ "license": "MIT",
+ "dependencies": {
+ "micromark-factory-space": "^1.0.0",
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0",
+ "uvu": "^0.5.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "packages/superset-ui-core/node_modules/micromark-factory-destination": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-1.1.0.tgz",
+ "integrity": "sha512-XaNDROBgx9SgSChd69pjiGKbV+nfHGDPVYFs5dOoDd7ZnMAE+Cuu91BCpsY8RT2NP9vo/B8pds2VQNCLiu0zhg==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0"
+ }
+ },
+ "packages/superset-ui-core/node_modules/micromark-factory-label": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-1.1.0.tgz",
+ "integrity": "sha512-OLtyez4vZo/1NjxGhcpDSbHQ+m0IIGnT8BoPamh+7jVlzLJBH98zzuCoUeMxvM6WsNeh8wx8cKvqLiPHEACn0w==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0",
+ "uvu": "^0.5.0"
+ }
+ },
+ "packages/superset-ui-core/node_modules/micromark-factory-space": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-1.1.0.tgz",
+ "integrity": "sha512-cRzEj7c0OL4Mw2v6nwzttyOZe8XY/Z8G0rzmWQZTBi/jjwyw/U4uqKtUORXQrR5bAZZnbTI/feRV/R7hc4jQYQ==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-types": "^1.0.0"
+ }
+ },
+ "packages/superset-ui-core/node_modules/micromark-factory-title": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-1.1.0.tgz",
+ "integrity": "sha512-J7n9R3vMmgjDOCY8NPw55jiyaQnH5kBdV2/UXCtZIpnHH3P6nHUKaH7XXEYuWwx/xUJcawa8plLBEjMPU24HzQ==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "micromark-factory-space": "^1.0.0",
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0"
+ }
+ },
+ "packages/superset-ui-core/node_modules/micromark-factory-whitespace": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-1.1.0.tgz",
+ "integrity": "sha512-v2WlmiymVSp5oMg+1Q0N1Lxmt6pMhIHD457whWM7/GUlEks1hI9xj5w3zbc4uuMKXGisksZk8DzP2UyGbGqNsQ==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "micromark-factory-space": "^1.0.0",
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0"
+ }
+ },
+ "packages/superset-ui-core/node_modules/micromark-util-character": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-1.2.0.tgz",
+ "integrity": "sha512-lXraTwcX3yH/vMDaFWCQJP1uIszLVebzUa3ZHdrgxr7KEU/9mL4mVgCpGbyhvNLNlauROiNUq7WN5u7ndbY6xg==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0"
+ }
+ },
+ "packages/superset-ui-core/node_modules/micromark-util-chunked": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-1.1.0.tgz",
+ "integrity": "sha512-Ye01HXpkZPNcV6FiyoW2fGZDUw4Yc7vT0E9Sad83+bEDiCJ1uXu0S3mr8WLpsz3HaG3x2q0HM6CTuPdcZcluFQ==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "micromark-util-symbol": "^1.0.0"
+ }
+ },
+ "packages/superset-ui-core/node_modules/micromark-util-classify-character": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-1.1.0.tgz",
+ "integrity": "sha512-SL0wLxtKSnklKSUplok1WQFoGhUdWYKggKUiqhX+Swala+BtptGCu5iPRc+xvzJ4PXE/hwM3FNXsfEVgoZsWbw==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0"
+ }
+ },
+ "packages/superset-ui-core/node_modules/micromark-util-combine-extensions": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-1.1.0.tgz",
+ "integrity": "sha512-Q20sp4mfNf9yEqDL50WwuWZHUrCO4fEyeDCnMGmG5Pr0Cz15Uo7KBs6jq+dq0EgX4DPwwrh9m0X+zPV1ypFvUA==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "micromark-util-chunked": "^1.0.0",
+ "micromark-util-types": "^1.0.0"
+ }
+ },
+ "packages/superset-ui-core/node_modules/micromark-util-decode-numeric-character-reference": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-1.1.0.tgz",
+ "integrity": "sha512-m9V0ExGv0jB1OT21mrWcuf4QhP46pH1KkfWy9ZEezqHKAxkj4mPCy3nIH1rkbdMlChLHX531eOrymlwyZIf2iw==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "micromark-util-symbol": "^1.0.0"
+ }
+ },
+ "packages/superset-ui-core/node_modules/micromark-util-decode-string": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-1.1.0.tgz",
+ "integrity": "sha512-YphLGCK8gM1tG1bd54azwyrQRjCFcmgj2S2GoJDNnh4vYtnL38JS8M4gpxzOPNyHdNEpheyWXCTnnTDY3N+NVQ==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "decode-named-character-reference": "^1.0.0",
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-decode-numeric-character-reference": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0"
+ }
+ },
+ "packages/superset-ui-core/node_modules/micromark-util-encode": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-1.1.0.tgz",
+ "integrity": "sha512-EuEzTWSTAj9PA5GOAs992GzNh2dGQO52UvAbtSOMvXTxv3Criqb6IOzJUBCmEqrrXSblJIJBbFFv6zPxpreiJw==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT"
+ },
+ "packages/superset-ui-core/node_modules/micromark-util-html-tag-name": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-1.2.0.tgz",
+ "integrity": "sha512-VTQzcuQgFUD7yYztuQFKXT49KghjtETQ+Wv/zUjGSGBioZnkA4P1XXZPT1FHeJA6RwRXSF47yvJ1tsJdoxwO+Q==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT"
+ },
+ "packages/superset-ui-core/node_modules/micromark-util-normalize-identifier": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-1.1.0.tgz",
+ "integrity": "sha512-N+w5vhqrBihhjdpM8+5Xsxy71QWqGn7HYNUvch71iV2PM7+E3uWGox1Qp90loa1ephtCxG2ftRV/Conitc6P2Q==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "micromark-util-symbol": "^1.0.0"
+ }
+ },
+ "packages/superset-ui-core/node_modules/micromark-util-resolve-all": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-1.1.0.tgz",
+ "integrity": "sha512-b/G6BTMSg+bX+xVCshPTPyAu2tmA0E4X98NSR7eIbeC6ycCqCeE7wjfDIgzEbkzdEVJXRtOG4FbEm/uGbCRouA==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "micromark-util-types": "^1.0.0"
+ }
+ },
+ "packages/superset-ui-core/node_modules/micromark-util-sanitize-uri": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-1.2.0.tgz",
+ "integrity": "sha512-QO4GXv0XZfWey4pYFndLUKEAktKkG5kZTdUNaTAkzbuJxn2tNBOr+QtxR2XpWaMhbImT2dPzyLrPXLlPhph34A==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "micromark-util-character": "^1.0.0",
+ "micromark-util-encode": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0"
+ }
+ },
+ "packages/superset-ui-core/node_modules/micromark-util-subtokenize": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-1.1.0.tgz",
+ "integrity": "sha512-kUQHyzRoxvZO2PuLzMt2P/dwVsTiivCK8icYTeR+3WgbuPqfHgPPy7nFKbeqRivBvn/3N3GBiNC+JRTMSxEC7A==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "micromark-util-chunked": "^1.0.0",
+ "micromark-util-symbol": "^1.0.0",
+ "micromark-util-types": "^1.0.0",
+ "uvu": "^0.5.0"
+ }
+ },
+ "packages/superset-ui-core/node_modules/micromark-util-symbol": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-1.1.0.tgz",
+ "integrity": "sha512-uEjpEYY6KMs1g7QfJ2eX1SQEV+ZT4rUD3UcF6l57acZvLNK7PBZL+ty82Z1qhK1/yXIY4bdx04FKMgR0g4IAag==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT"
+ },
+ "packages/superset-ui-core/node_modules/micromark-util-types": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-1.1.0.tgz",
+ "integrity": "sha512-ukRBgie8TIAcacscVHSiddHjO4k/q3pnedmzMQ4iwDcK0FtFCohKOlFbaOL/mPgfnPsL3C1ZyxJa4sbWrBl3jg==",
+ "funding": [
+ {
+ "type": "GitHub Sponsors",
+ "url": "https://github.com/sponsors/unifiedjs"
+ },
+ {
+ "type": "OpenCollective",
+ "url": "https://opencollective.com/unified"
+ }
+ ],
+ "license": "MIT"
+ },
+ "packages/superset-ui-core/node_modules/remark-gfm": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-3.0.1.tgz",
+ "integrity": "sha512-lEFDoi2PICJyNrACFOfDD3JlLkuSbOa5Wd8EPt06HUdptv8Gn0bxYTdbU/XXQ3swAPkEaGxxPN9cbnMHvVu1Ig==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/mdast": "^3.0.0",
+ "mdast-util-gfm": "^2.0.0",
+ "micromark-extension-gfm": "^2.0.0",
+ "unified": "^10.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "packages/superset-ui-core/node_modules/unist-util-is": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz",
+ "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/unist": "^2.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "packages/superset-ui-core/node_modules/unist-util-stringify-position": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz",
+ "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/unist": "^2.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
+ "packages/superset-ui-core/node_modules/unist-util-visit-parents": {
+ "version": "5.1.3",
+ "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz",
+ "integrity": "sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/unist": "^2.0.0",
+ "unist-util-is": "^5.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/unified"
+ }
+ },
"packages/superset-ui-demo": {
"name": "@superset-ui/demo",
"version": "0.20.0",
diff --git a/superset-frontend/packages/superset-ui-core/package.json b/superset-frontend/packages/superset-ui-core/package.json
index 9240c7287a..df96e66727 100644
--- a/superset-frontend/packages/superset-ui-core/package.json
+++ b/superset-frontend/packages/superset-ui-core/package.json
@@ -26,6 +26,7 @@
"dependencies": {
"@babel/runtime": "^7.25.6",
"@types/json-bigint": "^1.0.4",
+ "@visx/responsive": "^3.12.0",
"csstype": "^3.1.3",
"d3-format": "^1.3.2",
"d3-interpolate": "^3.0.1",
@@ -41,11 +42,10 @@
"react-markdown": "^8.0.7",
"rehype-raw": "^7.0.0",
"rehype-sanitize": "^6.0.0",
- "remark-gfm": "^4.0.0",
+ "remark-gfm": "^3.0.1",
"reselect": "^4.0.0",
"rison": "^0.1.1",
"seedrandom": "^3.0.5",
- "@visx/responsive": "^3.12.0",
"whatwg-fetch": "^3.6.20",
"xss": "^1.0.14"
},
(superset) 02/18: fix(fe/dashboard-list): display modifier info for `Last modified` data (#32035)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 7aa4cd4eef2ce759773579d2be76ddc337ea62fe
Author: Đỗ Trọng Hải <41...@users.noreply.github.com>
AuthorDate: Sat Feb 22 02:14:08 2025 +0700
fix(fe/dashboard-list): display modifier info for `Last modified` data (#32035)
Signed-off-by: hainenber <do...@gmail.com>
(cherry picked from commit 88cf2d5c39d7d44757e990aed046dd62447256b3)
---
superset-frontend/src/pages/DashboardList/DashboardList.test.jsx | 2 +-
superset-frontend/src/pages/DashboardList/index.tsx | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/superset-frontend/src/pages/DashboardList/DashboardList.test.jsx b/superset-frontend/src/pages/DashboardList/DashboardList.test.jsx
index 0cf6db2ae8..2fc46c800a 100644
--- a/superset-frontend/src/pages/DashboardList/DashboardList.test.jsx
+++ b/superset-frontend/src/pages/DashboardList/DashboardList.test.jsx
@@ -166,7 +166,7 @@ describe('DashboardList', () => {
const callsD = fetchMock.calls(/dashboard\/\?q/);
expect(callsD).toHaveLength(1);
expect(callsD[0][0]).toMatchInlineSnapshot(
- `"http://localhost/api/v1/dashboard/?q=(order_column:changed_on_delta_humanized,order_direction:desc,page:0,page_size:25,select_columns:!(id,dashboard_title,published,url,slug,changed_by,changed_on_delta_humanized,owners.id,owners.first_name,owners.last_name,owners,tags.id,tags.name,tags.type,status,certified_by,certification_details,changed_on))"`,
+ `"http://localhost/api/v1/dashboard/?q=(order_column:changed_on_delta_humanized,order_direction:desc,page:0,page_size:25,select_columns:!(id,dashboard_title,published,url,slug,changed_by,changed_by.id,changed_by.first_name,changed_by.last_name,changed_on_delta_humanized,owners,owners.id,owners.first_name,owners.last_name,tags.id,tags.name,tags.type,status,certified_by,certification_details,changed_on))"`,
);
});
diff --git a/superset-frontend/src/pages/DashboardList/index.tsx b/superset-frontend/src/pages/DashboardList/index.tsx
index 93d2904086..3e63bd4b91 100644
--- a/superset-frontend/src/pages/DashboardList/index.tsx
+++ b/superset-frontend/src/pages/DashboardList/index.tsx
@@ -119,11 +119,14 @@ const DASHBOARD_COLUMNS_TO_FETCH = [
'url',
'slug',
'changed_by',
+ 'changed_by.id',
+ 'changed_by.first_name',
+ 'changed_by.last_name',
'changed_on_delta_humanized',
+ 'owners',
'owners.id',
'owners.first_name',
'owners.last_name',
- 'owners',
'tags.id',
'tags.name',
'tags.type',
(superset) 13/18: fix(clickhouse): get_parameters_from_uri failing when secure is true (#32423)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 35cf8290b7fee5a8b45f743182d33174a5b73408
Author: Le Xich Long <co...@users.noreply.github.com>
AuthorDate: Sat Mar 1 05:24:14 2025 +0800
fix(clickhouse): get_parameters_from_uri failing when secure is true (#32423)
(cherry picked from commit 84b52b23231de6661d6ecf9f80c70fcc14fa0142)
---
superset/db_engine_specs/clickhouse.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/superset/db_engine_specs/clickhouse.py b/superset/db_engine_specs/clickhouse.py
index 0d40acbe67..8fb8e1d099 100644
--- a/superset/db_engine_specs/clickhouse.py
+++ b/superset/db_engine_specs/clickhouse.py
@@ -334,9 +334,9 @@ class ClickHouseConnectEngineSpec(BasicParametersMixin, ClickHouseEngineSpec):
cls, uri: str, encrypted_extra: dict[str, Any] | None = None
) -> BasicParametersType:
url = make_url_safe(uri)
- query = url.query
+ query = dict(url.query)
if "secure" in query:
- encryption = url.query.get("secure") == "true"
+ encryption = query.get("secure") == "true"
query.pop("secure")
else:
encryption = False
@@ -346,7 +346,7 @@ class ClickHouseConnectEngineSpec(BasicParametersMixin, ClickHouseEngineSpec):
host=url.host,
port=url.port,
database="" if url.database == "__default__" else cast(str, url.database),
- query=dict(query),
+ query=query,
encryption=encryption,
)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 0a35d3efa4ea5747c126198cca5a21e7600c80e9
Author: Evan Rusackas <ev...@preset.io>
AuthorDate: Mon Mar 3 15:04:05 2025 -0700
fix(tooltip): displaying <a> tags correctly (#32488)
(cherry picked from commit 6c3886aad0c0a2a5abcc0e14872c52224f8a736e)
---
.../plugins/plugin-chart-pivot-table/src/plugin/controlPanel.tsx | 2 +-
superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/controlPanel.tsx
index 47d442bed5..f18c6c41f5 100644
--- a/superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/controlPanel.tsx
+++ b/superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/controlPanel.tsx
@@ -442,7 +442,7 @@ const config: ControlPanelConfig = {
renderTrigger: true,
default: true,
description: t(
- 'Renders table cells as HTML when applicable. For example, HTML <a> tags will be rendered as hyperlinks.',
+ 'Renders table cells as HTML when applicable. For example, HTML <a> tags will be rendered as hyperlinks.',
),
},
},
diff --git a/superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx
index c39ad116c7..933ee6a0c1 100644
--- a/superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx
+++ b/superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx
@@ -467,7 +467,7 @@ const config: ControlPanelConfig = {
renderTrigger: true,
default: true,
description: t(
- 'Renders table cells as HTML when applicable. For example, HTML <a> tags will be rendered as hyperlinks.',
+ 'Renders table cells as HTML when applicable. For example, HTML <a> tags will be rendered as hyperlinks.',
),
},
},
(superset) 09/18: fix: bump FAB to 4.5.4 (#32325)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 4c2da538867122d6bc4508b3bbacf36bfa648c38
Author: Daniel Vaz Gaspar <da...@gmail.com>
AuthorDate: Tue Feb 25 19:06:41 2025 +0000
fix: bump FAB to 4.5.4 (#32325)
(cherry picked from commit c02a0a00f41741494b4b0ef403eca77c731469c2)
---
pyproject.toml | 2 +-
requirements/base.txt | 2 +-
requirements/development.txt | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/pyproject.toml b/pyproject.toml
index 0d93f9e96f..de4776db06 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -44,7 +44,7 @@ dependencies = [
"cryptography>=42.0.4, <44.0.0",
"deprecation>=2.1.0, <2.2.0",
"flask>=2.2.5, <3.0.0",
- "flask-appbuilder>=4.5.3, <5.0.0",
+ "flask-appbuilder>=4.5.4, <5.0.0",
"flask-caching>=2.1.0, <3",
"flask-compress>=1.13, <2.0",
"flask-talisman>=1.0.0, <2.0",
diff --git a/requirements/base.txt b/requirements/base.txt
index 3ba7e3f984..57b7cf64dc 100644
--- a/requirements/base.txt
+++ b/requirements/base.txt
@@ -108,7 +108,7 @@ flask==2.3.3
# flask-session
# flask-sqlalchemy
# flask-wtf
-flask-appbuilder==4.5.3
+flask-appbuilder==4.5.4
# via apache-superset (pyproject.toml)
flask-babel==2.0.0
# via flask-appbuilder
diff --git a/requirements/development.txt b/requirements/development.txt
index 276ca4e20e..430aad26aa 100644
--- a/requirements/development.txt
+++ b/requirements/development.txt
@@ -190,7 +190,7 @@ flask==2.3.3
# flask-sqlalchemy
# flask-testing
# flask-wtf
-flask-appbuilder==4.5.3
+flask-appbuilder==4.5.4
# via
# -c requirements/base.txt
# apache-superset
(superset) 08/18: fix: ensure metric_macro expands templates (#32344)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 654062db27cad5c5a7034e6d09012f9b87a331fe
Author: Beto Dealmeida <ro...@dealmeida.net>
AuthorDate: Mon Feb 24 18:08:50 2025 -0500
fix: ensure metric_macro expands templates (#32344)
---
superset/jinja_context.py | 45 ++++++--
tests/unit_tests/jinja_context_test.py | 194 ++++++++++++++++++++++++++++++---
2 files changed, 210 insertions(+), 29 deletions(-)
diff --git a/superset/jinja_context.py b/superset/jinja_context.py
index b0e29505a0..4b02a69a75 100644
--- a/superset/jinja_context.py
+++ b/superset/jinja_context.py
@@ -601,7 +601,12 @@ class BaseTemplateProcessor:
kwargs.update(self._context)
context = validate_template_context(self.engine, kwargs)
- return template.render(context)
+ try:
+ return template.render(context)
+ except RecursionError as ex:
+ raise SupersetTemplateException(
+ "Infinite recursion detected in template"
+ ) from ex
class JinjaTemplateProcessor(BaseTemplateProcessor):
@@ -658,11 +663,18 @@ class JinjaTemplateProcessor(BaseTemplateProcessor):
"filter_values": partial(safe_proxy, extra_cache.filter_values),
"get_filters": partial(safe_proxy, extra_cache.get_filters),
"dataset": partial(safe_proxy, dataset_macro_with_context),
- "metric": partial(safe_proxy, metric_macro),
"get_time_filter": partial(safe_proxy, extra_cache.get_time_filter),
}
)
+ # The `metric` filter needs the full context, in order to expand other filters
+ self._context["metric"] = partial(
+ safe_proxy,
+ metric_macro,
+ self.env,
+ self._context,
+ )
+
class NoOpTemplateProcessor(BaseTemplateProcessor):
def process_template(self, sql: str, **kwargs: Any) -> str:
@@ -888,7 +900,12 @@ def get_dataset_id_from_context(metric_key: str) -> int:
raise SupersetTemplateException(exc_message)
-def metric_macro(metric_key: str, dataset_id: Optional[int] = None) -> str:
+def metric_macro(
+ env: Environment,
+ context: dict[str, Any],
+ metric_key: str,
+ dataset_id: Optional[int] = None,
+) -> str:
"""
Given a metric key, returns its syntax.
@@ -911,13 +928,17 @@ def metric_macro(metric_key: str, dataset_id: Optional[int] = None) -> str:
metrics: dict[str, str] = {
metric.metric_name: metric.expression for metric in dataset.metrics
}
- dataset_name = dataset.table_name
- if metric := metrics.get(metric_key):
- return metric
- raise SupersetTemplateException(
- _(
- "Metric ``%(metric_name)s`` not found in %(dataset_name)s.",
- metric_name=metric_key,
- dataset_name=dataset_name,
+ if metric_key not in metrics:
+ raise SupersetTemplateException(
+ _(
+ "Metric ``%(metric_name)s`` not found in %(dataset_name)s.",
+ metric_name=metric_key,
+ dataset_name=dataset.table_name,
+ )
)
- )
+
+ definition = metrics[metric_key]
+ template = env.from_string(definition)
+ definition = template.render(context)
+
+ return definition
diff --git a/tests/unit_tests/jinja_context_test.py b/tests/unit_tests/jinja_context_test.py
index c17c066b9d..d2ec9c8345 100644
--- a/tests/unit_tests/jinja_context_test.py
+++ b/tests/unit_tests/jinja_context_test.py
@@ -21,6 +21,8 @@ from typing import Any
import pytest
from freezegun import freeze_time
+from jinja2 import DebugUndefined
+from jinja2.sandbox import SandboxedEnvironment
from pytest_mock import MockerFixture
from sqlalchemy.dialects import mysql
from sqlalchemy.dialects.postgresql import dialect
@@ -32,6 +34,7 @@ from superset.exceptions import SupersetTemplateException
from superset.jinja_context import (
dataset_macro,
ExtraCache,
+ get_template_processor,
metric_macro,
safe_proxy,
TimeFilter,
@@ -540,10 +543,156 @@ def test_metric_macro_with_dataset_id(mocker: MockerFixture) -> None:
schema="my_schema",
sql=None,
)
- assert metric_macro("count", 1) == "COUNT(*)"
+ env = SandboxedEnvironment(undefined=DebugUndefined)
+ assert metric_macro(env, {}, "count", 1) == "COUNT(*)"
mock_get_form_data.assert_not_called()
+def test_metric_macro_recursive(mocker: MockerFixture) -> None:
+ """
+ Test the ``metric_macro`` when the definition is recursive.
+ """
+ database = Database(id=1, database_name="my_database", sqlalchemy_uri="sqlite://")
+ dataset = SqlaTable(
+ id=1,
+ metrics=[
+ SqlMetric(metric_name="a", expression="COUNT(*)"),
+ SqlMetric(metric_name="b", expression="{{ metric('a') }}"),
+ SqlMetric(metric_name="c", expression="{{ metric('b') }}"),
+ ],
+ table_name="test_dataset",
+ database=database,
+ schema="my_schema",
+ sql=None,
+ )
+
+ mock_g = mocker.patch("superset.jinja_context.g")
+ mock_g.form_data = {"datasource": {"id": 1}}
+ DatasetDAO = mocker.patch("superset.daos.dataset.DatasetDAO") # noqa: N806
+ DatasetDAO.find_by_id.return_value = dataset
+
+ processor = get_template_processor(database=database)
+ assert processor.process_template("{{ metric('c', 1) }}") == "COUNT(*)"
+
+
+def test_metric_macro_expansion(mocker: MockerFixture) -> None:
+ """
+ Test that the ``metric_macro`` expands other macros.
+ """
+ database = Database(id=1, database_name="my_database", sqlalchemy_uri="sqlite://")
+ dataset = SqlaTable(
+ id=1,
+ metrics=[
+ SqlMetric(metric_name="a", expression="{{ current_user_id() }}"),
+ SqlMetric(metric_name="b", expression="{{ metric('a') }}"),
+ SqlMetric(metric_name="c", expression="{{ metric('b') }}"),
+ ],
+ table_name="test_dataset",
+ database=database,
+ schema="my_schema",
+ sql=None,
+ )
+
+ mocker.patch("superset.jinja_context.get_user_id", return_value=42)
+ mock_g = mocker.patch("superset.jinja_context.g")
+ mock_g.form_data = {"datasource": {"id": 1}}
+ DatasetDAO = mocker.patch("superset.daos.dataset.DatasetDAO") # noqa: N806
+ DatasetDAO.find_by_id.return_value = dataset
+
+ processor = get_template_processor(database=database)
+ assert processor.process_template("{{ metric('c') }}") == "42"
+
+
+def test_metric_macro_recursive_compound(mocker: MockerFixture) -> None:
+ """
+ Test the ``metric_macro`` when the definition is compound.
+ """
+ database = Database(id=1, database_name="my_database", sqlalchemy_uri="sqlite://")
+ dataset = SqlaTable(
+ id=1,
+ metrics=[
+ SqlMetric(metric_name="a", expression="SUM(*)"),
+ SqlMetric(metric_name="b", expression="COUNT(*)"),
+ SqlMetric(
+ metric_name="c",
+ expression="{{ metric('a') }} / {{ metric('b') }}",
+ ),
+ ],
+ table_name="test_dataset",
+ database=database,
+ schema="my_schema",
+ sql=None,
+ )
+
+ mock_g = mocker.patch("superset.jinja_context.g")
+ mock_g.form_data = {"datasource": {"id": 1}}
+ DatasetDAO = mocker.patch("superset.daos.dataset.DatasetDAO") # noqa: N806
+ DatasetDAO.find_by_id.return_value = dataset
+
+ processor = get_template_processor(database=database)
+ assert processor.process_template("{{ metric('c') }}") == "SUM(*) / COUNT(*)"
+
+
+def test_metric_macro_recursive_cyclic(mocker: MockerFixture) -> None:
+ """
+ Test the ``metric_macro`` when the definition is cyclic.
+
+ In this case it should stop, and not go into an infinite loop.
+ """
+ database = Database(id=1, database_name="my_database", sqlalchemy_uri="sqlite://")
+ dataset = SqlaTable(
+ id=1,
+ metrics=[
+ SqlMetric(metric_name="a", expression="{{ metric('c') }}"),
+ SqlMetric(metric_name="b", expression="{{ metric('a') }}"),
+ SqlMetric(metric_name="c", expression="{{ metric('b') }}"),
+ ],
+ table_name="test_dataset",
+ database=database,
+ schema="my_schema",
+ sql=None,
+ )
+
+ mock_g = mocker.patch("superset.jinja_context.g")
+ mock_g.form_data = {"datasource": {"id": 1}}
+ DatasetDAO = mocker.patch("superset.daos.dataset.DatasetDAO") # noqa: N806
+ DatasetDAO.find_by_id.return_value = dataset
+
+ processor = get_template_processor(database=database)
+ with pytest.raises(SupersetTemplateException) as excinfo:
+ processor.process_template("{{ metric('c') }}")
+ assert str(excinfo.value) == "Infinite recursion detected in template"
+
+
+def test_metric_macro_recursive_infinite(mocker: MockerFixture) -> None:
+ """
+ Test the ``metric_macro`` when the definition is cyclic.
+
+ In this case it should stop, and not go into an infinite loop.
+ """
+ database = Database(id=1, database_name="my_database", sqlalchemy_uri="sqlite://")
+ dataset = SqlaTable(
+ id=1,
+ metrics=[
+ SqlMetric(metric_name="a", expression="{{ metric('a') }}"),
+ ],
+ table_name="test_dataset",
+ database=database,
+ schema="my_schema",
+ sql=None,
+ )
+
+ mock_g = mocker.patch("superset.jinja_context.g")
+ mock_g.form_data = {"datasource": {"id": 1}}
+ DatasetDAO = mocker.patch("superset.daos.dataset.DatasetDAO") # noqa: N806
+ DatasetDAO.find_by_id.return_value = dataset
+
+ processor = get_template_processor(database=database)
+ with pytest.raises(SupersetTemplateException) as excinfo:
+ processor.process_template("{{ metric('a') }}")
+ assert str(excinfo.value) == "Infinite recursion detected in template"
+
+
def test_metric_macro_with_dataset_id_invalid_key(mocker: MockerFixture) -> None:
"""
Test the ``metric_macro`` when passing a dataset ID and an invalid key.
@@ -559,8 +708,9 @@ def test_metric_macro_with_dataset_id_invalid_key(mocker: MockerFixture) -> None
schema="my_schema",
sql=None,
)
+ env = SandboxedEnvironment(undefined=DebugUndefined)
with pytest.raises(SupersetTemplateException) as excinfo:
- metric_macro("blah", 1)
+ metric_macro(env, {}, "blah", 1)
assert str(excinfo.value) == "Metric ``blah`` not found in test_dataset."
mock_get_form_data.assert_not_called()
@@ -572,8 +722,9 @@ def test_metric_macro_invalid_dataset_id(mocker: MockerFixture) -> None:
mock_get_form_data = mocker.patch("superset.views.utils.get_form_data")
DatasetDAO = mocker.patch("superset.daos.dataset.DatasetDAO") # noqa: N806
DatasetDAO.find_by_id.return_value = None
+ env = SandboxedEnvironment(undefined=DebugUndefined)
with pytest.raises(DatasetNotFoundError) as excinfo:
- metric_macro("macro_key", 100)
+ metric_macro(env, {}, "macro_key", 100)
assert str(excinfo.value) == "Dataset ID 100 not found."
mock_get_form_data.assert_not_called()
@@ -586,9 +737,10 @@ def test_metric_macro_no_dataset_id_no_context(mocker: MockerFixture) -> None:
DatasetDAO = mocker.patch("superset.daos.dataset.DatasetDAO") # noqa: N806
mock_g = mocker.patch("superset.jinja_context.g")
mock_g.form_data = {}
+ env = SandboxedEnvironment(undefined=DebugUndefined)
with app.test_request_context():
with pytest.raises(SupersetTemplateException) as excinfo:
- metric_macro("macro_key")
+ metric_macro(env, {}, "macro_key")
assert str(excinfo.value) == (
"Please specify the Dataset ID for the ``macro_key`` metric in the Jinja macro." # noqa: E501
)
@@ -605,6 +757,8 @@ def test_metric_macro_no_dataset_id_with_context_missing_info(
DatasetDAO = mocker.patch("superset.daos.dataset.DatasetDAO") # noqa: N806
mock_g = mocker.patch("superset.jinja_context.g")
mock_g.form_data = {"queries": []}
+
+ env = SandboxedEnvironment(undefined=DebugUndefined)
with app.test_request_context(
data={
"form_data": json.dumps(
@@ -623,7 +777,7 @@ def test_metric_macro_no_dataset_id_with_context_missing_info(
}
):
with pytest.raises(SupersetTemplateException) as excinfo:
- metric_macro("macro_key")
+ metric_macro(env, {}, "macro_key")
assert str(excinfo.value) == (
"Please specify the Dataset ID for the ``macro_key`` metric in the Jinja macro." # noqa: E501
)
@@ -651,6 +805,7 @@ def test_metric_macro_no_dataset_id_with_context_datasource_id(
mock_g.form_data = {}
# Getting the data from the request context
+ env = SandboxedEnvironment(undefined=DebugUndefined)
with app.test_request_context(
data={
"form_data": json.dumps(
@@ -666,7 +821,7 @@ def test_metric_macro_no_dataset_id_with_context_datasource_id(
)
}
):
- assert metric_macro("macro_key") == "COUNT(*)"
+ assert metric_macro(env, {}, "macro_key") == "COUNT(*)"
# Getting data from g's form_data
mock_g.form_data = {
@@ -679,7 +834,7 @@ def test_metric_macro_no_dataset_id_with_context_datasource_id(
],
}
with app.test_request_context():
- assert metric_macro("macro_key") == "COUNT(*)"
+ assert metric_macro(env, {}, "macro_key") == "COUNT(*)"
def test_metric_macro_no_dataset_id_with_context_datasource_id_none(
@@ -693,6 +848,7 @@ def test_metric_macro_no_dataset_id_with_context_datasource_id_none(
mock_g.form_data = {}
# Getting the data from the request context
+ env = SandboxedEnvironment(undefined=DebugUndefined)
with app.test_request_context(
data={
"form_data": json.dumps(
@@ -709,7 +865,7 @@ def test_metric_macro_no_dataset_id_with_context_datasource_id_none(
}
):
with pytest.raises(SupersetTemplateException) as excinfo:
- metric_macro("macro_key")
+ metric_macro(env, {}, "macro_key")
assert str(excinfo.value) == (
"Please specify the Dataset ID for the ``macro_key`` metric in the Jinja macro." # noqa: E501
)
@@ -726,7 +882,7 @@ def test_metric_macro_no_dataset_id_with_context_datasource_id_none(
}
with app.test_request_context():
with pytest.raises(SupersetTemplateException) as excinfo:
- metric_macro("macro_key")
+ metric_macro(env, {}, "macro_key")
assert str(excinfo.value) == (
"Please specify the Dataset ID for the ``macro_key`` metric in the Jinja macro." # noqa: E501
)
@@ -758,6 +914,7 @@ def test_metric_macro_no_dataset_id_with_context_chart_id(
mock_g.form_data = {}
# Getting the data from the request context
+ env = SandboxedEnvironment(undefined=DebugUndefined)
with app.test_request_context(
data={
"form_data": json.dumps(
@@ -773,7 +930,7 @@ def test_metric_macro_no_dataset_id_with_context_chart_id(
)
}
):
- assert metric_macro("macro_key") == "COUNT(*)"
+ assert metric_macro(env, {}, "macro_key") == "COUNT(*)"
# Getting data from g's form_data
mock_g.form_data = {
@@ -786,7 +943,7 @@ def test_metric_macro_no_dataset_id_with_context_chart_id(
],
}
with app.test_request_context():
- assert metric_macro("macro_key") == "COUNT(*)"
+ assert metric_macro(env, {}, "macro_key") == "COUNT(*)"
def test_metric_macro_no_dataset_id_with_context_slice_id_none(
@@ -800,6 +957,7 @@ def test_metric_macro_no_dataset_id_with_context_slice_id_none(
mock_g.form_data = {}
# Getting the data from the request context
+ env = SandboxedEnvironment(undefined=DebugUndefined)
with app.test_request_context(
data={
"form_data": json.dumps(
@@ -816,7 +974,7 @@ def test_metric_macro_no_dataset_id_with_context_slice_id_none(
}
):
with pytest.raises(SupersetTemplateException) as excinfo:
- metric_macro("macro_key")
+ metric_macro(env, {}, "macro_key")
assert str(excinfo.value) == (
"Please specify the Dataset ID for the ``macro_key`` metric in the Jinja macro." # noqa: E501
)
@@ -833,7 +991,7 @@ def test_metric_macro_no_dataset_id_with_context_slice_id_none(
}
with app.test_request_context():
with pytest.raises(SupersetTemplateException) as excinfo:
- metric_macro("macro_key")
+ metric_macro(env, {}, "macro_key")
assert str(excinfo.value) == (
"Please specify the Dataset ID for the ``macro_key`` metric in the Jinja macro." # noqa: E501
)
@@ -852,6 +1010,7 @@ def test_metric_macro_no_dataset_id_with_context_deleted_chart(
mock_g.form_data = {}
# Getting the data from the request context
+ env = SandboxedEnvironment(undefined=DebugUndefined)
with app.test_request_context(
data={
"form_data": json.dumps(
@@ -868,7 +1027,7 @@ def test_metric_macro_no_dataset_id_with_context_deleted_chart(
}
):
with pytest.raises(SupersetTemplateException) as excinfo:
- metric_macro("macro_key")
+ metric_macro(env, {}, "macro_key")
assert str(excinfo.value) == (
"Please specify the Dataset ID for the ``macro_key`` metric in the Jinja macro." # noqa: E501
)
@@ -885,7 +1044,7 @@ def test_metric_macro_no_dataset_id_with_context_deleted_chart(
}
with app.test_request_context():
with pytest.raises(SupersetTemplateException) as excinfo:
- metric_macro("macro_key")
+ metric_macro(env, {}, "macro_key")
assert str(excinfo.value) == (
"Please specify the Dataset ID for the ``macro_key`` metric in the Jinja macro." # noqa: E501
)
@@ -913,6 +1072,7 @@ def test_metric_macro_no_dataset_id_available_in_request_form_data(
mock_g.form_data = {}
# Getting the data from the request context
+ env = SandboxedEnvironment(undefined=DebugUndefined)
with app.test_request_context(
data={
"form_data": json.dumps(
@@ -924,7 +1084,7 @@ def test_metric_macro_no_dataset_id_available_in_request_form_data(
)
}
):
- assert metric_macro("macro_key") == "COUNT(*)"
+ assert metric_macro(env, {}, "macro_key") == "COUNT(*)"
# Getting data from g's form_data
mock_g.form_data = {
@@ -932,7 +1092,7 @@ def test_metric_macro_no_dataset_id_available_in_request_form_data(
}
with app.test_request_context():
- assert metric_macro("macro_key") == "COUNT(*)"
+ assert metric_macro(env, {}, "macro_key") == "COUNT(*)"
@pytest.mark.parametrize(
(superset) 01/18: fix: revert "fix: remove sort values on stacked totals (#31333)" (#32337)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit b2bd39cc28c10aee20a65605e2741b8db73e6eb7
Author: Elizabeth Thompson <es...@gmail.com>
AuthorDate: Fri Feb 21 10:35:06 2025 -0800
fix: revert "fix: remove sort values on stacked totals (#31333)" (#32337)
(cherry picked from commit 422a07b3825bd675deb540f652dd3aa3a8737eac)
---
.../superset-ui-core/src/query/getMetricLabel.ts | 24 ++---
.../src/MixedTimeseries/transformProps.ts | 13 +--
.../src/Timeseries/transformProps.ts | 7 +-
.../plugin-chart-echarts/src/utils/series.ts | 6 +-
.../test/Timeseries/transformProps.test.ts | 34 ++----
.../plugin-chart-echarts/test/utils/series.test.ts | 118 ---------------------
6 files changed, 27 insertions(+), 175 deletions(-)
diff --git a/superset-frontend/packages/superset-ui-core/src/query/getMetricLabel.ts b/superset-frontend/packages/superset-ui-core/src/query/getMetricLabel.ts
index 246bf99432..7ac7930c6a 100644
--- a/superset-frontend/packages/superset-ui-core/src/query/getMetricLabel.ts
+++ b/superset-frontend/packages/superset-ui-core/src/query/getMetricLabel.ts
@@ -19,23 +19,17 @@
import { QueryFormMetric, isSavedMetric, isAdhocMetricSimple } from './types';
-export default function getMetricLabel(
- metric: QueryFormMetric,
- index?: number,
- queryFormMetrics?: QueryFormMetric[],
- verboseMap?: Record<string, string>,
-): string {
- let label = '';
+export default function getMetricLabel(metric: QueryFormMetric): string {
if (isSavedMetric(metric)) {
- label = metric;
- } else if (metric.label) {
- ({ label } = metric);
- } else if (isAdhocMetricSimple(metric)) {
- label = `${metric.aggregate}(${
+ return metric;
+ }
+ if (metric.label) {
+ return metric.label;
+ }
+ if (isAdhocMetricSimple(metric)) {
+ return `${metric.aggregate}(${
metric.column.columnName || metric.column.column_name
})`;
- } else {
- label = metric.sqlExpression;
}
- return verboseMap?.[label] || label;
+ return metric.sqlExpression;
}
diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts b/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts
index 63582a860c..7526b820d0 100644
--- a/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts
+++ b/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts
@@ -27,7 +27,6 @@ import {
ensureIsArray,
GenericDataType,
getCustomFormatter,
- getMetricLabel,
getNumberFormatter,
getXAxisLabel,
isDefined,
@@ -292,20 +291,12 @@ export default function transformProps(
const showValueIndexesB = extractShowValueIndexes(rawSeriesB, {
stack,
});
-
- const metricsLabels = metrics
- .map(metric => getMetricLabel(metric, undefined, undefined, verboseMap))
- .filter((label): label is string => label !== undefined);
- const metricsLabelsB = metricsB.map((metric: QueryFormMetric) =>
- getMetricLabel(metric, undefined, undefined, verboseMap),
- );
-
const { totalStackedValues, thresholdValues } = extractDataTotalValues(
rebasedDataA,
{
stack,
percentageThreshold,
- metricsLabels,
+ xAxisCol: xAxisLabel,
},
);
const {
@@ -314,7 +305,7 @@ export default function transformProps(
} = extractDataTotalValues(rebasedDataB, {
stack: Boolean(stackB),
percentageThreshold,
- metricsLabels: metricsLabelsB,
+ xAxisCol: xAxisLabel,
});
annotationLayers
diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts
index d5bfd88095..0fb392a12d 100644
--- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts
+++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformProps.ts
@@ -215,18 +215,14 @@ export default function transformProps(
) {
xAxisLabel = verboseMap[xAxisLabel];
}
- const metricsLabels = metrics
- .map(metric => getMetricLabel(metric, undefined, undefined, verboseMap))
- .filter((label): label is string => label !== undefined);
const isHorizontal = orientation === OrientationType.Horizontal;
-
const { totalStackedValues, thresholdValues } = extractDataTotalValues(
rebasedData,
{
stack,
percentageThreshold,
+ xAxisCol: xAxisLabel,
legendState,
- metricsLabels,
},
);
const extraMetricLabels = extractExtraMetrics(chartProps.rawFormData).map(
@@ -300,6 +296,7 @@ export default function transformProps(
const entryName = String(entry.name || '');
const seriesName = inverted[entryName] || entryName;
const colorScaleKey = getOriginalSeries(seriesName, array);
+
const transformedSeries = transformSeries(
entry,
colorScale,
diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts b/superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts
index 3fe8ef3310..bbf222a2a5 100644
--- a/superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts
+++ b/superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts
@@ -60,8 +60,8 @@ export function extractDataTotalValues(
opts: {
stack: StackType;
percentageThreshold: number;
+ xAxisCol: string;
legendState?: LegendState;
- metricsLabels: string[];
},
): {
totalStackedValues: number[];
@@ -69,11 +69,11 @@ export function extractDataTotalValues(
} {
const totalStackedValues: number[] = [];
const thresholdValues: number[] = [];
- const { stack, percentageThreshold, legendState, metricsLabels } = opts;
+ const { stack, percentageThreshold, xAxisCol, legendState } = opts;
if (stack) {
data.forEach(datum => {
const values = Object.keys(datum).reduce((prev, curr) => {
- if (!metricsLabels.includes(curr)) {
+ if (curr === xAxisCol) {
return prev;
}
if (legendState && !legendState[curr]) {
diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformProps.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformProps.test.ts
index 5601158675..bc2aa2bd58 100644
--- a/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformProps.test.ts
+++ b/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformProps.test.ts
@@ -36,25 +36,15 @@ describe('EchartsTimeseries transformProps', () => {
colorScheme: 'bnbColors',
datasource: '3__table',
granularity_sqla: 'ds',
- metrics: ['sum__num'],
+ metric: 'sum__num',
groupby: ['foo', 'bar'],
viz_type: 'my_viz',
};
const queriesData = [
{
data: [
- {
- 'San Francisco': 1,
- 'New York': 2,
- __timestamp: 599616000000,
- sum__num: 4,
- },
- {
- 'San Francisco': 3,
- 'New York': 4,
- __timestamp: 599916000000,
- sum__num: 8,
- },
+ { 'San Francisco': 1, 'New York': 2, __timestamp: 599616000000 },
+ { 'San Francisco': 3, 'New York': 4, __timestamp: 599916000000 },
],
},
];
@@ -74,7 +64,7 @@ describe('EchartsTimeseries transformProps', () => {
height: 600,
echartOptions: expect.objectContaining({
legend: expect.objectContaining({
- data: ['sum__num', 'San Francisco', 'New York'],
+ data: ['San Francisco', 'New York'],
}),
series: expect.arrayContaining([
expect.objectContaining({
@@ -111,7 +101,7 @@ describe('EchartsTimeseries transformProps', () => {
height: 600,
echartOptions: expect.objectContaining({
legend: expect.objectContaining({
- data: ['sum__num', 'San Francisco', 'New York'],
+ data: ['San Francisco', 'New York'],
}),
series: expect.arrayContaining([
expect.objectContaining({
@@ -156,7 +146,7 @@ describe('EchartsTimeseries transformProps', () => {
height: 600,
echartOptions: expect.objectContaining({
legend: expect.objectContaining({
- data: ['sum__num', 'San Francisco', 'New York', 'My Formula'],
+ data: ['San Francisco', 'New York', 'My Formula'],
}),
series: expect.arrayContaining([
expect.objectContaining({
@@ -284,7 +274,7 @@ describe('EchartsTimeseries transformProps', () => {
expect.objectContaining({
echartOptions: expect.objectContaining({
legend: expect.objectContaining({
- data: ['sum__num', 'San Francisco', 'New York', 'My Line'],
+ data: ['San Francisco', 'New York', 'My Line'],
}),
series: expect.arrayContaining([
expect.objectContaining({
@@ -430,7 +420,7 @@ describe('Does transformProps transform series correctly', () => {
colorScheme: 'bnbColors',
datasource: '3__table',
granularity_sqla: 'ds',
- metrics: ['sum__num'],
+ metric: 'sum__num',
groupby: ['foo', 'bar'],
showValue: true,
stack: true,
@@ -445,28 +435,24 @@ describe('Does transformProps transform series correctly', () => {
'New York': 2,
Boston: 1,
__timestamp: 599616000000,
- sum__num: 4,
},
{
'San Francisco': 3,
'New York': 4,
Boston: 1,
__timestamp: 599916000000,
- sum__num: 8,
},
{
'San Francisco': 5,
'New York': 8,
Boston: 6,
__timestamp: 600216000000,
- sum__num: 19,
},
{
'San Francisco': 2,
'New York': 7,
Boston: 2,
__timestamp: 600516000000,
- sum__num: 11,
},
],
},
@@ -482,7 +468,7 @@ describe('Does transformProps transform series correctly', () => {
const totalStackedValues = queriesData[0].data.reduce(
(totals, currentStack) => {
const total = Object.keys(currentStack).reduce((stackSum, key) => {
- if (key === '__timestamp' || key === 'sum__num') return stackSum;
+ if (key === '__timestamp') return stackSum;
return stackSum + currentStack[key as keyof typeof currentStack];
}, 0);
totals.push(total);
@@ -575,6 +561,7 @@ describe('Does transformProps transform series correctly', () => {
const expectedThresholds = totalStackedValues.map(
total => ((formData.percentageThreshold || 0) / 100) * total,
);
+
transformedSeries.forEach((series, seriesIndex) => {
expect(series.label.show).toBe(true);
series.data.forEach((value, dataIndex) => {
@@ -589,6 +576,7 @@ describe('Does transformProps transform series correctly', () => {
});
});
});
+
it('should not apply percentage threshold when showValue is true and stack is false', () => {
const updatedChartPropsConfig = {
...chartPropsConfig,
diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/utils/series.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/utils/series.test.ts
index afac03096b..7054f6019a 100644
--- a/superset-frontend/plugins/plugin-chart-echarts/test/utils/series.test.ts
+++ b/superset-frontend/plugins/plugin-chart-echarts/test/utils/series.test.ts
@@ -29,7 +29,6 @@ import {
calculateLowerLogTick,
dedupSeries,
extractGroupbyLabel,
- extractDataTotalValues,
extractSeries,
extractShowValueIndexes,
extractTooltipKeys,
@@ -1086,123 +1085,6 @@ const forecastValue = [
},
];
-describe('extractDataTotalValues', () => {
- it('test_extractDataTotalValues_withStack', () => {
- const data: DataRecord[] = [
- { metric1: 10, metric2: 20, xAxisCol: '2021-01-01' },
- { metric1: 15, metric2: 25, xAxisCol: '2021-01-02' },
- ];
- const metricsLabels = ['metric1', 'metric2'];
- const opts = {
- stack: true,
- percentageThreshold: 10,
- metricsLabels,
- };
- const result = extractDataTotalValues(data, opts);
- expect(result.totalStackedValues).toEqual([30, 40]);
- expect(result.thresholdValues).toEqual([3, 4]);
- });
-
- it('should calculate total and threshold values with stack option enabled', () => {
- const data: DataRecord[] = [
- { metric1: 10, metric2: 20, xAxisCol: '2021-01-01' },
- { metric1: 15, metric2: 25, xAxisCol: '2021-01-02' },
- ];
- const metricsLabels = ['metric1', 'metric2'];
- const opts = {
- stack: true,
- percentageThreshold: 10,
- metricsLabels,
- };
- const result = extractDataTotalValues(data, opts);
- expect(result.totalStackedValues).toEqual([30, 40]);
- expect(result.thresholdValues).toEqual([3, 4]);
- });
-
- it('should handle empty data array', () => {
- const data: DataRecord[] = [];
- const metricsLabels: string[] = [];
- const opts = {
- stack: true,
- percentageThreshold: 10,
- metricsLabels,
- };
- const result = extractDataTotalValues(data, opts);
- expect(result.totalStackedValues).toEqual([]);
- expect(result.thresholdValues).toEqual([]);
- });
-
- it('should calculate total and threshold values with stack option disabled', () => {
- const data: DataRecord[] = [
- { metric1: 10, metric2: 20, xAxisCol: '2021-01-01' },
- { metric1: 15, metric2: 25, xAxisCol: '2021-01-02' },
- ];
- const metricsLabels = ['metric1', 'metric2'];
- const opts = {
- stack: false,
- percentageThreshold: 10,
- metricsLabels,
- };
- const result = extractDataTotalValues(data, opts);
- expect(result.totalStackedValues).toEqual([]);
- expect(result.thresholdValues).toEqual([]);
- });
-
- it('should handle data with null or undefined values', () => {
- const data: DataRecord[] = [
- { my_x_axis: 'abc', x: 1, y: 0, z: 2 },
- { my_x_axis: 'foo', x: null, y: 10, z: 5 },
- { my_x_axis: null, x: 4, y: 3, z: 7 },
- ];
- const metricsLabels = ['x', 'y', 'z'];
- const opts = {
- stack: true,
- percentageThreshold: 10,
- metricsLabels,
- };
- const result = extractDataTotalValues(data, opts);
- expect(result.totalStackedValues).toEqual([3, 15, 14]);
- expect(result.thresholdValues).toEqual([
- 0.30000000000000004, 1.5, 1.4000000000000001,
- ]);
- });
-
- it('should handle different percentage thresholds', () => {
- const data: DataRecord[] = [
- { metric1: 10, metric2: 20, xAxisCol: '2021-01-01' },
- { metric1: 15, metric2: 25, xAxisCol: '2021-01-02' },
- ];
- const metricsLabels = ['metric1', 'metric2'];
- const opts = {
- stack: true,
- percentageThreshold: 50,
- metricsLabels,
- };
- const result = extractDataTotalValues(data, opts);
- expect(result.totalStackedValues).toEqual([30, 40]);
- expect(result.thresholdValues).toEqual([15, 20]);
- });
- it('should not add datum not in metrics to the total value when stacked', () => {
- const data: DataRecord[] = [
- { xAxisCol: 'foo', xAxisSort: 10, val: 345 },
- { xAxisCol: 'bar', xAxisSort: 20, val: 2432 },
- { xAxisCol: 'baz', xAxisSort: 30, val: 4543 },
- ];
- const metricsLabels = ['val'];
- const opts = {
- stack: true,
- percentageThreshold: 50,
- metricsLabels,
- };
-
- const result = extractDataTotalValues(data, opts);
-
- // Assuming extractDataTotalValues returns the total value
- // without including the 'xAxisCol' category
- expect(result.totalStackedValues).toEqual([345, 2432, 4543]); // 10 + 20, excluding the 'xAxisCol' category
- });
-});
-
test('extractTooltipKeys with rich tooltip', () => {
const result = extractTooltipKeys(forecastValue, 1, true, false);
expect(result).toEqual(['foo', 'bar']);
(superset) 06/18: fix(docker): Configure nginx for consistent port mapping and hot reloading (#32362)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 98c82ad24e864a4a1b194b74be61043873d5f77f
Author: Vedant Prajapati <40...@users.noreply.github.com>
AuthorDate: Mon Feb 24 11:53:51 2025 -0500
fix(docker): Configure nginx for consistent port mapping and hot reloading (#32362)
(cherry picked from commit 0f07d78e01cdce9fb47f241376fba8e71c19f895)
---
docker/nginx/nginx.conf | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/docker/nginx/nginx.conf b/docker/nginx/nginx.conf
index eda47ef580..e60a07fbdf 100644
--- a/docker/nginx/nginx.conf
+++ b/docker/nginx/nginx.conf
@@ -112,6 +112,12 @@ http {
proxy_set_header Host $host;
}
+ location /static {
+ proxy_pass http://host.docker.internal:9000; # Proxy to superset-node
+ proxy_http_version 1.1;
+ proxy_set_header Host $host;
+ }
+
location / {
proxy_pass http://superset_app;
proxy_set_header Host $host;
(superset) 04/18: fix(SSHTunnelForm): make the password tooltip visible (#32356)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 7ef38fed2425217b9fb88e18abf1ec3220fd1e18
Author: Enzo Martellucci <52...@users.noreply.github.com>
AuthorDate: Sun Feb 23 17:27:31 2025 +0100
fix(SSHTunnelForm): make the password tooltip visible (#32356)
(cherry picked from commit 4c4b5e8c64d1a79b42ee8b86397d163070975ec0)
---
.../src/components/Form/LabeledErrorBoundInput.tsx | 3 ++-
.../src/features/databases/DatabaseModal/SSHTunnelForm.tsx | 10 +++++-----
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/superset-frontend/src/components/Form/LabeledErrorBoundInput.tsx b/superset-frontend/src/components/Form/LabeledErrorBoundInput.tsx
index bb05168078..c669c1d2d1 100644
--- a/superset-frontend/src/components/Form/LabeledErrorBoundInput.tsx
+++ b/superset-frontend/src/components/Form/LabeledErrorBoundInput.tsx
@@ -16,8 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
-import { Input, Tooltip } from 'antd';
import { styled, css, SupersetTheme, t } from '@superset-ui/core';
+import { Tooltip } from 'src/components/Tooltip';
+import { Input } from 'src/components/Input';
import InfoTooltip from 'src/components/InfoTooltip';
import Icons from 'src/components/Icons';
import Button from 'src/components/Button';
diff --git a/superset-frontend/src/features/databases/DatabaseModal/SSHTunnelForm.tsx b/superset-frontend/src/features/databases/DatabaseModal/SSHTunnelForm.tsx
index 549919ffe3..907fe3c9a0 100644
--- a/superset-frontend/src/features/databases/DatabaseModal/SSHTunnelForm.tsx
+++ b/superset-frontend/src/features/databases/DatabaseModal/SSHTunnelForm.tsx
@@ -23,7 +23,7 @@ import { Form, FormLabel } from 'src/components/Form';
import { Radio } from 'src/components/Radio';
import { Input, TextArea } from 'src/components/Input';
import { Input as AntdInput, Tooltip } from 'antd';
-import { EyeInvisibleOutlined, EyeOutlined } from '@ant-design/icons';
+import Icons from 'src/components/Icons';
import { DatabaseObject, FieldPropTypes } from '../types';
import { AuthType } from '.';
@@ -155,11 +155,11 @@ const SSHTunnelForm = ({
iconRender={visible =>
visible ? (
<Tooltip title="Hide password.">
- <EyeInvisibleOutlined />
+ <Icons.EyeInvisibleOutlined />
</Tooltip>
) : (
<Tooltip title="Show password.">
- <EyeOutlined />
+ <Icons.EyeOutlined />
</Tooltip>
)
}
@@ -203,11 +203,11 @@ const SSHTunnelForm = ({
iconRender={visible =>
visible ? (
<Tooltip title="Hide password.">
- <EyeInvisibleOutlined />
+ <Icons.EyeInvisibleOutlined />
</Tooltip>
) : (
<Tooltip title="Show password.">
- <EyeOutlined />
+ <Icons.EyeOutlined />
</Tooltip>
)
}
(superset) 03/18: fix(roles): Add SqlLabPermalinkRestApi as default sqlab roles. (#32284)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 724f2dc5fecd9628ef5ce771025c2a7864a939dd
Author: Levis Mbote <11...@users.noreply.github.com>
AuthorDate: Sat Feb 22 01:42:35 2025 +0300
fix(roles): Add SqlLabPermalinkRestApi as default sqlab roles. (#32284)
(cherry picked from commit 2c37ddb2f63d216665c8d81232500986281ccfc0)
---
superset/security/manager.py | 2 ++
tests/integration_tests/security_tests.py | 2 ++
.../sql_lab/permalink/api_tests.py | 22 ++++++++++++++++++++++
3 files changed, 26 insertions(+)
diff --git a/superset/security/manager.py b/superset/security/manager.py
index 33cbc814d4..450265ccb9 100644
--- a/superset/security/manager.py
+++ b/superset/security/manager.py
@@ -330,6 +330,8 @@ class SupersetSecurityManager( # pylint: disable=too-many-public-methods
("menu_access", "SQL Editor"),
("menu_access", "Saved Queries"),
("menu_access", "Query Search"),
+ ("can_read", "SqlLabPermalinkRestApi"),
+ ("can_write", "SqlLabPermalinkRestApi"),
}
SQLLAB_EXTRA_PERMISSION_VIEWS = {
diff --git a/tests/integration_tests/security_tests.py b/tests/integration_tests/security_tests.py
index f148f9418e..a89bb47af7 100644
--- a/tests/integration_tests/security_tests.py
+++ b/tests/integration_tests/security_tests.py
@@ -1488,6 +1488,8 @@ class TestRolePermission(SupersetTestCase):
("menu_access", "Saved Queries"),
("menu_access", "SQL Editor"),
("menu_access", "SQL Lab"),
+ ("can_read", "SqlLabPermalinkRestApi"),
+ ("can_write", "SqlLabPermalinkRestApi"),
}
self.assert_cannot_alpha(sql_lab_set)
diff --git a/tests/integration_tests/sql_lab/permalink/api_tests.py b/tests/integration_tests/sql_lab/permalink/api_tests.py
index 7d515b796f..a67d78989f 100644
--- a/tests/integration_tests/sql_lab/permalink/api_tests.py
+++ b/tests/integration_tests/sql_lab/permalink/api_tests.py
@@ -58,6 +58,28 @@ def permalink_salt(app_context) -> Iterator[str]:
db.session.commit()
+def test_sqllab_user_can_access_shared_query(
+ tab_state_data: dict[str, Any], permalink_salt: str, test_client, login_as
+):
+ login_as(GAMMA_SQLLAB_USERNAME)
+
+ resp = test_client.post("api/v1/sqllab/permalink", json=tab_state_data)
+ assert resp.status_code == 201, "Failed to create permalink"
+
+ data = resp.json
+ key = data["key"]
+
+ resp = test_client.get(f"api/v1/sqllab/permalink/{key}")
+ assert resp.status_code == 200, "SQL Lab user access expected"
+
+ result = json.loads(resp.data.decode("utf-8"))
+ assert result == tab_state_data, "Query data mismatch"
+
+ id_ = decode_permalink_id(key, permalink_salt)
+ db.session.query(KeyValueEntry).filter_by(id=id_).delete()
+ db.session.commit()
+
+
def test_post(
tab_state_data: dict[str, Any], permalink_salt: str, test_client, login_as
):
(superset) 15/18: fix(plugin-chart-echarts): remove erroneous upper bound value (#32473)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 2199c73b89d3bf7d541d38fc7c6afaf98a1ff9ad
Author: Ville Brofeldt <33...@users.noreply.github.com>
AuthorDate: Sat Mar 1 22:07:12 2025 -0800
fix(plugin-chart-echarts): remove erroneous upper bound value (#32473)
(cherry picked from commit 5766c36372f221d1f4ee93d355a3e4c677f47c19)
---
.../plugin-chart-echarts/src/Timeseries/transformers.ts | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts
index cadf647484..0abefc95e3 100644
--- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts
+++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts
@@ -226,7 +226,7 @@ export function transformSeries(
stackId = forecastSeries.name;
} else if (stack && isObservation) {
// the suffix of the observation series is '' (falsy), which disables
- // stacking. Therefore we need to set something that is truthy.
+ // stacking. Therefore, we need to set something that is truthy.
stackId = getTimeCompareStackId('obs', timeCompare, name);
} else if (stack && isTrend) {
stackId = getTimeCompareStackId(forecastSeries.type, timeCompare, name);
@@ -322,6 +322,15 @@ export function transformSeries(
show: !!showValue,
position: isHorizontal ? 'right' : 'top',
formatter: (params: any) => {
+ // don't show confidence band value labels, as they're already visible on the tooltip
+ if (
+ [
+ ForecastSeriesEnum.ForecastUpper,
+ ForecastSeriesEnum.ForecastLower,
+ ].includes(forecastSeries.type)
+ ) {
+ return '';
+ }
const { value, dataIndex, seriesIndex, seriesName } = params;
const numericValue = isHorizontal ? value[0] : value[1];
const isSelectedLegend = !legendState || legendState[seriesName];
(superset) 18/18: fix: dashboard, chart and dataset import validation (#32500)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 588e2e644b7a5b9ec7cf6ddaecaaf006f4073684
Author: Daniel Vaz Gaspar <da...@gmail.com>
AuthorDate: Wed Mar 5 08:47:49 2025 +0000
fix: dashboard, chart and dataset import validation (#32500)
(cherry picked from commit fc844d3dfdace890b32c00a507a959b81122b425)
---
superset/commands/chart/importers/v1/utils.py | 7 ++-
superset/commands/dashboard/importers/v1/utils.py | 7 ++-
superset/commands/dataset/importers/v1/utils.py | 8 ++++
.../charts/commands/importers/v1/import_test.py | 51 ++++++++++++++++++++-
.../commands/importers/v1/import_test.py | 53 +++++++++++++++++++++-
.../datasets/commands/importers/v1/import_test.py | 52 +++++++++++++++++++++
6 files changed, 171 insertions(+), 7 deletions(-)
diff --git a/superset/commands/chart/importers/v1/utils.py b/superset/commands/chart/importers/v1/utils.py
index 35a7f6e270..dacef7c1e3 100644
--- a/superset/commands/chart/importers/v1/utils.py
+++ b/superset/commands/chart/importers/v1/utils.py
@@ -50,9 +50,12 @@ def import_chart(
) -> Slice:
can_write = ignore_permissions or security_manager.can_access("can_write", "Chart")
existing = db.session.query(Slice).filter_by(uuid=config["uuid"]).first()
+ user = get_user()
if existing:
- if overwrite and can_write and get_user():
- if not security_manager.can_access_chart(existing):
+ if overwrite and can_write and user:
+ if not security_manager.can_access_chart(existing) or (
+ user not in existing.owners and not security_manager.is_admin()
+ ):
raise ImportFailedError(
"A chart already exists and user doesn't "
"have permissions to overwrite it"
diff --git a/superset/commands/dashboard/importers/v1/utils.py b/superset/commands/dashboard/importers/v1/utils.py
index 26cbeb0382..53904890c1 100644
--- a/superset/commands/dashboard/importers/v1/utils.py
+++ b/superset/commands/dashboard/importers/v1/utils.py
@@ -153,9 +153,12 @@ def import_dashboard( # noqa: C901
"Dashboard",
)
existing = db.session.query(Dashboard).filter_by(uuid=config["uuid"]).first()
+ user = get_user()
if existing:
- if overwrite and can_write and get_user():
- if not security_manager.can_access_dashboard(existing):
+ if overwrite and can_write and user:
+ if not security_manager.can_access_dashboard(existing) or (
+ user not in existing.owners and not security_manager.is_admin()
+ ):
raise ImportFailedError(
"A dashboard already exists and user doesn't "
"have permissions to overwrite it"
diff --git a/superset/commands/dataset/importers/v1/utils.py b/superset/commands/dataset/importers/v1/utils.py
index f3611e00d9..f4bfc2e079 100644
--- a/superset/commands/dataset/importers/v1/utils.py
+++ b/superset/commands/dataset/importers/v1/utils.py
@@ -113,10 +113,18 @@ def import_dataset( # noqa: C901
"Dataset",
)
existing = db.session.query(SqlaTable).filter_by(uuid=config["uuid"]).first()
+ user = get_user()
if existing:
+ if overwrite and can_write and user:
+ if user not in existing.owners and not security_manager.is_admin():
+ raise ImportFailedError(
+ "A dataset already exists and user doesn't "
+ "have permissions to overwrite it"
+ )
if not overwrite or not can_write:
return existing
config["id"] = existing.id
+
elif not can_write:
raise ImportFailedError(
"Dataset doesn't exist and user doesn't have permission to create datasets"
diff --git a/tests/unit_tests/charts/commands/importers/v1/import_test.py b/tests/unit_tests/charts/commands/importers/v1/import_test.py
index c31aeb2574..56c4658a84 100644
--- a/tests/unit_tests/charts/commands/importers/v1/import_test.py
+++ b/tests/unit_tests/charts/commands/importers/v1/import_test.py
@@ -181,7 +181,56 @@ def test_import_existing_chart_without_permission(
.one_or_none()
)
- with override_user("admin"):
+ user = User(
+ first_name="Alice",
+ last_name="Doe",
+ email="adoe@example.org",
+ username="admin",
+ roles=[Role(name="Admin")],
+ )
+
+ with override_user(user):
+ with pytest.raises(ImportFailedError) as excinfo:
+ import_chart(chart_config, overwrite=True)
+ assert (
+ str(excinfo.value)
+ == "A chart already exists and user doesn't have permissions to overwrite it" # noqa: E501
+ )
+
+ # Assert that the can write to chart was checked
+ mock_can_access.assert_called_once_with("can_write", "Chart")
+ mock_can_access_chart.assert_called_once_with(slice)
+
+
+def test_import_existing_chart_without_owner_permission(
+ mocker: MockerFixture,
+ session_with_data: Session,
+) -> None:
+ """
+ Test importing a chart when a user doesn't have permissions to modify.
+ """
+ mock_can_access = mocker.patch.object(
+ security_manager, "can_access", return_value=True
+ )
+ mock_can_access_chart = mocker.patch.object(
+ security_manager, "can_access_chart", return_value=True
+ )
+
+ slice = (
+ session_with_data.query(Slice)
+ .filter(Slice.uuid == chart_config["uuid"])
+ .one_or_none()
+ )
+
+ user = User(
+ first_name="Alice",
+ last_name="Doe",
+ email="adoe@example.org",
+ username="admin",
+ roles=[Role(name="Gamma")],
+ )
+
+ with override_user(user):
with pytest.raises(ImportFailedError) as excinfo:
import_chart(chart_config, overwrite=True)
assert (
diff --git a/tests/unit_tests/dashboards/commands/importers/v1/import_test.py b/tests/unit_tests/dashboards/commands/importers/v1/import_test.py
index 09b3eed42d..a1e4a6f87e 100644
--- a/tests/unit_tests/dashboards/commands/importers/v1/import_test.py
+++ b/tests/unit_tests/dashboards/commands/importers/v1/import_test.py
@@ -122,7 +122,7 @@ def test_import_dashboard_without_permission(
mock_can_access.assert_called_once_with("can_write", "Dashboard")
-def test_import_existing_dashboard_without_permission(
+def test_import_existing_dashboard_without_access_permission(
mocker: MockerFixture,
session_with_data: Session,
) -> None:
@@ -142,7 +142,56 @@ def test_import_existing_dashboard_without_permission(
.one_or_none()
)
- with override_user("admin"):
+ admin = User(
+ first_name="Alice",
+ last_name="Doe",
+ email="adoe@example.org",
+ username="admin",
+ roles=[Role(name="Admin")],
+ )
+
+ with override_user(admin):
+ with pytest.raises(ImportFailedError) as excinfo:
+ import_dashboard(dashboard_config, overwrite=True)
+ assert (
+ str(excinfo.value)
+ == "A dashboard already exists and user doesn't have permissions to overwrite it" # noqa: E501
+ )
+
+ # Assert that the can write to dashboard was checked
+ mock_can_access.assert_called_once_with("can_write", "Dashboard")
+ mock_can_access_dashboard.assert_called_once_with(dashboard)
+
+
+def test_import_existing_dashboard_without_owner_permission(
+ mocker: MockerFixture,
+ session_with_data: Session,
+) -> None:
+ """
+ Test importing a dashboard when a user doesn't have ownership and is not an Admin.
+ """
+ mock_can_access = mocker.patch.object(
+ security_manager, "can_access", return_value=True
+ )
+ mock_can_access_dashboard = mocker.patch.object(
+ security_manager, "can_access_dashboard", return_value=True
+ )
+
+ dashboard = (
+ session_with_data.query(Dashboard)
+ .filter(Dashboard.uuid == dashboard_config["uuid"])
+ .one_or_none()
+ )
+
+ user = User(
+ first_name="Alice",
+ last_name="Doe",
+ email="adoe@example.org",
+ username="admin",
+ roles=[Role(name="Gamma")],
+ )
+
+ with override_user(user):
with pytest.raises(ImportFailedError) as excinfo:
import_dashboard(dashboard_config, overwrite=True)
assert (
diff --git a/tests/unit_tests/datasets/commands/importers/v1/import_test.py b/tests/unit_tests/datasets/commands/importers/v1/import_test.py
index 2a2038046d..6bba6f039d 100644
--- a/tests/unit_tests/datasets/commands/importers/v1/import_test.py
+++ b/tests/unit_tests/datasets/commands/importers/v1/import_test.py
@@ -24,6 +24,7 @@ from unittest.mock import Mock, patch
import pytest
from flask import current_app
+from flask_appbuilder.security.sqla.models import Role, User
from pytest_mock import MockerFixture
from sqlalchemy.orm.session import Session
@@ -32,7 +33,9 @@ from superset.commands.dataset.exceptions import (
DatasetForbiddenDataURI,
)
from superset.commands.dataset.importers.v1.utils import validate_data_uri
+from superset.commands.exceptions import ImportFailedError
from superset.utils import json
+from superset.utils.core import override_user
def test_import_dataset(mocker: MockerFixture, session: Session) -> None:
@@ -536,6 +539,55 @@ def test_import_dataset_managed_externally(
assert sqla_table.external_url == "https://example.org/my_table"
+def test_import_dataset_without_owner_permission(
+ mocker: MockerFixture,
+ session: Session,
+) -> None:
+ """
+ Test importing a dataset that is managed externally.
+ """
+ from superset import security_manager
+ from superset.commands.dataset.importers.v1.utils import import_dataset
+ from superset.connectors.sqla.models import SqlaTable
+ from superset.models.core import Database
+ from tests.integration_tests.fixtures.importexport import dataset_config
+
+ mock_can_access = mocker.patch.object(
+ security_manager, "can_access", return_value=True
+ )
+
+ engine = db.session.get_bind()
+ SqlaTable.metadata.create_all(engine) # pylint: disable=no-member
+
+ database = Database(database_name="my_database", sqlalchemy_uri="sqlite://")
+ db.session.add(database)
+ db.session.flush()
+
+ config = copy.deepcopy(dataset_config)
+ config["database_id"] = database.id
+
+ import_dataset(config)
+ user = User(
+ first_name="Alice",
+ last_name="Doe",
+ email="adoe@example.org",
+ username="admin",
+ roles=[Role(name="Gamma")],
+ )
+
+ with override_user(user):
+ with pytest.raises(ImportFailedError) as excinfo:
+ import_dataset(config, overwrite=True)
+
+ assert (
+ str(excinfo.value)
+ == "A dataset already exists and user doesn't have permissions to overwrite it" # noqa: E501
+ )
+
+ # Assert that the can write to chart was checked
+ mock_can_access.assert_called_with("can_write", "Dataset")
+
+
@pytest.mark.parametrize(
"allowed_urls, data_uri, expected, exception_class",
[
(superset) 07/18: fix: clickhouse-connect engine SSH parameter (#32348)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 09a93d2803d832dc2ff0678c02bdae3fcc6bfc63
Author: Dino <10...@users.noreply.github.com>
AuthorDate: Mon Feb 24 21:58:49 2025 +0100
fix: clickhouse-connect engine SSH parameter (#32348)
(cherry picked from commit 8dcae810d4be741675e7657cb837cdead183b69f)
---
superset/db_engine_specs/clickhouse.py | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/superset/db_engine_specs/clickhouse.py b/superset/db_engine_specs/clickhouse.py
index 437c0d25c0..0d40acbe67 100644
--- a/superset/db_engine_specs/clickhouse.py
+++ b/superset/db_engine_specs/clickhouse.py
@@ -219,6 +219,10 @@ class ClickHouseParametersSchema(Schema):
values=fields.Raw(),
metadata={"description": __("Additional parameters")},
)
+ ssh = fields.Boolean(
+ required=False,
+ metadata={"description": __("Use an ssh tunnel connection to the database")},
+ )
try:
@@ -312,8 +316,18 @@ class ClickHouseConnectEngineSpec(BasicParametersMixin, ClickHouseEngineSpec):
url_params["query"] = query
if not url_params.get("database"):
url_params["database"] = "__default__"
- url_params.pop("encryption", None)
- return str(URL.create(f"{cls.engine}+{cls.default_driver}", **url_params))
+
+ return str(
+ URL.create(
+ f"{cls.engine}+{cls.default_driver}",
+ username=url_params.get("username"),
+ password=url_params.get("password"),
+ host=url_params.get("host"),
+ port=url_params.get("port"),
+ database=url_params.get("database"),
+ query=url_params.get("query"),
+ )
+ )
@classmethod
def get_parameters_from_uri(
(superset) 11/18: fix: prevent nested transactions (#32401)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit a8899c4bf30ebdb4f8fe946db90e2d6fcdcbb00e
Author: Beto Dealmeida <ro...@dealmeida.net>
AuthorDate: Fri Feb 28 09:59:03 2025 -0500
fix: prevent nested transactions (#32401)
---
superset/utils/decorators.py | 7 ++++
tests/unit_tests/utils/test_decorators.py | 53 +++++++++++++++++++++++++++++++
2 files changed, 60 insertions(+)
diff --git a/superset/utils/decorators.py b/superset/utils/decorators.py
index 844a8f063c..d5b73b0447 100644
--- a/superset/utils/decorators.py
+++ b/superset/utils/decorators.py
@@ -255,6 +255,11 @@ def transaction( # pylint: disable=redefined-outer-name
def wrapped(*args: Any, **kwargs: Any) -> Any:
from superset import db # pylint: disable=import-outside-toplevel
+ if getattr(g, "in_transaction", False):
+ # If already in a transaction, call the function directly
+ return func(*args, **kwargs)
+
+ g.in_transaction = True
try:
result = func(*args, **kwargs)
db.session.commit() # pylint: disable=consider-using-transaction
@@ -266,6 +271,8 @@ def transaction( # pylint: disable=redefined-outer-name
return on_error(ex)
raise
+ finally:
+ g.in_transaction = False
return wrapped
diff --git a/tests/unit_tests/utils/test_decorators.py b/tests/unit_tests/utils/test_decorators.py
index 0a622f4bce..df767e9387 100644
--- a/tests/unit_tests/utils/test_decorators.py
+++ b/tests/unit_tests/utils/test_decorators.py
@@ -24,6 +24,7 @@ from typing import Any, Optional
from unittest.mock import call, Mock, patch
import pytest
+from pytest_mock import MockerFixture
from superset import app
from superset.utils import decorators
@@ -294,3 +295,55 @@ def test_suppress_logging() -> None:
decorated = decorators.suppress_logging("test-logger", logging.CRITICAL + 1)(func)
decorated()
assert len(handler.log_records) == 0
+
+
+def test_transacation_commit(mocker: MockerFixture) -> None:
+ """
+ Test the `transaction` decorator when the function completes successfully.
+ """
+ db = mocker.patch("superset.db")
+
+ @decorators.transaction()
+ def func() -> int:
+ return 42
+
+ result = func()
+ assert result == 42
+ db.session.commit.assert_called_once()
+
+
+def test_transacation_rollback(mocker: MockerFixture) -> None:
+ """
+ Test the `transaction` decorator when the function raises an exception.
+ """
+ db = mocker.patch("superset.db")
+
+ @decorators.transaction()
+ def func() -> None:
+ raise ValueError("error")
+
+ with pytest.raises(ValueError, match="error"):
+ func()
+ db.session.commit.assert_not_called()
+ db.session.rollback.assert_called_once()
+
+
+def test_transacation_nested(mocker: MockerFixture) -> None:
+ """
+ Test the `transaction` decorator when the function is nested.
+ """
+ db = mocker.patch("superset.db")
+
+ @decorators.transaction()
+ def func() -> int:
+ return 42
+
+ @decorators.transaction()
+ def nested() -> int:
+ func() # should not commit
+ raise ValueError("error")
+
+ with pytest.raises(ValueError, match="error"):
+ nested()
+ db.session.commit.assert_not_called()
+ db.session.rollback.assert_called_once()
(superset) 10/18: fix(pinot): revert join and subquery flags (#32382)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit d98570ff6a0945782523b9c3431ef5e5f166da65
Author: Yuri <yu...@robinhood.com>
AuthorDate: Tue Feb 25 12:29:25 2025 -0800
fix(pinot): revert join and subquery flags (#32382)
(cherry picked from commit 822d72c57d425c2683fec4fd0fe888f5d6fd6420)
---
superset/db_engine_specs/pinot.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/superset/db_engine_specs/pinot.py b/superset/db_engine_specs/pinot.py
index 54fa72c296..5d6190db12 100644
--- a/superset/db_engine_specs/pinot.py
+++ b/superset/db_engine_specs/pinot.py
@@ -26,6 +26,8 @@ class PinotEngineSpec(BaseEngineSpec):
engine = "pinot"
engine_name = "Apache Pinot"
+ allows_subqueries = False
+ allows_joins = False
allows_alias_in_select = False
allows_alias_in_orderby = False