mirror of
https://github.com/apache/superset.git
synced 2026-08-15 04:21:25 +00:00
Compare commits
92
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
21ae918656 | ||
|
|
ca94026e97 | ||
|
|
a3bc2d908c | ||
|
|
738d12677a | ||
|
|
2eedc609a8 | ||
|
|
f4587218dd | ||
|
|
8967e6c2d3 | ||
|
|
81e431cd50 | ||
|
|
edfb009e1c | ||
|
|
e808fcbcad | ||
|
|
0a7ebe1dd1 | ||
|
|
dd1afb029f | ||
|
|
c068a8c09c | ||
|
|
b62ec512d2 | ||
|
|
1e65d93a83 | ||
|
|
856599027a | ||
|
|
c395b9a238 | ||
|
|
92728169de | ||
|
|
84c371d56e | ||
|
|
a4c47359e6 | ||
|
|
7c0c5283c3 | ||
|
|
9c5bde9491 | ||
|
|
3b99e092d0 | ||
|
|
acf39e3ef0 | ||
|
|
8523ea4d0a | ||
|
|
9bc3173e3a | ||
|
|
a6db0d1cde | ||
|
|
aec567f7d6 | ||
|
|
bacaf08a22 | ||
|
|
a188e9473a | ||
|
|
537f0fd2db | ||
|
|
8f78f9eb9c | ||
|
|
930ba64fdf | ||
|
|
3fb58900b9 | ||
|
|
a63483b9b1 | ||
|
|
01d0772d4f | ||
|
|
3c7633f935 | ||
|
|
f7a2f0ec50 | ||
|
|
dc9547554b | ||
|
|
67bbe0ac17 | ||
|
|
6211f9936b | ||
|
|
5b28158519 | ||
|
|
117b92a517 | ||
|
|
e1468a709c | ||
|
|
c8cb09d458 | ||
|
|
ec136f6d8d | ||
|
|
d0658bacc8 | ||
|
|
b8ca729f9f | ||
|
|
25c2ca1127 | ||
|
|
d5ae93c9b8 | ||
|
|
fbeba10f75 | ||
|
|
c8305b0ba9 | ||
|
|
e1777737a7 | ||
|
|
762fdccfde | ||
|
|
5554b892ff | ||
|
|
e2bb33b1da | ||
|
|
59361581cd | ||
|
|
08dfca9631 | ||
|
|
276d6f04f5 | ||
|
|
524d99159a | ||
|
|
657a2a4cb2 | ||
|
|
eefb3e3835 | ||
|
|
07accd56f2 | ||
|
|
22caf221b7 | ||
|
|
de2276225a | ||
|
|
685f26b1bf | ||
|
|
739365979d | ||
|
|
bc1a8e0858 | ||
|
|
0915a39bcb | ||
|
|
8014f782d3 | ||
|
|
eb7d4cba42 | ||
|
|
01ecefd732 | ||
|
|
0c2f91968e | ||
|
|
ed696b9933 | ||
|
|
4baf1cf648 | ||
|
|
aefee48223 | ||
|
|
cc35056bc9 | ||
|
|
a0d7ec9faf | ||
|
|
a501fed560 | ||
|
|
4354b37b96 | ||
|
|
d840568f3b | ||
|
|
174d35380d | ||
|
|
2c10e6260f | ||
|
|
8f6587d0e6 | ||
|
|
b4f3fae288 | ||
|
|
8e455034d0 | ||
|
|
8734a232d8 | ||
|
|
56573fa2cd | ||
|
|
885f00130c | ||
|
|
584466e02b | ||
|
|
d570335f67 | ||
|
|
a0099af88f |
@@ -79,6 +79,7 @@ github:
|
||||
- lint-check
|
||||
- cypress-matrix-required
|
||||
- dependency-review
|
||||
- enforce-single-migration-head
|
||||
- frontend-build
|
||||
- playwright-tests-required
|
||||
- pre-commit (current)
|
||||
|
||||
+9
-32
@@ -1,22 +1,3 @@
|
||||
# Notify all committers of DB migration changes, per SIP-59
|
||||
|
||||
/superset/migrations/ @mistercrunch @michael-s-molina @betodealmeida @eschutho @sadpandajoe @rusackas
|
||||
|
||||
# Notify some committers of changes in the components
|
||||
|
||||
/superset-frontend/src/components/Select/ @michael-s-molina @geido @kgabryje
|
||||
/superset-frontend/src/components/MetadataBar/ @michael-s-molina @geido @kgabryje
|
||||
/superset-frontend/src/components/DropdownContainer/ @michael-s-molina @geido @kgabryje
|
||||
|
||||
# Notify Helm Chart maintainers about changes in it
|
||||
|
||||
/helm/superset/ @dpgaspar @villebro @nytai @michael-s-molina @mistercrunch @rusackas @Antonio-RiveroMartnez @hainenber
|
||||
|
||||
# Notify E2E test maintainers of changes
|
||||
|
||||
/superset-frontend/playwright/ @sadpandajoe @geido @eschutho @rusackas @mistercrunch
|
||||
/superset-frontend/cypress-base/ @sadpandajoe @geido @eschutho @rusackas @mistercrunch
|
||||
|
||||
# Notify PMC members of changes to GitHub Actions
|
||||
|
||||
/.github/ @villebro @geido @eschutho @rusackas @betodealmeida @nytai @mistercrunch @kgabryje @sha174n @dpgaspar @sadpandajoe @hainenber
|
||||
@@ -30,23 +11,19 @@
|
||||
|
||||
/.asf.yaml @villebro @geido @eschutho @rusackas @betodealmeida @nytai @mistercrunch @kgabryje @dpgaspar @sha174n @Antonio-RiveroMartnez
|
||||
|
||||
# Maps are a finicky contribution process we care about
|
||||
# Maps are fragile and political. GeoJson edits MUST be made in the Jupyter notebook or they'll be overwritten.
|
||||
|
||||
**/*.geojson @villebro @rusackas
|
||||
**/*.ipynb @villebro @rusackas
|
||||
/superset-frontend/plugins/plugin-chart-country-map/ @villebro @rusackas
|
||||
|
||||
# Notify translation maintainers of changes to translations
|
||||
|
||||
/superset/translations/ @sfirke @rusackas @villebro @sadpandajoe @hainenber
|
||||
|
||||
# Notify PMC members of changes to extension-related files
|
||||
|
||||
/docs/developer_portal/extensions/ @michael-s-molina @villebro @rusackas
|
||||
/superset-core/ @michael-s-molina @villebro @geido @eschutho @rusackas @kgabryje
|
||||
/superset-extensions-cli/ @michael-s-molina @villebro @geido @eschutho @rusackas @kgabryje
|
||||
/superset/core/ @michael-s-molina @villebro @geido @eschutho @rusackas @kgabryje
|
||||
/superset/extensions/ @michael-s-molina @villebro @geido @eschutho @rusackas @kgabryje
|
||||
/superset-frontend/src/packages/superset-core/ @michael-s-molina @villebro @geido @eschutho @rusackas @kgabryje
|
||||
/superset-frontend/src/core/ @michael-s-molina @villebro @geido @eschutho @rusackas @kgabryje
|
||||
/superset-frontend/src/extensions/ @michael-s-molina @villebro @geido @eschutho @rusackas @kgabryje
|
||||
/docs/developer_docs/extensions/ @michael-s-molina @villebro @rusackas
|
||||
/superset-extensions-cli/ @michael-s-molina @villebro @rusackas @sadpandajoe
|
||||
/superset/extensions/ @michael-s-molina @villebro @rusackas @sadpandajoe
|
||||
/superset-frontend/src/extensions/ @michael-s-molina @villebro @rusackas @sadpandajoe
|
||||
|
||||
# Notify PMC members of config changes e.g. feature flags
|
||||
|
||||
/superset/config.py @michael-s-molina @villebro @rusackas @sadpandajoe
|
||||
|
||||
@@ -5,10 +5,6 @@ inputs:
|
||||
description: 'Python version to set up. Accepts a version number, "current", or "next".'
|
||||
required: true
|
||||
default: 'current'
|
||||
cache:
|
||||
description: 'Cache dependencies. Options: pip'
|
||||
required: false
|
||||
default: 'pip'
|
||||
requirements-type:
|
||||
description: 'Type of requirements to install. Options: base, development, default'
|
||||
required: false
|
||||
@@ -43,17 +39,31 @@ runs:
|
||||
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
||||
with:
|
||||
python-version: ${{ steps.set-python-version.outputs.python-version }}
|
||||
cache: ${{ inputs.cache }}
|
||||
- name: Install uv
|
||||
if: inputs.install-superset == 'true'
|
||||
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
|
||||
with:
|
||||
python-version: ${{ steps.set-python-version.outputs.python-version }}
|
||||
enable-cache: true
|
||||
- name: Update apt package lists
|
||||
# cache-apt-pkgs-action assumes a fresh `apt-cache` index (true on GitHub-hosted
|
||||
# runners, not on all self-hosted/custom runner images), so refresh it explicitly
|
||||
# or package lookups silently resolve to an empty list.
|
||||
if: inputs.install-superset == 'true'
|
||||
shell: bash
|
||||
run: sudo apt-get update
|
||||
- name: Install apt packages
|
||||
if: inputs.install-superset == 'true'
|
||||
uses: awalsh128/cache-apt-pkgs-action@553a35bb8ebd9fcabcb1c9451aa4c98e1b4ca8a9 # v1.6.3
|
||||
with:
|
||||
packages: libldap2-dev libsasl2-dev
|
||||
version: 1.0
|
||||
- name: Install dependencies
|
||||
env:
|
||||
INPUT_INSTALL_SUPERSET: ${{ inputs.install-superset }}
|
||||
INPUT_REQUIREMENTS_TYPE: ${{ inputs.requirements-type }}
|
||||
run: |
|
||||
if [ "$INPUT_INSTALL_SUPERSET" = "true" ]; then
|
||||
sudo apt-get update && sudo apt-get -y install libldap2-dev libsasl2-dev
|
||||
|
||||
pip install --upgrade pip setuptools wheel uv
|
||||
|
||||
if [ "$INPUT_REQUIREMENTS_TYPE" = "dev" ]; then
|
||||
uv pip install --system -r requirements/development.txt
|
||||
elif [ "$INPUT_REQUIREMENTS_TYPE" = "base" ]; then
|
||||
|
||||
@@ -45,7 +45,10 @@ jobs:
|
||||
python-version: "3.11"
|
||||
|
||||
- name: Install uv
|
||||
run: pip install uv
|
||||
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
|
||||
with:
|
||||
python-version: "3.11"
|
||||
enable-cache: true
|
||||
|
||||
- name: supersetbot bump-python -p "${{ github.event.inputs.package }}"
|
||||
env:
|
||||
|
||||
@@ -51,6 +51,53 @@ jobs:
|
||||
echo "matrix_config=${MATRIX_CONFIG}" >> $GITHUB_OUTPUT
|
||||
echo $GITHUB_OUTPUT
|
||||
|
||||
# Runs unconditionally (no dependency on `changes`, and no build-preset
|
||||
# matrix restriction) so a regression in the PY_VER override logic is
|
||||
# always caught on PRs. Without this, the real docker-build job only runs
|
||||
# when the change detector flags docker/python/frontend changes (a
|
||||
# workflow-only edit like this one does not), and even then the PR build
|
||||
# matrix never includes the "py311"/"py312" presets that logic protects -
|
||||
# so a break here would otherwise first surface on a push to master.
|
||||
pyver-override-check:
|
||||
name: verify docker build PY_VER override
|
||||
runs-on: ubuntu-26.04
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Setup supersetbot
|
||||
uses: ./.github/actions/setup-supersetbot/
|
||||
- name: Assert PY_VER override applies to every preset except py311/py312
|
||||
shell: bash
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
# Asserts against the actual buildx command line `supersetbot docker
|
||||
# --dry-run` would run, not just this repo's own extra-flags helper,
|
||||
# so a regression in supersetbot itself (dropping the py311/py312
|
||||
# PY_VER pin, or reordering args so our override no longer lands
|
||||
# last) is caught here too, instead of only surfacing on master.
|
||||
assert_effective_py_ver() {
|
||||
local preset="$1" expected="$2" extra_flags command actual
|
||||
extra_flags="$(scripts/docker-build-extra-flags.sh "$preset" dummy-tag)"
|
||||
command="$(supersetbot docker --preset "$preset" --platform linux/amd64 --extra-flags "$extra_flags" --dry-run)"
|
||||
# docker buildx keeps the LAST value of a repeated --build-arg key.
|
||||
actual="$(grep -oE -- '--build-arg PY_VER=[^[:space:]]+' <<<"$command" | tail -1)"
|
||||
if [ "$actual" != "--build-arg PY_VER=$expected" ]; then
|
||||
echo "::error::preset '$preset' expected effective --build-arg PY_VER=$expected, got: ${actual:-<none>} (full command: $command)"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
for preset in dev lean websocket dockerize; do
|
||||
assert_effective_py_ver "$preset" "3.11.14-slim-trixie"
|
||||
done
|
||||
assert_effective_py_ver py311 "3.11-slim-bookworm"
|
||||
assert_effective_py_ver py312 "3.12-slim-bookworm"
|
||||
echo "PY_VER override logic verified against the assembled buildx command for all build presets"
|
||||
|
||||
docker-build:
|
||||
name: docker-build
|
||||
needs: [setup_matrix, changes]
|
||||
@@ -124,19 +171,21 @@ jobs:
|
||||
# the whole job. buildx reuses the buildkit layer cache from the
|
||||
# failed attempt, so a retry mostly re-does just the failed push.
|
||||
#
|
||||
# supersetbot's "dev"/"lean" presets pin their own --build-arg
|
||||
# PY_VER, which lands ahead of --extra-flags on the assembled
|
||||
# buildx command line; docker/buildx keeps the last value for a
|
||||
# repeated --build-arg key, so appending PY_VER here overrides
|
||||
# supersetbot's pin and keeps the build on the Dockerfile's own
|
||||
# supported Python version.
|
||||
# See scripts/docker-build-extra-flags.sh for why "py311"/"py312"
|
||||
# are excluded from the PY_VER override applied to every other
|
||||
# preset; that logic is also exercised on every PR by the
|
||||
# always-on pyver-override-check job below, since this job itself
|
||||
# only runs when the change detector flags docker/python/frontend
|
||||
# changes and the PR build matrix never includes py311/py312.
|
||||
EXTRA_FLAGS="$(scripts/docker-build-extra-flags.sh "$BUILD_PRESET" "$IMAGE_TAG")"
|
||||
|
||||
for attempt in 1 2 3; do
|
||||
if supersetbot docker \
|
||||
$PUSH_OR_LOAD \
|
||||
--preset "$BUILD_PRESET" \
|
||||
--context "$EVENT" \
|
||||
--context-ref "$RELEASE" $FORCE_LATEST \
|
||||
--extra-flags "--build-arg PY_VER=3.11.14-slim-trixie --build-arg INCLUDE_CHROMIUM=false --tag $IMAGE_TAG" \
|
||||
--extra-flags "$EXTRA_FLAGS" \
|
||||
$PLATFORM_ARG; then
|
||||
break
|
||||
fi
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
name: Enforce single Alembic migration head
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "master"
|
||||
- "[0-9].[0-9]*"
|
||||
pull_request:
|
||||
types: [synchronize, opened, reopened, ready_for_review]
|
||||
|
||||
# No `paths:` filter on purpose: this job is a required status check, and a
|
||||
# required check that never runs for a given PR blocks that PR from merging
|
||||
# forever. It has to fire on every PR so it always reports a status; whether
|
||||
# migrations changed is decided inside the job, not the trigger.
|
||||
|
||||
# cancel previous workflow jobs for PRs
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
enforce-single-migration-head:
|
||||
runs-on: ubuntu-26.04
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
steps:
|
||||
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Check for migration file changes
|
||||
id: check
|
||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
||||
with:
|
||||
github-token: ${{ github.token }}
|
||||
script: |
|
||||
if (context.eventName === 'push') {
|
||||
core.setOutput('changed', 'true');
|
||||
return;
|
||||
}
|
||||
const files = await github.paginate(github.rest.pulls.listFiles, {
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
pull_number: context.issue.number,
|
||||
});
|
||||
const changed = files.some((f) => f.filename.startsWith('superset/migrations/'));
|
||||
core.setOutput('changed', String(changed));
|
||||
- name: Setup Python
|
||||
if: steps.check.outputs.changed == 'true'
|
||||
uses: ./.github/actions/setup-backend/
|
||||
with:
|
||||
requirements-type: base
|
||||
- name: Assert a single Alembic head
|
||||
if: steps.check.outputs.changed == 'true'
|
||||
env:
|
||||
SUPERSET__SQLALCHEMY_DATABASE_URI: "sqlite:///:memory:"
|
||||
run: |
|
||||
heads="$(superset db heads)"
|
||||
echo "$heads"
|
||||
head_count=$(printf '%s\n' "$heads" | grep -c .)
|
||||
if [ "$head_count" -ne 1 ]; then
|
||||
echo "::error::superset/migrations resolves to $head_count Alembic heads (expected exactly 1)."
|
||||
echo "Another migration already landed with the same down_revision this branch was cut from."
|
||||
echo "Add a no-op merge revision joining the heads: https://superset.apache.org/docs/contributing/development#merging-db-migrations"
|
||||
exit 1
|
||||
fi
|
||||
@@ -0,0 +1,135 @@
|
||||
name: Frontend bundle size (nightly baseline + analyzer)
|
||||
|
||||
# Refreshes the bundle-size baseline that superset-frontend.yml's `bundle-size`
|
||||
# job compares PRs against, and publishes a browsable bundle-analyzer treemap
|
||||
# report of the same build. Deliberately NOT triggered on every push to
|
||||
# master: a day-old baseline/report is fine for catching relative
|
||||
# regressions on PRs and for browsing what's actually in the bundle, and
|
||||
# building the production bundle on every one of the many pushes master
|
||||
# gets per day would burn CI time for no benefit a nightly refresh doesn't
|
||||
# already cover.
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 6 * * *"
|
||||
workflow_dispatch: {}
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
TAG: apache/superset:bundle-size-nightly-${{ github.run_id }}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
refresh-baseline:
|
||||
runs-on: ubuntu-26.04
|
||||
timeout-minutes: 30
|
||||
env:
|
||||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_BUNDLE_ANALYZER_SITE_ID }}
|
||||
steps:
|
||||
- name: "Checkout master"
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
ref: master
|
||||
|
||||
- name: Build Docker Image
|
||||
run: |
|
||||
docker buildx build \
|
||||
-t $TAG \
|
||||
--cache-from=type=registry,ref=apache/superset-cache:3.11-slim-trixie \
|
||||
--target superset-node-ci \
|
||||
.
|
||||
|
||||
# Same cache the PR-time bundle-size job restores/writes -- webpack's
|
||||
# persistent filesystem cache turns a warm production build into ~20s
|
||||
# instead of several minutes. See superset-frontend.yml for the
|
||||
# matching restore step and why it's keyed this way.
|
||||
- name: Restore webpack build cache
|
||||
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||
with:
|
||||
path: superset-frontend/.temp_cache
|
||||
key: >-
|
||||
webpack-prod-cache-${{ hashFiles('superset-frontend/package-lock.json',
|
||||
'superset-frontend/babel.config.js', 'superset-frontend/tsconfig.json',
|
||||
'superset-frontend/webpack.config.js') }}
|
||||
|
||||
# Only ever pull the last recorded data point off the cache, keyed by
|
||||
# run ID -- `restore-keys` prefix-matches the most recently created
|
||||
# entry. Absent on the very first run ever; benchmark-action starts a
|
||||
# fresh history in that case.
|
||||
- name: Restore bundle size history
|
||||
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||
with:
|
||||
path: bundle-size-history.json
|
||||
key: bundle-size-history-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
bundle-size-history-
|
||||
|
||||
# BUNDLE_ANALYZER rides along in the same build as BUNDLE_SIZE_STATS --
|
||||
# they're independent env-gated additions in webpack.config.js (one
|
||||
# sets `config.stats`, the other pushes plugins), so one production
|
||||
# build produces both the numeric stats.json and the analyzer's
|
||||
# report.html. Only report.html is mounted out, not
|
||||
# BUNDLE_ANALYZER's sibling `statistics.html` sunburst -- that file is
|
||||
# documented in webpack.config.js as routinely exceeding 100MB for
|
||||
# this app (it's .gitignore'd for exactly that reason), too large to
|
||||
# publish as a static site page.
|
||||
- name: Build production bundle with stats and analyzer report
|
||||
run: |
|
||||
mkdir -p ${{ github.workspace }}/superset-frontend/bundle-stats
|
||||
mkdir -p ${{ github.workspace }}/superset-frontend/.temp_cache
|
||||
mkdir -p ${{ github.workspace }}/superset/static/assets
|
||||
docker run \
|
||||
-v ${{ github.workspace }}/superset-frontend/bundle-stats:/app/superset-frontend/bundle-stats \
|
||||
-v ${{ github.workspace }}/superset-frontend/.temp_cache:/app/superset-frontend/.temp_cache \
|
||||
-v ${{ github.workspace }}/superset/static/assets:/app/superset/static/assets \
|
||||
--rm $TAG \
|
||||
bash -c \
|
||||
"npm i && BUNDLE_SIZE_STATS=true BUNDLE_ANALYZER=true npm run build -- --json=bundle-stats/stats.json"
|
||||
|
||||
- name: Summarize bundle size
|
||||
run: |
|
||||
node superset-frontend/scripts/bundle-size-summary.js \
|
||||
superset-frontend/bundle-stats/stats.json > bundle-size-summary.json
|
||||
rm -rf superset-frontend/bundle-stats
|
||||
|
||||
# No PR to comment on here, so comment-on-alert is off -- the job
|
||||
# summary (summary-always) is the only surface for this run.
|
||||
- name: Update bundle size baseline
|
||||
uses: benchmark-action/github-action-benchmark@52576c92bccf6ac60c8223ec7eb2565637cae9ba # v1.22.1
|
||||
with:
|
||||
tool: customSmallerIsBetter
|
||||
output-file-path: bundle-size-summary.json
|
||||
external-data-json-path: bundle-size-history.json
|
||||
fail-on-alert: false
|
||||
summary-always: true
|
||||
|
||||
- name: Save bundle size history
|
||||
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||
with:
|
||||
path: bundle-size-history.json
|
||||
key: bundle-size-history-${{ github.run_id }}
|
||||
|
||||
# Publishes the treemap to Netlify (the same host already used for
|
||||
# superset-storybook.netlify.app and docs previews, reusing the
|
||||
# existing NETLIFY_AUTH_TOKEN). Skipped until
|
||||
# NETLIFY_BUNDLE_ANALYZER_SITE_ID exists -- create a new (free)
|
||||
# Netlify site named superset-bundle-analyzer and add its site ID as
|
||||
# that secret to turn this on; nothing else in this workflow depends
|
||||
# on it.
|
||||
- name: Publish bundle analyzer report to Netlify
|
||||
if: ${{ env.NETLIFY_SITE_ID != '' }}
|
||||
env:
|
||||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||
run: |
|
||||
mkdir -p netlify-publish
|
||||
cp superset/static/assets/report.html netlify-publish/index.html
|
||||
# zizmor: ignore[adhoc-packages] - netlify-cli is a one-shot CI deploy
|
||||
# tool, not an application dependency; a global/npx install has no
|
||||
# lockfile context. Version pinned above the floor set by other
|
||||
# ad-hoc installs in this repo (bump deliberately when upgrading).
|
||||
npx --yes netlify-cli@27.0.1 deploy --prod --dir=netlify-publish
|
||||
@@ -45,5 +45,8 @@ jobs:
|
||||
- name: Run Script
|
||||
run: bash .github/workflows/github-action-validator.sh
|
||||
|
||||
- name: Test docs-deploy freshness gate
|
||||
run: bash .github/workflows/scripts/check-docs-deploy-freshness.test.sh
|
||||
|
||||
- name: Check for security issues on GHA workflows
|
||||
uses: zizmorcore/zizmor-action@3dc1ecc9bcb9e94e9b2c709687979e1298497054 # v0.6.2
|
||||
|
||||
@@ -53,6 +53,15 @@ jobs:
|
||||
- name: Install helm-docs
|
||||
run: go install github.com/norwoodj/helm-docs/cmd/helm-docs@v1.14.2
|
||||
|
||||
# Spike: run the existing .pre-commit-config.yaml through prek (a Rust
|
||||
# reimplementation of pre-commit) instead of pre-commit itself, to see
|
||||
# whether it's viable to speed up this job. CI-only — contributors keep
|
||||
# installing/running `pre-commit` locally exactly as documented; nothing
|
||||
# here changes that.
|
||||
- name: Install prek
|
||||
run: |
|
||||
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/j178/prek/releases/download/v0.4.11/prek-installer.sh | sh
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
||||
with:
|
||||
@@ -70,13 +79,13 @@ jobs:
|
||||
cd docs
|
||||
yarn install --immutable
|
||||
|
||||
- name: Cache pre-commit environments
|
||||
- name: Cache prek environments
|
||||
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||
with:
|
||||
path: ~/.cache/pre-commit
|
||||
key: pre-commit-v2-${{ runner.os }}-py${{ matrix.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }}
|
||||
path: ~/.cache/prek
|
||||
key: prek-v1-${{ runner.os }}-py${{ matrix.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }}
|
||||
restore-keys: |
|
||||
pre-commit-v2-${{ runner.os }}-py${{ matrix.python-version }}-
|
||||
prek-v1-${{ runner.os }}-py${{ matrix.python-version }}-
|
||||
|
||||
- name: Determine changed files
|
||||
id: changed_files
|
||||
@@ -142,7 +151,7 @@ jobs:
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: pre-commit
|
||||
- name: pre-commit (via prek)
|
||||
env:
|
||||
MODE: ${{ steps.changed_files.outputs.mode }}
|
||||
CHANGED_FILES: ${{ steps.changed_files.outputs.files }}
|
||||
@@ -152,22 +161,22 @@ jobs:
|
||||
|
||||
case "${MODE}" in
|
||||
all)
|
||||
echo "ℹ️ Running pre-commit on all files."
|
||||
pre-commit run --all-files
|
||||
echo "ℹ️ Running prek on all files."
|
||||
prek run --all-files
|
||||
;;
|
||||
files)
|
||||
echo "ℹ️ Running pre-commit on changed files:"
|
||||
echo "ℹ️ Running prek on changed files:"
|
||||
echo "${CHANGED_FILES}"
|
||||
# shellcheck disable=SC2086
|
||||
pre-commit run --files ${CHANGED_FILES}
|
||||
prek run --files ${CHANGED_FILES}
|
||||
;;
|
||||
none)
|
||||
echo "ℹ️ No source files changed; nothing for pre-commit to check."
|
||||
echo "ℹ️ No source files changed; nothing for prek to check."
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo "⚠️ Unrecognized changed-files mode '${MODE}'; checking all files."
|
||||
pre-commit run --all-files
|
||||
prek run --all-files
|
||||
;;
|
||||
esac
|
||||
PRE_COMMIT_EXIT_CODE=$?
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
# contributor license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright ownership.
|
||||
# The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
# (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# Shared freshness gate used by the Docs Deployment workflow
|
||||
# (superset-docs-deploy.yml) both up front (check-freshness) and again right
|
||||
# before the deploy step (recheck-freshness). Writes an output declaring
|
||||
# whether BUILD_SHA is still master's current tip, so a superseded run can
|
||||
# skip cleanly instead of racing (and clobbering, or being force-cancelled
|
||||
# by) a fresher run.
|
||||
#
|
||||
# Required env vars:
|
||||
# BUILD_SHA - the commit SHA this run is building
|
||||
# REPO - "owner/repo" to query, e.g. github.repository
|
||||
# OUTPUT_NAME - the GITHUB_OUTPUT key to write, e.g. "is-current"
|
||||
# GITHUB_OUTPUT - path to append outputs to (set by the Actions runner)
|
||||
# Optional env vars:
|
||||
# EVENT_NAME - if "workflow_dispatch", bypasses the check and always
|
||||
# reports current, since a manual dispatch is a deliberate,
|
||||
# one-off action rather than something racing other triggers
|
||||
# GH_TOKEN - passed through to `gh`, needed to call the GitHub API
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
if [ "${EVENT_NAME:-}" = "workflow_dispatch" ]; then
|
||||
echo "${OUTPUT_NAME}=true" >>"$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
latest_sha="$(gh api "repos/${REPO}/commits/master" --jq .sha)"
|
||||
if [ "${latest_sha}" = "${BUILD_SHA}" ]; then
|
||||
echo "${OUTPUT_NAME}=true" >>"$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "${OUTPUT_NAME}=false" >>"$GITHUB_OUTPUT"
|
||||
echo "::notice::master has moved on to ${latest_sha} since ${BUILD_SHA} was triggered — skipping this stale run."
|
||||
fi
|
||||
@@ -0,0 +1,100 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
# contributor license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright ownership.
|
||||
# The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
# (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# Exercises check-docs-deploy-freshness.sh against a stubbed `gh`, covering
|
||||
# the dispatch-bypass, current-tip and stale-tip branches so the output
|
||||
# contract (is-current / still-current) can't silently regress. Run
|
||||
# directly, no extra tooling required:
|
||||
# bash .github/workflows/scripts/check-docs-deploy-freshness.test.sh
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
script_under_test="${script_dir}/check-docs-deploy-freshness.sh"
|
||||
|
||||
failures=0
|
||||
|
||||
# Runs the script under test with a stubbed `gh` reporting $1 as master's
|
||||
# latest sha, asserting that GITHUB_OUTPUT ends up containing exactly $4.
|
||||
run_case() {
|
||||
local case_name="$1"
|
||||
local latest_sha="$2"
|
||||
local build_sha="$3"
|
||||
local event_name="$4"
|
||||
local expected_line="$5"
|
||||
|
||||
local workdir
|
||||
workdir="$(mktemp -d)"
|
||||
trap 'rm -rf "${workdir}"' RETURN
|
||||
|
||||
# Fake `gh` that just echoes back the requested "latest" sha regardless of
|
||||
# arguments, so the script under test never touches the network.
|
||||
cat >"${workdir}/gh" <<EOF
|
||||
#!/bin/bash
|
||||
echo '${latest_sha}'
|
||||
EOF
|
||||
chmod +x "${workdir}/gh"
|
||||
|
||||
local output_file="${workdir}/github_output"
|
||||
: >"${output_file}"
|
||||
|
||||
if PATH="${workdir}:${PATH}" \
|
||||
GITHUB_OUTPUT="${output_file}" \
|
||||
OUTPUT_NAME="is-current" \
|
||||
REPO="apache/superset" \
|
||||
BUILD_SHA="${build_sha}" \
|
||||
EVENT_NAME="${event_name}" \
|
||||
GH_TOKEN="fake-token" \
|
||||
bash "${script_under_test}"; then
|
||||
:
|
||||
else
|
||||
echo "FAIL (${case_name}): script exited non-zero"
|
||||
failures=$((failures + 1))
|
||||
return
|
||||
fi
|
||||
|
||||
local actual
|
||||
actual="$(cat "${output_file}")"
|
||||
if [ "${actual}" = "${expected_line}" ]; then
|
||||
echo "PASS (${case_name})"
|
||||
else
|
||||
echo "FAIL (${case_name}): expected '${expected_line}', got '${actual}'"
|
||||
failures=$((failures + 1))
|
||||
fi
|
||||
}
|
||||
|
||||
# `gh` prints "should-not-be-called" for the dispatch case above the trick:
|
||||
# it's never actually invoked since the bypass short-circuits before the
|
||||
# `gh api` call, but the fake still needs a body.
|
||||
run_case "workflow_dispatch bypasses the check" \
|
||||
"unused" "abc123" "workflow_dispatch" \
|
||||
"is-current=true"
|
||||
|
||||
run_case "build sha matches master's tip" \
|
||||
"abc123" "abc123" "push" \
|
||||
"is-current=true"
|
||||
|
||||
run_case "build sha is stale" \
|
||||
"def456" "abc123" "push" \
|
||||
"is-current=false"
|
||||
|
||||
if [ "${failures}" -gt 0 ]; then
|
||||
echo "${failures} case(s) failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "All cases passed"
|
||||
@@ -18,16 +18,6 @@ on:
|
||||
|
||||
workflow_dispatch: {}
|
||||
|
||||
# Serialize deploys: the action pushes to apache/superset-site without
|
||||
# rebasing, so concurrent runs race on the final push and the loser fails
|
||||
# with `! [rejected] asf-site -> asf-site (fetch first)`. Cancel any
|
||||
# in-progress run as soon as a newer one starts — the destination repo
|
||||
# isn't touched until the final push step, so canceling mid-build is safe,
|
||||
# and the freshest content always wins.
|
||||
concurrency:
|
||||
group: docs-deploy-asf-site
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
actions: read
|
||||
@@ -48,17 +38,69 @@ jobs:
|
||||
|
||||
env:
|
||||
SUPERSET_SITE_BUILD: ${{ (secrets.SUPERSET_SITE_BUILD != '' && secrets.SUPERSET_SITE_BUILD != '') || '' }}
|
||||
|
||||
# Master gets frequent, sometimes bursty pushes, and each one can trigger a
|
||||
# deploy attempt. Rather than let every superseded attempt get force-killed
|
||||
# by the build-deploy concurrency group below (which shows up as a
|
||||
# `cancelled` — i.e. red/failing-looking — check on that commit), have each
|
||||
# run check up front whether it's still building master's current tip and,
|
||||
# if not, skip cleanly. Deliberately outside the docs-deploy-asf-site
|
||||
# concurrency group so it runs immediately for every trigger without
|
||||
# blocking or being blocked by anything.
|
||||
check-freshness:
|
||||
runs-on: ubuntu-26.04
|
||||
outputs:
|
||||
is-current: ${{ steps.check.outputs.is-current }}
|
||||
steps:
|
||||
# Sparse checkout: this job's only job is to be fast, so it fetches
|
||||
# nothing but the freshness-check script itself.
|
||||
- name: Checkout freshness-check script
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
sparse-checkout: |
|
||||
.github/workflows/scripts
|
||||
sparse-checkout-cone-mode: false
|
||||
- name: "Check whether this is still master's current commit"
|
||||
id: check
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
BUILD_SHA: ${{ github.event.workflow_run.head_sha || github.sha }}
|
||||
EVENT_NAME: ${{ github.event_name }}
|
||||
REPO: ${{ github.repository }}
|
||||
OUTPUT_NAME: is-current
|
||||
run: .github/workflows/scripts/check-docs-deploy-freshness.sh
|
||||
|
||||
build-deploy:
|
||||
needs: config
|
||||
needs: [config, check-freshness]
|
||||
# Only the run for master's current tip proceeds; anything superseded
|
||||
# already skipped at check-freshness above instead of landing here.
|
||||
# For workflow_run triggers, only deploy when the triggering run originated
|
||||
# from this repository (not a fork), ensuring the checked-out code and any
|
||||
# local actions executed with deploy credentials are trusted.
|
||||
if: >-
|
||||
needs.config.outputs.has-secrets &&
|
||||
needs.check-freshness.outputs.is-current == 'true' &&
|
||||
(github.event_name != 'workflow_run' ||
|
||||
github.event.workflow_run.head_repository.full_name == github.repository)
|
||||
name: Build & Deploy
|
||||
runs-on: ubuntu-26.04
|
||||
# Serialize deploys: the action pushes to apache/superset-site without
|
||||
# rebasing, so concurrent runs race on the final push and the loser fails
|
||||
# with `! [rejected] asf-site -> asf-site (fetch first)`. Queue instead of
|
||||
# canceling: a run that already passed check-freshness can still be
|
||||
# sitting in the queue for a runner when a newer run starts and finishes
|
||||
# first. cancel-in-progress would let that stale, queued run kill the
|
||||
# newer run's in-progress deploy the moment it's finally scheduled, and
|
||||
# then skip itself at the re-check below — losing the deploy entirely.
|
||||
# Queuing means the stale run just waits its turn and then no-ops at the
|
||||
# re-check, so the fresher content that already deployed is never
|
||||
# clobbered or lost. The check-freshness gate above means it should be
|
||||
# rare for more than one run to reach this point, so the queue stays
|
||||
# short in practice.
|
||||
concurrency:
|
||||
group: docs-deploy-asf-site
|
||||
cancel-in-progress: false
|
||||
steps:
|
||||
- uses: Kesin11/actions-timeline@57fc93f20c6da7fbc14063c6d24a2a5627c799ad # v3.2.0
|
||||
with:
|
||||
@@ -81,7 +123,11 @@ jobs:
|
||||
distribution: "zulu"
|
||||
java-version: "21"
|
||||
- name: Install Graphviz
|
||||
run: sudo apt-get install -y graphviz
|
||||
uses: awalsh128/cache-apt-pkgs-action@553a35bb8ebd9fcabcb1c9451aa4c98e1b4ca8a9 # v1.6.3
|
||||
with:
|
||||
packages: graphviz
|
||||
version: 1.0
|
||||
execute_install_scripts: true
|
||||
- name: Compute Entity Relationship diagram (ERD)
|
||||
env:
|
||||
SUPERSET_SECRET_KEY: not-a-secret
|
||||
@@ -126,7 +172,24 @@ jobs:
|
||||
working-directory: docs
|
||||
run: |
|
||||
yarn build
|
||||
# The check-freshness job above narrows the window but doesn't close it: an
|
||||
# older run can observe is-current=true, then sit through this build while a
|
||||
# newer run's own freshness check also passes and it deploys and finishes
|
||||
# first. If this (stale) run then wins entry into the concurrency group, it
|
||||
# would overwrite the newer content that already deployed. Re-check right
|
||||
# before the one step that actually mutates superset-site, so a stale run
|
||||
# skips deploying instead of clobbering a fresher one that already ran.
|
||||
- name: "Re-check freshness immediately before deploying"
|
||||
id: recheck-freshness
|
||||
if: github.event_name != 'workflow_dispatch'
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
BUILD_SHA: ${{ github.event.workflow_run.head_sha || github.sha }}
|
||||
REPO: ${{ github.repository }}
|
||||
OUTPUT_NAME: still-current
|
||||
run: .github/workflows/scripts/check-docs-deploy-freshness.sh
|
||||
- name: deploy docs
|
||||
if: github.event_name == 'workflow_dispatch' || steps.recheck-freshness.outputs.still-current == 'true'
|
||||
uses: ./.github/actions/github-action-push-to-another-repository
|
||||
env:
|
||||
API_TOKEN_GITHUB: ${{ secrets.SUPERSET_SITE_BUILD }}
|
||||
|
||||
@@ -212,3 +212,100 @@ jobs:
|
||||
- uses: Kesin11/actions-timeline@57fc93f20c6da7fbc14063c6d24a2a5627c799ad # v3.2.0
|
||||
with:
|
||||
expand-composite-actions: true
|
||||
|
||||
# Compares a PR's own bundle size against the last nightly-recorded
|
||||
# baseline (see frontend-bundle-size-nightly.yml, which owns actually
|
||||
# persisting new baselines). PR-only: a push to master doesn't need this
|
||||
# check re-run against itself, and re-persisting the baseline on every
|
||||
# push to master -- which happens many times a day -- would burn a full
|
||||
# production build for no benefit nightly refresh doesn't already cover.
|
||||
bundle-size:
|
||||
needs: frontend-build
|
||||
if: needs.frontend-build.outputs.should-run == 'true' && github.event_name == 'pull_request'
|
||||
runs-on: ubuntu-26.04
|
||||
timeout-minutes: 15
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
|
||||
|
||||
- name: Download Docker Image Artifact
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
|
||||
with:
|
||||
name: docker-image
|
||||
|
||||
- name: Load Docker Image
|
||||
run: |
|
||||
zstd -d < docker-image.tar.zst | docker load
|
||||
|
||||
# webpack's persistent filesystem cache (superset-frontend/webpack.config.js)
|
||||
# turns a warm production build into ~20s instead of several minutes,
|
||||
# but GH-hosted runners are fresh VMs with nothing carried over between
|
||||
# jobs -- without restoring it explicitly, every single PR would pay
|
||||
# the full cold-build cost. Keyed on the same files webpack's own
|
||||
# `buildDependencies` invalidates on, so a stale cache is never used.
|
||||
- name: Restore webpack build cache
|
||||
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||
with:
|
||||
path: superset-frontend/.temp_cache
|
||||
key: >-
|
||||
webpack-prod-cache-${{ hashFiles('superset-frontend/package-lock.json',
|
||||
'superset-frontend/babel.config.js', 'superset-frontend/tsconfig.json',
|
||||
'superset-frontend/webpack.config.js') }}
|
||||
|
||||
# Only ever pull the last recorded data point off the cache, keyed by
|
||||
# run ID -- `restore-keys` prefix-matches the most recently created
|
||||
# entry, which is always the latest nightly run. Absent before the
|
||||
# first nightly run ever happens; benchmark-action starts a fresh
|
||||
# history in that case.
|
||||
- name: Restore bundle size history
|
||||
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||
with:
|
||||
path: bundle-size-history.json
|
||||
key: bundle-size-history-${{ github.run_id }}
|
||||
restore-keys: |
|
||||
bundle-size-history-
|
||||
|
||||
- name: Build production bundle with stats
|
||||
run: |
|
||||
mkdir -p ${{ github.workspace }}/superset-frontend/bundle-stats
|
||||
mkdir -p ${{ github.workspace }}/superset-frontend/.temp_cache
|
||||
docker run \
|
||||
-v ${{ github.workspace }}/superset-frontend/bundle-stats:/app/superset-frontend/bundle-stats \
|
||||
-v ${{ github.workspace }}/superset-frontend/.temp_cache:/app/superset-frontend/.temp_cache \
|
||||
--rm $TAG \
|
||||
bash -c \
|
||||
"npm i && BUNDLE_SIZE_STATS=true npm run build -- --json=bundle-stats/stats.json"
|
||||
|
||||
- name: Summarize bundle size
|
||||
run: |
|
||||
node superset-frontend/scripts/bundle-size-summary.js \
|
||||
superset-frontend/bundle-stats/stats.json > bundle-size-summary.json
|
||||
rm -rf superset-frontend/bundle-stats
|
||||
|
||||
# Comparison + alert only -- this job never persists. See
|
||||
# frontend-bundle-size-nightly.yml for why.
|
||||
#
|
||||
# comment-on-alert is gated to same-repo PRs: on a fork PR,
|
||||
# GITHUB_TOKEN is forced read-only regardless of the `permissions`
|
||||
# block above, so once the alert threshold is crossed the action's
|
||||
# `pulls.createReview` call 403s. That error isn't gated by
|
||||
# fail-on-alert (which only governs the deliberate alert-threshold
|
||||
# failure) -- it propagates and fails the job outright. Fork PRs
|
||||
# still get the comparison via the job summary (summary-always).
|
||||
- name: Compare bundle size against nightly baseline
|
||||
uses: benchmark-action/github-action-benchmark@52576c92bccf6ac60c8223ec7eb2565637cae9ba # v1.22.1
|
||||
with:
|
||||
tool: customSmallerIsBetter
|
||||
output-file-path: bundle-size-summary.json
|
||||
external-data-json-path: bundle-size-history.json
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
comment-on-alert: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
|
||||
alert-threshold: "110%"
|
||||
fail-on-alert: false
|
||||
summary-always: true
|
||||
|
||||
@@ -155,6 +155,17 @@ jobs:
|
||||
INCLUDE_EMBEDDED: "true"
|
||||
with:
|
||||
run: playwright-run "${{ matrix.app_root }}" embedded
|
||||
- name: Run Playwright (Mobile Tests)
|
||||
uses: ./.github/actions/cached-dependencies
|
||||
env:
|
||||
NODE_OPTIONS: "--max-old-space-size=4096"
|
||||
# Scoped to this step for the same reason as the embedded flags
|
||||
# above: the mobile consumption mode should not alter Flask's
|
||||
# configuration for the required desktop test steps.
|
||||
SUPERSET_FEATURE_MOBILE_CONSUMPTION_MODE: "true"
|
||||
INCLUDE_MOBILE: "true"
|
||||
with:
|
||||
run: playwright-run "${{ matrix.app_root }}" mobile/
|
||||
- name: Set safe app root
|
||||
if: failure()
|
||||
id: set-safe-app-root
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
name: Python Unit Test Results
|
||||
|
||||
on:
|
||||
# zizmor: ignore[dangerous-triggers] - runs in base-branch context and only consumes artifacts uploaded by Python-Unit; never checks out PR code (see note below)
|
||||
workflow_run:
|
||||
workflows: ["Python-Unit"]
|
||||
types: [completed]
|
||||
|
||||
# This workflow publishes a check run annotating failing Python unit tests
|
||||
# inline on the PR diff, using JUnit XML uploaded by the Python-Unit workflow.
|
||||
# It uses the workflow_run trigger so that it always runs in the base-branch
|
||||
# context and can safely be granted write permissions, even for PRs from
|
||||
# forks or Dependabot.
|
||||
#
|
||||
# IMPORTANT: This workflow must NEVER check out code from the PR branch. All
|
||||
# data comes from artifacts uploaded by the Python-Unit workflow.
|
||||
permissions:
|
||||
contents: read
|
||||
checks: write
|
||||
issues: read
|
||||
actions: read
|
||||
|
||||
jobs:
|
||||
report:
|
||||
runs-on: ubuntu-26.04
|
||||
timeout-minutes: 10
|
||||
if: >
|
||||
github.event.workflow_run.conclusion == 'success' ||
|
||||
github.event.workflow_run.conclusion == 'failure'
|
||||
steps:
|
||||
# Fails soft (continue-on-error) because the source unit-tests job is
|
||||
# itself gated on change detection: a docs-only PR skips it entirely,
|
||||
# so there is nothing to download or report on.
|
||||
- name: Download JUnit results
|
||||
id: download
|
||||
continue-on-error: true
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
|
||||
with:
|
||||
# merge-multiple is intentionally omitted: each matrix leg's
|
||||
# artifact (junit-results-current, junit-results-next) uses the
|
||||
# same XML filenames, so merging them into one directory would let
|
||||
# one Python version's results overwrite the other's. Downloading
|
||||
# into per-artifact subdirectories keeps both, and the glob below
|
||||
# is recursive so it still picks up every XML file.
|
||||
pattern: "junit-results-*"
|
||||
path: artifacts
|
||||
run-id: ${{ github.event.workflow_run.id }}
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Download event file
|
||||
id: download-event
|
||||
if: steps.download.outcome == 'success'
|
||||
continue-on-error: true
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
|
||||
with:
|
||||
name: "Event File"
|
||||
path: event
|
||||
run-id: ${{ github.event.workflow_run.id }}
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Publish test results
|
||||
if: steps.download.outcome == 'success' && steps.download-event.outcome == 'success'
|
||||
uses: EnricoMi/publish-unit-test-result-action@d0a4676d0e0b938bc201470d88276b7c74c712b3 # v2.24.0
|
||||
with:
|
||||
commit: ${{ github.event.workflow_run.head_sha }}
|
||||
event_file: event/event.json
|
||||
event_name: ${{ github.event.workflow_run.event }}
|
||||
files: "artifacts/**/*.xml"
|
||||
check_name: "Python Unit Test Results"
|
||||
comment_mode: "off"
|
||||
@@ -74,14 +74,14 @@ jobs:
|
||||
SUPERSET_TESTENV: true
|
||||
SUPERSET_SECRET_KEY: not-a-secret
|
||||
run: |
|
||||
pytest --durations-min=0.5 --cov-report= --cov=superset ./tests/common ./tests/unit_tests --cache-clear --maxfail=50
|
||||
pytest --durations-min=0.5 --cov-report= --cov=superset ./tests/common ./tests/unit_tests --cache-clear --maxfail=50 --junit-xml=test-results/junit-unit.xml
|
||||
- name: Python 100% coverage unit tests
|
||||
env:
|
||||
SUPERSET_TESTENV: true
|
||||
SUPERSET_SECRET_KEY: not-a-secret
|
||||
run: |
|
||||
pytest --durations-min=0.5 --cov=superset/sql/ ./tests/unit_tests/sql/ --cache-clear --cov-fail-under=100
|
||||
pytest --durations-min=0.5 --cov=superset/semantic_layers/ ./tests/unit_tests/semantic_layers/ --cache-clear --cov-fail-under=100
|
||||
pytest --durations-min=0.5 --cov=superset/sql/ ./tests/unit_tests/sql/ --cache-clear --cov-fail-under=100 --junit-xml=test-results/junit-sql-coverage.xml
|
||||
pytest --durations-min=0.5 --cov=superset/semantic_layers/ ./tests/unit_tests/semantic_layers/ --cache-clear --cov-fail-under=100 --junit-xml=test-results/junit-semantic-layers-coverage.xml
|
||||
- name: Upload code coverage
|
||||
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
|
||||
with:
|
||||
@@ -89,6 +89,33 @@ jobs:
|
||||
verbose: true
|
||||
use_oidc: true
|
||||
slug: apache/superset
|
||||
# Uploaded even when a pytest step above fails, since that is exactly
|
||||
# when the JUnit results are needed downstream, to annotate the PR with
|
||||
# the failing tests. Consumed by the "Python Unit Test Results" workflow
|
||||
# via workflow_run (see that workflow for why it can't just be a step
|
||||
# here: it needs to run with write permissions, which this PR-triggered
|
||||
# job can't safely have on a fork PR).
|
||||
- name: Upload JUnit test results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
|
||||
with:
|
||||
name: junit-results-${{ matrix.python-version }}
|
||||
path: test-results/
|
||||
retention-days: 7
|
||||
|
||||
# Uploads the raw pull_request event payload so the "Python Unit Test
|
||||
# Results" workflow (running via workflow_run, in base-branch context) can
|
||||
# look up which PR/commit to annotate without checking out untrusted code.
|
||||
event-file:
|
||||
runs-on: ubuntu-26.04
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: Upload event file
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
|
||||
with:
|
||||
name: Event File
|
||||
path: ${{ github.event_path }}
|
||||
retention-days: 7
|
||||
|
||||
# Stable required-status-check anchor. `unit-tests` is a matrix job gated on
|
||||
# change detection, so on non-Python PRs it is skipped and never produces its
|
||||
|
||||
@@ -78,7 +78,10 @@ jobs:
|
||||
|
||||
- name: Install gettext tools
|
||||
if: steps.check.outputs.python == 'true' || steps.check.outputs.frontend == 'true'
|
||||
run: sudo apt-get update && sudo apt-get install -y gettext
|
||||
uses: awalsh128/cache-apt-pkgs-action@553a35bb8ebd9fcabcb1c9451aa4c98e1b4ca8a9 # v1.6.3
|
||||
with:
|
||||
packages: gettext
|
||||
version: 1.0
|
||||
|
||||
# Fetch the base ref so we can compare PR-introduced regressions
|
||||
# against a fair baseline (also runs babel_update against the base
|
||||
|
||||
@@ -167,7 +167,7 @@ The Developer Portal auto-generates MDX documentation from Storybook stories. **
|
||||
### Generator Location
|
||||
- Script: `docs/scripts/generate-superset-components.mjs`
|
||||
- Wrapper: `docs/src/components/StorybookWrapper.jsx`
|
||||
- Output: `docs/developer_portal/components/`
|
||||
- Output: `docs/developer_docs/components/`
|
||||
|
||||
## Architecture Patterns
|
||||
|
||||
|
||||
+1
-1
@@ -35,4 +35,4 @@ The Developer Portal includes comprehensive guides for:
|
||||
- [Code Review Process](https://superset.apache.org/developer_portal/contributing/code-review)
|
||||
- [Development How-tos](https://superset.apache.org/developer_portal/contributing/howtos)
|
||||
|
||||
Source for the Developer Portal documentation is [located here](https://github.com/apache/superset/tree/master/docs/developer_portal).
|
||||
Source for the Developer Portal documentation is [located here](https://github.com/apache/superset/tree/master/docs/developer_docs).
|
||||
|
||||
@@ -31,6 +31,8 @@ under the License.
|
||||
[](https://github.com/apache/superset/pulls)
|
||||
[](https://bit.ly/join-superset-slack)
|
||||
[](https://superset.apache.org)
|
||||
[](https://superset-storybook.netlify.app)
|
||||
[](https://superset-bundle-analyzer.netlify.app)
|
||||
|
||||
<picture width="500">
|
||||
<source
|
||||
|
||||
+77
@@ -24,8 +24,16 @@ assists people when migrating to a new version.
|
||||
|
||||
## Next
|
||||
|
||||
### OAuth2 database callback metrics include their outcome
|
||||
|
||||
The unqualified `DatabaseRestApi.oauth2` StatsD counter has been replaced with
|
||||
`DatabaseRestApi.oauth2.success`, `DatabaseRestApi.oauth2.warning`, and
|
||||
`DatabaseRestApi.oauth2.error`. Update monitoring rules and dashboards that consume
|
||||
the old counter to use the outcome-specific replacements.
|
||||
|
||||
- [42935](https://github.com/apache/superset/pull/42935): The MCP service now refuses to start (`MCPAuthConfigError`) when `MCP_JWT_ISSUER` trusts more than one issuer and no `MCP_USER_RESOLVER` is configured, instead of only logging a warning. This was already a documented misconfiguration (the default resolver isn't issuer-scoped, so distinct trusted issuers minting the same username/email would resolve to the same Superset user); deployments trusting multiple issuers must configure an `MCP_USER_RESOLVER` that derives its identity from the token's `iss` claim before upgrading. Single-issuer deployments are unaffected.
|
||||
- [42393](https://github.com/apache/superset/pull/42393): Exported dataset YAML now carries a `uuid` for each metric and column so that custom folder assignments (which reference metrics/columns by UUID) survive an import into another workspace. This affects any export bundle that contains datasets, not just a dataset export: chart, dashboard, database and full-asset exports all embed the same dataset YAML, so a dashboard exported from this release also fails to import into an older one even though no dataset was exported directly. As with `folders` and `currency_code_column`, the affected `datasets/` files fail schema validation (`Unknown field: uuid`) when imported into Superset releases that predate this change; regenerate or hand-edit exports for older targets in mixed-version fleets.
|
||||
- [42300](https://github.com/apache/superset/pull/42300): Timeseries charts (line/area/bar) with a Y-axis bound in effect — either an explicit `yAxisBounds` or one derived from `truncateYAxis` — now clamp out-of-range data points to that bound instead of letting ECharts drop the point (and the line segments around it) entirely. Any existing chart with a configured Y-axis bound and data outside it will look different after upgrading: a gap becomes a point pinned to the boundary. The clamp also rewrites the value ECharts reads for that point's tooltip and data label, so the displayed value is the bound rather than the true observation.
|
||||
- [42087](https://github.com/apache/superset/pull/42087): Stored calculated-column and metric expressions are validated when a query is built, under the same sub-query policy already applied to adhoc expressions. Previously only the dataset update path checked them on save, so expressions written by v1 import, by dataset duplication, or before that check existed were never validated. Since `ALLOW_ADHOC_SUBQUERY` defaults to `False` (see [19242](https://github.com/apache/superset/pull/19242)), a dataset whose stored expression contains a sub-query works before upgrading and afterwards fails at chart render with `Custom SQL fields cannot contain sub-queries.` There is no migration step, and the error does not name the offending dataset column, so audit stored expressions before upgrading: either rewrite them without the sub-query, or set `ALLOW_ADHOC_SUBQUERY = True` to keep the previous behaviour for both stored and adhoc expressions.
|
||||
|
||||
### Selenium support removed — Playwright is now required for screenshots
|
||||
@@ -54,6 +62,43 @@ pip install playwright && playwright install chromium
|
||||
2. Remove any references to the removed config keys from custom `superset_config.py`
|
||||
3. If you subclassed `MachineAuthProvider`, remove any `authenticate_webdriver` override and migrate auth logic to `authenticate_browser_context`
|
||||
|
||||
### CSV/XLSX report exports of Table charts keep raw numeric values
|
||||
|
||||
Table and Pivot Table charts sent as text in a report email now apply the
|
||||
chart's number and currency formatting so the values match what a user sees in
|
||||
Explore. As part of this, the CSV and XLSX result formats return early before
|
||||
formatting: previously the Table post-processor applied `d3NumberFormat` to
|
||||
every result format, so CSV/XLSX exports contained pre-formatted strings.
|
||||
CSV/XLSX exports now preserve numeric values and column types, which is better
|
||||
for downstream analysis but is a visible change for anyone who relied on the
|
||||
formatted text in those files. The rendered email body (the only place the
|
||||
formatting is intended for) is unaffected.
|
||||
|
||||
### SQLAlchemy bumped to 2.0, flask-sqlalchemy to 3.1.1
|
||||
|
||||
Superset's core ORM dependencies move from SQLAlchemy 1.4 to 2.0 and
|
||||
flask-sqlalchemy `<3.0` to 3.1.1, completing the migration tracked in
|
||||
[discussion #40273](https://github.com/apache/superset/discussions/40273).
|
||||
|
||||
**Custom `db_engine_specs`, plugins, or extensions that import SQLAlchemy
|
||||
internals directly** should review the
|
||||
[SQLAlchemy 1.4-to-2.0 migration guide](https://docs.sqlalchemy.org/en/20/changelog/migration_20.html)
|
||||
for API changes that affect them — most 1.4 code already runs unmodified
|
||||
under 2.0's compatibility mode, but patterns like `Engine.execute()`,
|
||||
string-keyed `Row` access, and `MetaData(bind=)` are removed outright.
|
||||
|
||||
**Several optional DB-connector extras remain capped below their
|
||||
SQLAlchemy-2.0-only releases**, either because that bump is a separate
|
||||
follow-up ([#42891](https://github.com/apache/superset/pull/42891): dremio,
|
||||
exasol, firebird, redshift, risingwave) or because the upstream dialect
|
||||
package has no SQLAlchemy 2.0 support yet at all (aurora-data-api, d1,
|
||||
kusto, solr; ocient's 2.0 compatibility is unverified). Installing one of
|
||||
these extras continues to pull a SQLAlchemy-1.4-line version of that
|
||||
dialect; each package's constraint in `pyproject.toml` documents why.
|
||||
|
||||
No application-level configuration changes are required for deployments
|
||||
that don't touch SQLAlchemy directly.
|
||||
|
||||
### Soft delete is on by default, and purging is live
|
||||
|
||||
`SOFT_DELETE` now ships **on** (`DEFAULT_FEATURE_FLAGS`), so deleting a
|
||||
@@ -159,6 +204,36 @@ will now get a TypeScript error and must remove the prop; keeping a manual
|
||||
override was exactly the footgun this change removes (see #42510). No
|
||||
callers in the Superset frontend codebase itself passed this prop.
|
||||
|
||||
### Row-level security now filters table reads a same-named CTE used to hide
|
||||
|
||||
`extract_tables_from_statement()` decided whether a reference was a CTE by matching its
|
||||
bare name against the enclosing scope's CTE names; it now resolves the name through
|
||||
`Scope.cte_sources`. Three kinds of real table read whose bare name collided with a CTE's
|
||||
were mistaken for the CTE and dropped from a statement's tables, so they were neither
|
||||
RLS-filtered nor access-checked: a schema- or catalog-qualified reference, a non-recursive
|
||||
CTE's own name inside its body, and a forward reference to a later `WITH` item.
|
||||
|
||||
```sql
|
||||
WITH orders AS (SELECT 1 AS d) SELECT * FROM (SELECT * FROM public.orders) AS z
|
||||
WITH orders AS (SELECT * FROM orders) SELECT * FROM orders
|
||||
WITH q1 AS (SELECT key FROM q2), q2 AS (SELECT 1 AS key) SELECT * FROM q1
|
||||
```
|
||||
|
||||
Each read is now reported, so it is filtered when `RLS_IN_SQLLAB` is enabled, matched
|
||||
against `DISALLOWED_SQL_TABLES`, and requires dataset access under
|
||||
`raise_for_access(force_dataset_match=True)`. A query that previously ran, reading those
|
||||
rows unfiltered, may now be filtered or rejected. There is no opt-out — the previous
|
||||
behavior was a row-level-security bypass.
|
||||
|
||||
### Table aliases keep their quoting through the row-level security rewrite
|
||||
|
||||
Both RLS transformers took the table alias as a string with its quoting stripped and
|
||||
emitted it verbatim; they now carry the parsed identifier. Emitted SQL is unchanged for an
|
||||
unquoted identifier; a quoted one keeps its quoting, and a column-alias list
|
||||
(`FROM t AS x (c1, c2)`) survives the rewrite instead of being dropped. This repairs
|
||||
row-level security for any aliased table on Snowflake, and for at least one statement shape
|
||||
on MSSQL where the rewrite previously raised `AttributeError`.
|
||||
|
||||
### Principal listing APIs now honour related-field filters
|
||||
|
||||
Two authorization-related listing behaviors changed for API clients. Neither
|
||||
@@ -828,6 +903,8 @@ With the flag enabled: `DELETE /api/v1/chart/<id>` no longer hard-deletes the ch
|
||||
|
||||
- [39914](https://github.com/apache/superset/pull/39914) `ALERT_REPORT_SLACK_V2` now defaults to `True` and the legacy Slack v1 integration (`Slack` recipient type, `files.upload` API) is deprecated for removal in the next major. Slack blocked new apps from `files.upload` in May 2024 and fully retired the method for all apps on November 12, 2025; because the v1 path sends files through `files.upload`, v1 file-bearing sends now fail at the API level — only text-only `chat_postMessage` still works via the legacy path. Grant your Slack bot the `channels:read` and `groups:read` scopes so existing `Slack` recipients can be auto-upgraded to `SlackV2` on next send. Operators who explicitly override the flag to `False`, or whose Slack bot is missing those scopes, will see deprecation warnings while text-only sends continue through the legacy path.
|
||||
|
||||
- [42089](https://github.com/apache/superset/pull/42089) automatically upgrades resolvable Slack v1 recipients, preserves text-only v1 delivery with execution warnings when migration cannot finish, and rejects retired v1 file uploads with actionable scope guidance. Slack delivery uses at-most-once terminal writes and a schedule-wide retry budget configured by `SLACK_SEND_RETRY_MAX_TIME`, clamped to the report's remaining working timeout. Deployments using `SupersetMetastoreCache` for the Slack channel cache must schedule the `slack.cache_channels` Celery task to repopulate misses outside report transactions; see [Alerts and Reports](https://superset.apache.org/admin-docs/configuration/alerts-reports#slack-delivery-timeouts-and-retries).
|
||||
|
||||
### Soft delete and restore for dashboards
|
||||
|
||||
**Everything in this section applies only when the `SOFT_DELETE` feature flag is enabled. The flag defaults to `False`** (`@lifecycle: development`), so on a default deployment `DELETE /api/v1/dashboard/<id>` continues to **hard-delete permanently** — nothing is recoverable. Enable `SOFT_DELETE` to get the behavior described below.
|
||||
|
||||
@@ -118,6 +118,7 @@ FEATURE_FLAGS = {
|
||||
"ALERT_REPORTS": True,
|
||||
"DATASET_FOLDERS": True,
|
||||
"ENABLE_EXTENSIONS": True,
|
||||
"MOBILE_CONSUMPTION_MODE": True,
|
||||
"SEMANTIC_LAYERS": True,
|
||||
}
|
||||
EXTENSIONS_PATH = "/app/docker/extensions"
|
||||
|
||||
@@ -83,6 +83,28 @@ SLACK_CACHE_TIMEOUT = int(timedelta(days=2).total_seconds())
|
||||
SLACK_API_RATE_LIMIT_RETRY_COUNT = 5
|
||||
```
|
||||
|
||||
When the cache backend is `SupersetMetastoreCache`, report execution does not
|
||||
write channel listings into the cache because that backend commits the report's
|
||||
database session. Schedule the dedicated warm-up task so cache misses are
|
||||
repopulated outside report transactions:
|
||||
|
||||
```python
|
||||
from celery.schedules import crontab
|
||||
|
||||
from superset.config import CeleryConfig
|
||||
|
||||
class CustomCeleryConfig(CeleryConfig):
|
||||
beat_schedule = {
|
||||
**CeleryConfig.beat_schedule,
|
||||
"slack.cache_channels": {
|
||||
"task": "slack.cache_channels",
|
||||
"schedule": crontab(minute="0", hour="*"),
|
||||
},
|
||||
}
|
||||
|
||||
CELERY_CONFIG = CustomCeleryConfig
|
||||
```
|
||||
|
||||
#### Slack Enterprise Grid (org-scoped tokens)
|
||||
|
||||
On a Slack Enterprise Grid org, an org-scoped token spans multiple workspaces, so
|
||||
@@ -98,6 +120,38 @@ SLACK_TEAM_ID = "T01234567"
|
||||
This defaults to `None` and only needs to be set when using an org-scoped token;
|
||||
it is accepted but ignored for standard workspace-level tokens.
|
||||
|
||||
#### Slack delivery timeouts and retries
|
||||
|
||||
Slack delivery uses a request timeout and an application retry budget:
|
||||
|
||||
```python
|
||||
# Timeout for one Slack API request, in seconds
|
||||
SLACK_API_TIMEOUT = 30
|
||||
|
||||
# Retry budget shared by every Slack destination and upload phase
|
||||
SLACK_SEND_RETRY_MAX_TIME = 150
|
||||
|
||||
# Number of explicit HTTP 429 responses retried using Slack's Retry-After value
|
||||
SLACK_API_RATE_LIMIT_RETRY_COUNT = 2
|
||||
|
||||
# Cooldown after an on-demand channel-cache refresh
|
||||
SLACK_CHANNEL_REFRESH_COOLDOWN_SECONDS = 300
|
||||
```
|
||||
|
||||
All channels and upload phases in one report execution share a single
|
||||
`SLACK_SEND_RETRY_MAX_TIME` budget. This prevents a large recipient list from
|
||||
multiplying the report's wall-clock retry time. The budget is also clamped to
|
||||
the report's remaining working timeout, leaving Celery's configured timeout lag
|
||||
available for final state persistence. The effective configured budget is at
|
||||
least one second longer than `SLACK_API_TIMEOUT`.
|
||||
|
||||
To avoid posting the same report twice, Superset does not replay terminal
|
||||
`chat.postMessage` or `files.completeUploadExternal` operations after ambiguous
|
||||
server or transport failures. Explicit Slack HTTP 429 responses remain
|
||||
retryable. These delivery settings and semantics apply to Slack v2 reports and
|
||||
legacy text-only Slack delivery, independently of the
|
||||
`ALERT_REPORT_SLACK_V2` feature flag.
|
||||
|
||||
### Webhook integration
|
||||
|
||||
Superset can send alert and report notifications to any HTTP endpoint — useful for chat platforms, incident management tools, or custom automation.
|
||||
|
||||
@@ -0,0 +1,184 @@
|
||||
---
|
||||
title: Dashboard Performance
|
||||
hide_title: true
|
||||
sidebar_position: 5
|
||||
version: 1
|
||||
---
|
||||
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
-->
|
||||
|
||||
# Dashboard Performance
|
||||
|
||||
A dashboard's perceived speed is determined by three independent things: how
|
||||
many charts have to render, how many queries the backend can execute
|
||||
concurrently, and how quickly the underlying data warehouse can return
|
||||
results. Superset gives you levers for the first two; the third belongs to
|
||||
your warehouse. This page covers the dashboard-side levers and the practical
|
||||
guidance around them.
|
||||
|
||||
## Is there a maximum chart count per dashboard?
|
||||
|
||||
**No hard limit is enforced** — Superset has no configuration key that
|
||||
caps the number of charts on a dashboard. In practice, dashboards behave
|
||||
well up to a few dozen charts. Beyond that, you'll typically feel friction
|
||||
on the initial load and during cross-filter / time-range updates, even with
|
||||
the lazy-loading optimizations described below.
|
||||
|
||||
Rough thresholds to keep in mind:
|
||||
|
||||
- **Under ~25 charts**: usually no perceptible problem.
|
||||
- **25–50 charts**: still fine, but you start to want tabs to break the
|
||||
page into chunks the user actually looks at.
|
||||
- **Over ~50 charts**: split into multiple dashboards or use tabs
|
||||
aggressively. The bottleneck is rarely Superset itself — it's the
|
||||
warehouse executing dozens of queries in parallel and the browser
|
||||
rendering dozens of chart frames.
|
||||
|
||||
These are guidelines, not guarantees. A dashboard of 100 sparkline-style
|
||||
charts hitting a fast cache behaves very differently from a dashboard of
|
||||
20 heavy aggregations against a cold warehouse.
|
||||
|
||||
## Lazy rendering — `DASHBOARD_VIRTUALIZATION`
|
||||
|
||||
Superset's dashboard layout is virtualized at the row level. Charts that
|
||||
are far below the user's current scroll position render a placeholder
|
||||
instead of their visualization until the user scrolls them into view, and
|
||||
go back to a placeholder if scrolled well past. The chart component itself
|
||||
stays mounted throughout — only the visualization is swapped for a
|
||||
placeholder — so this alone does **not** reduce backend query load; see
|
||||
[Deferred data fetch](#deferred-data-fetch--dashboard_virtualization_defer_data)
|
||||
below for that. This is on by default.
|
||||
|
||||
**Feature flag**: `DASHBOARD_VIRTUALIZATION` (default: `True`)
|
||||
|
||||
The flag is `stable` and marked for path-to-deprecation — meaning the
|
||||
behavior will eventually be non-optional, but the flag still exists so
|
||||
operators can disable it if a specific layout misbehaves.
|
||||
|
||||
**Behavior** (from `superset-frontend/src/dashboard/components/gridComponents/Row/Row.tsx`):
|
||||
|
||||
- A chart's visualization is rendered when its row scrolls within **1
|
||||
viewport height** of the visible area.
|
||||
- A chart's visualization is swapped back for a placeholder when its row
|
||||
scrolls more than **4 viewport heights** away from the visible area.
|
||||
- Tabs that aren't currently selected don't render their content at all
|
||||
(see below).
|
||||
- The placeholder-swap-back is skipped in **embedded** mode (so an
|
||||
embedded dashboard keeps its charts rendered once they've been seen,
|
||||
which avoids re-rendering on scroll-up). Both halves are skipped for
|
||||
**headless / bot** rendering (so screenshot / report jobs load every
|
||||
chart).
|
||||
|
||||
## Deferred data fetch — `DASHBOARD_VIRTUALIZATION_DEFER_DATA`
|
||||
|
||||
By default, `DASHBOARD_VIRTUALIZATION` only controls whether a chart's
|
||||
*visualization* is rendered — the chart component still mounts and issues
|
||||
its data request immediately, regardless of scroll position.
|
||||
`DASHBOARD_VIRTUALIZATION_DEFER_DATA` is a supplementary flag that skips
|
||||
the data request itself for charts that aren't currently in view, useful
|
||||
for backends where opening a connection or compiling a query is expensive
|
||||
even if the result would be thrown away. It only has an effect when
|
||||
`DASHBOARD_VIRTUALIZATION` is also enabled — with virtualization off,
|
||||
every chart is treated as in view, so there's nothing left to defer.
|
||||
|
||||
**Feature flag**: `DASHBOARD_VIRTUALIZATION_DEFER_DATA` (default: `False`)
|
||||
|
||||
Enable this if you see warehouse load spike on dashboard *open* even
|
||||
though most charts are off-screen.
|
||||
|
||||
## Per-tab lazy loading
|
||||
|
||||
**This is on by default and has no flag.** A tab's content is not rendered
|
||||
until the user activates that tab, so charts inside an unselected tab do
|
||||
not fetch data on dashboard open. When the user clicks the tab, that
|
||||
tab's charts mount and fetch in the normal way.
|
||||
|
||||
Practically: tabs are the single most effective tool for a large
|
||||
dashboard. Splitting 60 charts across 4 tabs effectively turns dashboard
|
||||
open into "load ~15 charts," and the remaining ones lazy-load only if the
|
||||
user goes looking.
|
||||
|
||||
## Is there a switch to cap concurrent chart queries?
|
||||
|
||||
**No.** Superset does not implement a frontend-side concurrent-request
|
||||
limiter. Each chart issues its own data request when it mounts, and the
|
||||
browser handles parallelism — typically ~6 in-flight requests per origin
|
||||
under HTTP/1.1, though HTTP/2 or HTTP/3 (if your deployment terminates
|
||||
TLS that way) can multiplex considerably more over a single connection.
|
||||
Backend throughput is bounded by your
|
||||
Gunicorn worker count for synchronous query execution, or by your Celery
|
||||
worker pool when [async queries](./async-queries-celery.mdx) are enabled.
|
||||
|
||||
If you need to throttle warehouse load, the right place is:
|
||||
|
||||
1. The warehouse itself (connection pool / concurrency limits).
|
||||
2. Superset's Celery configuration (smaller worker pool when async
|
||||
queries are on).
|
||||
3. Splitting heavy charts across tabs or separate dashboards (each
|
||||
dashboard load only fetches what's visible).
|
||||
|
||||
## Splitting strategies
|
||||
|
||||
When a dashboard outgrows comfortable performance, the options in order
|
||||
of effort:
|
||||
|
||||
**1. Move sections into tabs.** Same dashboard, but only the active tab's
|
||||
charts fetch. This is the cheapest change and often the only one needed.
|
||||
|
||||
**2. Cache aggressively.** A Redis cache backend (see
|
||||
[Caching](./cache.mdx)) means repeat dashboard loads serve from cache
|
||||
rather than re-hitting the warehouse. This is especially impactful for
|
||||
dashboards opened by many users in close succession.
|
||||
|
||||
**3. Enable async queries.** [Async query execution](./async-queries-celery.mdx)
|
||||
via Celery decouples query duration from request lifetime, so a slow
|
||||
chart doesn't block the page. The user sees other charts come in as
|
||||
their queries complete.
|
||||
|
||||
**4. Split into multiple dashboards.** Group related charts into purpose-
|
||||
specific dashboards rather than one mega-dashboard. Link them from a
|
||||
landing dashboard or a navigation menu.
|
||||
|
||||
**5. Pre-aggregate at the warehouse level.** If the same expensive
|
||||
aggregation appears across many charts, materialize it as a view or
|
||||
scheduled table in the warehouse so each chart query is a cheap lookup.
|
||||
|
||||
## Operational notes
|
||||
|
||||
- The feature flags above are set in `superset_config.py`, e.g.:
|
||||
|
||||
```python
|
||||
FEATURE_FLAGS = {
|
||||
"DASHBOARD_VIRTUALIZATION": True,
|
||||
"DASHBOARD_VIRTUALIZATION_DEFER_DATA": True,
|
||||
}
|
||||
```
|
||||
|
||||
- See [Feature Flags](./feature-flags.mdx) for the full list of supported
|
||||
flags and their lifecycle stages.
|
||||
- Server-side screenshot jobs (alerts, scheduled reports, thumbnails)
|
||||
render the dashboard in a headless, webdriver-controlled browser, which
|
||||
intentionally bypasses row virtualization so the rendered artifact
|
||||
includes every chart, not just the ones above the fold. User-triggered
|
||||
"download as image/PDF" is different: it captures whatever's currently
|
||||
rendered in the user's own browser, so it's still subject to
|
||||
virtualization like any other page view. Metadata/YAML dashboard export
|
||||
doesn't render the frontend at all, so virtualization doesn't apply to
|
||||
it either.
|
||||
@@ -519,6 +519,30 @@ sh -c "$(curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.0/install
|
||||
|
||||
For those interested, you may also try out [avn](https://github.com/nvm-sh/nvm#deeper-shell-integration) to automatically switch to the node version that is required to run Superset frontend.
|
||||
|
||||
##### zstd
|
||||
|
||||
`npm run dev-server` proxies requests to your local Superset server and rewrites the HTML it returns, so it has to decompress responses sent with `Content-Encoding: zstd`. It does that with [`simple-zstd`](https://www.npmjs.com/package/simple-zstd), which wraps the system `zstd` binary instead of bundling one. That binary has to be on your `PATH`:
|
||||
|
||||
```bash
|
||||
# macOS
|
||||
brew install zstd
|
||||
|
||||
# Ubuntu/Debian
|
||||
sudo apt install zstd
|
||||
|
||||
# Windows
|
||||
choco install zstd
|
||||
```
|
||||
|
||||
`simple-zstd` looks for the binary when it is first imported, not when a response is decompressed, so a missing `zstd` stops the dev server at startup with:
|
||||
|
||||
```
|
||||
Error: Can not access zstd! Is it installed?
|
||||
at Object.<anonymous> (.../node_modules/simple-zstd/dist/src/index.js:102:11)
|
||||
```
|
||||
|
||||
The message names the dependency, but it surfaces from inside `webpack.proxy-config.js` while the webpack config is loading, which reads like a build-tooling failure rather than a missing system package.
|
||||
|
||||
#### Install dependencies
|
||||
|
||||
Install third-party dependencies listed in `package.json` via:
|
||||
|
||||
@@ -198,7 +198,7 @@ Each component should come with its dedicated storybook file.
|
||||
|
||||
**One component per story:** Each storybook file should only contain one component unless substantially different variants are required
|
||||
|
||||
**Component variants:** If the component behavior is substantially different when certain props are used, it is best to separate the story into different types. See the `superset-frontend/src/components/Select/Select.stories.tsx` as an example.
|
||||
**Component variants:** If the component behavior is substantially different when certain props are used, it is best to separate the story into different types. See the `superset-frontend/packages/superset-ui-core/src/components/Select/Select.stories.tsx` as an example.
|
||||
|
||||
**Isolated state:** The storybook should show how the component works in an isolated state and with as few dependencies as possible
|
||||
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
---
|
||||
title: Mobile Experience
|
||||
sidebar_position: 7
|
||||
version: 1
|
||||
---
|
||||
|
||||
import useBaseUrl from "@docusaurus/useBaseUrl";
|
||||
|
||||
# Mobile Experience
|
||||
|
||||
Superset ships an optional, consumption-only mobile experience for viewing
|
||||
dashboards on phones and other small screens. When enabled, screens below
|
||||
768px wide get a layout built for touch: dashboards render their charts
|
||||
stacked full-width, navigation collapses into a drawer, and dashboard
|
||||
filters open in a slide-out panel.
|
||||
|
||||
The mobile experience is **read-only by design**. It is aimed at consumers
|
||||
of analytics — people checking a dashboard from a phone — not at dashboard
|
||||
authors. Authoring surfaces (chart builder, SQL Lab, dataset management,
|
||||
and administrative screens) remain desktop-only.
|
||||
|
||||
## Enabling the mobile experience
|
||||
|
||||
The mobile experience is gated behind the `MOBILE_CONSUMPTION_MODE` feature
|
||||
flag, which is off by default. Enable it in your `superset_config.py`:
|
||||
|
||||
```python
|
||||
FEATURE_FLAGS = {
|
||||
"MOBILE_CONSUMPTION_MODE": True,
|
||||
}
|
||||
```
|
||||
|
||||
With the flag disabled, Superset renders identically at every screen size,
|
||||
and phones display the desktop layout scaled down (the pre-existing
|
||||
behavior). The flag also controls whether Superset serves a viewport meta
|
||||
tag, which is required for mobile browsers to apply the responsive layout
|
||||
at their native width.
|
||||
|
||||
## What works on mobile
|
||||
|
||||
| Area | Mobile behavior |
|
||||
| --- | --- |
|
||||
| **Dashboards** | Charts stack vertically at full width, sized to the screen. Tab bars are sticky and swipeable. Native filters open in a drawer via the filter icon in the header. |
|
||||
| **Dashboard list** | Card view with full-width cards; search and filters open in a drawer. |
|
||||
| **Home** | Recents (dashboards only) and dashboard cards; desktop-only sections are hidden. |
|
||||
| **Navigation** | A hamburger menu opens a drawer with links to dashboards, theme and language selection, and user info/logout. |
|
||||
|
||||
<div style={{display: 'flex', gap: '1rem', flexWrap: 'wrap'}}>
|
||||
<img src={useBaseUrl("/img/screenshots/mobile/mobile_dashboard.jpg")} alt="A dashboard on mobile with charts stacked full width" width="260" />
|
||||
<img src={useBaseUrl("/img/screenshots/mobile/mobile_filter_drawer.jpg")} alt="The dashboard filter drawer on mobile" width="260" />
|
||||
<img src={useBaseUrl("/img/screenshots/mobile/mobile_dashboard_list.jpg")} alt="The dashboard list in card view on mobile" width="260" />
|
||||
</div>
|
||||
|
||||
<div style={{display: 'flex', gap: '1rem', flexWrap: 'wrap', marginTop: '1rem'}}>
|
||||
<img src={useBaseUrl("/img/screenshots/mobile/mobile_home.jpg")} alt="The Superset home page on mobile" width="260" />
|
||||
<img src={useBaseUrl("/img/screenshots/mobile/mobile_nav_drawer.jpg")} alt="The mobile navigation drawer" width="260" />
|
||||
<img src={useBaseUrl("/img/screenshots/mobile/mobile_unsupported.jpg")} alt="The screen shown for views that are not available on mobile" width="260" />
|
||||
</div>
|
||||
|
||||
## What doesn't work on mobile
|
||||
|
||||
Everything not listed above shows a friendly "This view isn't available on
|
||||
mobile" screen with shortcuts back to dashboards and the home page. That
|
||||
includes:
|
||||
|
||||
- Chart builder (Explore) and chart-level links — chart titles on
|
||||
dashboards are plain text on mobile, and chart entries are filtered out
|
||||
of the home page's Recents feed
|
||||
- SQL Lab and query history
|
||||
- Creating or editing dashboards, charts, datasets, and databases
|
||||
- List views other than dashboards (charts, datasets, saved queries, etc.)
|
||||
- Administrative and settings screens
|
||||
|
||||
Editing controls are also removed from the screens that *are* supported:
|
||||
the dashboard header hides the edit, publish, and favorite controls, and
|
||||
dashboard/chart kebab menus are reduced to view-oriented actions.
|
||||
|
||||
If a device crosses the 768px threshold — for example, rotating a tablet
|
||||
to landscape or resizing a window — the full desktop experience becomes
|
||||
available immediately.
|
||||
|
||||
## Notes for operators
|
||||
|
||||
- The flag is deployment-wide; there is no per-role or per-user targeting.
|
||||
- Dashboard permalinks and links shared from desktop resolve normally on
|
||||
mobile as long as they point at dashboards.
|
||||
- Embedded dashboards are unaffected: the embedded SDK controls its own
|
||||
layout, and the viewport meta tag is only interpreted by the top-level
|
||||
page.
|
||||
- Dashboards loaded with a `standalone` URL param (used for iframe embeds
|
||||
and kiosk-style displays) always render the desktop layout, regardless
|
||||
of viewport width, since the standalone chrome doesn't expose the mobile
|
||||
filter drawer's trigger.
|
||||
+4
-4
@@ -58,12 +58,12 @@
|
||||
"@fontsource/inter": "^5.3.0",
|
||||
"@mdx-js/react": "^3.1.1",
|
||||
"@saucelabs/theme-github-codeblock": "^0.3.0",
|
||||
"@storybook/addon-docs": "^10.5.6",
|
||||
"@storybook/addon-docs": "^10.5.7",
|
||||
"@superset-ui/core": "^0.20.4",
|
||||
"@swc/core": "^1.15.47",
|
||||
"antd": "^6.5.3",
|
||||
"antd": "^6.5.4",
|
||||
"baseline-browser-mapping": "^2.11.12",
|
||||
"caniuse-lite": "^1.0.30001806",
|
||||
"caniuse-lite": "^1.0.30001807",
|
||||
"docusaurus-plugin-openapi-docs": "^5.1.3",
|
||||
"docusaurus-theme-openapi-docs": "^5.1.3",
|
||||
"js-yaml": "^5.2.3",
|
||||
@@ -77,7 +77,7 @@
|
||||
"react-table": "^7.8.0",
|
||||
"remark-import-partial": "^0.0.2",
|
||||
"reselect": "^5.2.0",
|
||||
"storybook": "^10.5.6",
|
||||
"storybook": "^10.5.7",
|
||||
"swagger-ui-react": "^5.32.12",
|
||||
"swc-loader": "^0.2.7",
|
||||
"tinycolor2": "^1.4.2",
|
||||
|
||||
@@ -68,6 +68,8 @@ function getProviders() {
|
||||
const { themeObject } = require('@apache-superset/core/theme');
|
||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||
const { App, ConfigProvider } = require('antd');
|
||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||
const { useColorMode } = require('@docusaurus/theme-common');
|
||||
|
||||
// Configure Ant Design to render portals (tooltips, dropdowns, etc.)
|
||||
// inside the closest .storybook-example container instead of document.body
|
||||
@@ -78,15 +80,39 @@ function getProviders() {
|
||||
return container || document.body;
|
||||
};
|
||||
|
||||
// `themeObject` is a module-level singleton (superset-core/src/theme
|
||||
// index.tsx: `Theme.fromConfig()`), created once with no dark/light
|
||||
// config, so SupersetThemeProvider always rendered whatever that default
|
||||
// algorithm was -- it had no way to know about Docusaurus's theme toggle.
|
||||
// Docusaurus tracks the toggle in React context (useColorMode), so
|
||||
// mirror it onto the singleton via the toggleDarkMode() method Theme
|
||||
// already exposes for exactly this purpose.
|
||||
//
|
||||
// Use useLayoutEffect (not useEffect) so the sync runs before the
|
||||
// browser paints. This component only ever mounts client-side (it's
|
||||
// built inside a BrowserOnly callback), so there's no SSR mismatch
|
||||
// concern -- and running synchronously before paint avoids a brief
|
||||
// flash of the singleton's previous palette when a page loads directly
|
||||
// in dark mode or the toggle fires during route navigation.
|
||||
function ThemeSync({ children }) {
|
||||
const { colorMode } = useColorMode();
|
||||
React.useLayoutEffect(() => {
|
||||
themeObject.toggleDarkMode(colorMode === 'dark');
|
||||
}, [colorMode]);
|
||||
return children;
|
||||
}
|
||||
|
||||
SupersetProviders = ({ children }) => (
|
||||
<themeObject.SupersetThemeProvider>
|
||||
<ConfigProvider
|
||||
getPopupContainer={getPopupContainer}
|
||||
getTargetContainer={() => document.body}
|
||||
>
|
||||
<App>{children}</App>
|
||||
</ConfigProvider>
|
||||
</themeObject.SupersetThemeProvider>
|
||||
<ThemeSync>
|
||||
<themeObject.SupersetThemeProvider>
|
||||
<ConfigProvider
|
||||
getPopupContainer={getPopupContainer}
|
||||
getTargetContainer={() => document.body}
|
||||
>
|
||||
<App>{children}</App>
|
||||
</ConfigProvider>
|
||||
</themeObject.SupersetThemeProvider>
|
||||
</ThemeSync>
|
||||
);
|
||||
return SupersetProviders;
|
||||
} catch (error) {
|
||||
@@ -133,7 +159,7 @@ function LoadingPlaceholder() {
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
border: '1px solid #e8e8e8',
|
||||
border: '1px solid var(--ifm-color-emphasis-300)',
|
||||
borderRadius: '4px',
|
||||
padding: '20px',
|
||||
marginBottom: '20px',
|
||||
@@ -141,7 +167,7 @@ function LoadingPlaceholder() {
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
color: '#999',
|
||||
color: 'var(--ifm-color-emphasis-600)',
|
||||
}}
|
||||
>
|
||||
Loading component...
|
||||
@@ -162,7 +188,7 @@ export function StoryExample({ component, props = {} }) {
|
||||
<div
|
||||
className="storybook-example"
|
||||
style={{
|
||||
border: '1px solid #e8e8e8',
|
||||
border: '1px solid var(--ifm-color-emphasis-300)',
|
||||
borderRadius: '4px',
|
||||
padding: '20px',
|
||||
marginBottom: '20px',
|
||||
@@ -172,7 +198,7 @@ export function StoryExample({ component, props = {} }) {
|
||||
{Component ? (
|
||||
<Component {...restProps}>{children}</Component>
|
||||
) : (
|
||||
<div style={{ color: '#999' }}>
|
||||
<div style={{ color: 'var(--ifm-color-emphasis-600)' }}>
|
||||
Component "{String(component)}" not found
|
||||
</div>
|
||||
)}
|
||||
@@ -373,7 +399,7 @@ function StoryWithControlsInner({
|
||||
<div
|
||||
className="storybook-example"
|
||||
style={{
|
||||
border: '1px solid #e8e8e8',
|
||||
border: '1px solid var(--ifm-color-emphasis-300)',
|
||||
borderRadius: '4px',
|
||||
padding: '20px',
|
||||
marginBottom: '20px',
|
||||
@@ -393,7 +419,7 @@ function StoryWithControlsInner({
|
||||
</Component>
|
||||
</>
|
||||
) : (
|
||||
<div style={{ color: '#999' }}>
|
||||
<div style={{ color: 'var(--ifm-color-emphasis-600)' }}>
|
||||
Component "{String(componentToRender)}" not found
|
||||
</div>
|
||||
)}
|
||||
@@ -403,7 +429,7 @@ function StoryWithControlsInner({
|
||||
<div
|
||||
className="storybook-controls"
|
||||
style={{
|
||||
border: '1px solid #e8e8e8',
|
||||
border: '1px solid var(--ifm-color-emphasis-300)',
|
||||
borderRadius: '4px',
|
||||
padding: '20px',
|
||||
marginBottom: '20px',
|
||||
@@ -545,7 +571,7 @@ function ComponentGalleryInner({
|
||||
|
||||
if (!Component) {
|
||||
return (
|
||||
<div style={{ color: '#999' }}>
|
||||
<div style={{ color: 'var(--ifm-color-emphasis-600)' }}>
|
||||
Component "{String(component)}" not found
|
||||
</div>
|
||||
);
|
||||
@@ -556,7 +582,14 @@ function ComponentGalleryInner({
|
||||
<div className="component-gallery">
|
||||
{sizes.map(size => (
|
||||
<div key={size} style={{ marginBottom: 40 }}>
|
||||
<h4 style={{ marginBottom: 16, color: '#666' }}>{size}</h4>
|
||||
<h4
|
||||
style={{
|
||||
marginBottom: 16,
|
||||
color: 'var(--ifm-color-emphasis-700)',
|
||||
}}
|
||||
>
|
||||
{size}
|
||||
</h4>
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
|
||||
Vendored
+6
@@ -69,6 +69,12 @@
|
||||
"lifecycle": "development",
|
||||
"description": "Enable Matrixify feature for matrix-style chart layouts"
|
||||
},
|
||||
{
|
||||
"name": "MOBILE_CONSUMPTION_MODE",
|
||||
"default": false,
|
||||
"lifecycle": "development",
|
||||
"description": "Serve a consumption-only mobile experience (dashboards, dashboard list, and home page) on small screens; other views show a \"not supported on mobile\" screen. Authoring features are hidden on mobile when enabled."
|
||||
},
|
||||
{
|
||||
"name": "OPTIMIZE_SQL",
|
||||
"default": false,
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 67 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 81 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 57 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 34 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 35 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 42 KiB |
+26
-26
@@ -4095,23 +4095,23 @@
|
||||
resolved "https://registry.yarnpkg.com/@standard-schema/utils/-/utils-0.3.0.tgz#3d5e608f16c2390c10528e98e59aef6bf73cae7b"
|
||||
integrity sha512-e7Mew686owMaPJVNNLs55PUvgz371nKgwsc4vxE49zsODpJEnxgxRo2y/OKrqueavXgZNMDVj3DdHFlaSAeU8g==
|
||||
|
||||
"@storybook/addon-docs@^10.5.6":
|
||||
version "10.5.6"
|
||||
resolved "https://registry.yarnpkg.com/@storybook/addon-docs/-/addon-docs-10.5.6.tgz#445d4e0992a0862a22bffcea321ee2cb034846b5"
|
||||
integrity sha512-zyUJBrrpC9NTrmsREaVFNr+9WW6pikJtmRvo7GgZGqthEyhjQKSarHrW0aNWkwae2ep3jp1CZi8vIUVG1Dnp0w==
|
||||
"@storybook/addon-docs@^10.5.7":
|
||||
version "10.5.7"
|
||||
resolved "https://registry.yarnpkg.com/@storybook/addon-docs/-/addon-docs-10.5.7.tgz#6d599c94fc871c248ce06a5c081f57655c83f40a"
|
||||
integrity sha512-KNARJfjICaizinsR3INMEiipZm1ObYo+xw+E26gteu50Bcy2dIZUtk5uHY5XdtardU3AXX6yRXoBZ2HCY3lbHA==
|
||||
dependencies:
|
||||
"@mdx-js/react" "^3.0.0"
|
||||
"@storybook/csf-plugin" "10.5.6"
|
||||
"@storybook/csf-plugin" "10.5.7"
|
||||
"@storybook/icons" "^2.0.2"
|
||||
"@storybook/react-dom-shim" "10.5.6"
|
||||
"@storybook/react-dom-shim" "10.5.7"
|
||||
react "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
|
||||
react-dom "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
|
||||
ts-dedent "^2.0.0"
|
||||
|
||||
"@storybook/csf-plugin@10.5.6":
|
||||
version "10.5.6"
|
||||
resolved "https://registry.yarnpkg.com/@storybook/csf-plugin/-/csf-plugin-10.5.6.tgz#9fca28f5fd7d545a32638bb4f08902f6887072b2"
|
||||
integrity sha512-PJLyOmcKe1OZDBw7RaGX/gjuiJuVfS5pVgc4W2RnHYOFpU6F5Bv9+9MqQwp0i7tWZBWc4fsCJudgVqwgjuTROA==
|
||||
"@storybook/csf-plugin@10.5.7":
|
||||
version "10.5.7"
|
||||
resolved "https://registry.yarnpkg.com/@storybook/csf-plugin/-/csf-plugin-10.5.7.tgz#bc73f164d1b5f8e2931b2774f4b389a06453cf6e"
|
||||
integrity sha512-IaX8FlM0H36HNFhJ2+4L9bCldqfvHGqcLg841SJNyK/DhfMlM7JsvY/GDH2ZFuWrUf8FSOx96GRRnHq6XfRKag==
|
||||
dependencies:
|
||||
unplugin "^2.3.5"
|
||||
|
||||
@@ -4125,10 +4125,10 @@
|
||||
resolved "https://registry.yarnpkg.com/@storybook/icons/-/icons-2.1.0.tgz#edfc2450a39c5e780f28c6cbc49acd7bff59b41a"
|
||||
integrity sha512-Fxh9vYpX9bQqFeHRiY8h2ApeRGDzRSMLwJwNZ/AIRqnyOKHxRKL+yFe+ctEkVJmuptRE9u1Hrn8ZZNHyfDKKNg==
|
||||
|
||||
"@storybook/react-dom-shim@10.5.6":
|
||||
version "10.5.6"
|
||||
resolved "https://registry.yarnpkg.com/@storybook/react-dom-shim/-/react-dom-shim-10.5.6.tgz#3685605c9dd27298fada7fef264801b2e7d62cbb"
|
||||
integrity sha512-dV3oOHc5ImggxEqeIiUj4vvnQO5SKScFtqAkxgIWLju1wiSZSIqQ5Q4Mp12Rhs9hQrjF039DueH7f2xJJZfvSw==
|
||||
"@storybook/react-dom-shim@10.5.7":
|
||||
version "10.5.7"
|
||||
resolved "https://registry.yarnpkg.com/@storybook/react-dom-shim/-/react-dom-shim-10.5.7.tgz#9a5aa0e0f89c09e71c6cbfc6bb1abeb537e5aabf"
|
||||
integrity sha512-lxOkyh+wu/MiBXvYQHjZfD+DRKOa4bHBzbuGuiHXnHXmdOcTRdcrQTsoeN2FPtfugmmOG66cZUEgDwNX+k5eRA==
|
||||
|
||||
"@superset-ui/core@^0.20.4":
|
||||
version "0.20.4"
|
||||
@@ -6164,10 +6164,10 @@ ansis@^3.2.0:
|
||||
resolved "https://registry.yarnpkg.com/ansis/-/ansis-3.17.0.tgz#fa8d9c2a93fe7d1177e0c17f9eeb562a58a832d7"
|
||||
integrity sha512-0qWUglt9JEqLFr3w1I1pbrChn1grhaiAR2ocX1PP/flRmxgtwTzPFFFnfIlD6aMOLQZgSuCRlidD70lvx8yhzg==
|
||||
|
||||
antd@^6.5.3:
|
||||
version "6.5.3"
|
||||
resolved "https://registry.yarnpkg.com/antd/-/antd-6.5.3.tgz#3c7d2ec4a20be116f72b7fbbdb4497d65ffd6dae"
|
||||
integrity sha512-Q5r8sztf9Yk9B70bSUjnPYMCJ4A/eZM7uMoTj8UAhlSKR9aftjEuBEPcNSmRux7hB+87rxO8vN1X4HNjR97qyQ==
|
||||
antd@^6.5.4:
|
||||
version "6.5.4"
|
||||
resolved "https://registry.yarnpkg.com/antd/-/antd-6.5.4.tgz#b41665e86a5f46ca761abd3b0abef7460116ca0d"
|
||||
integrity sha512-jchA6i0rEwHjLpgC+l6HeLHP0gL4Q4yjs6Mxqt6PlhGD5ArxCj3ZH+fKFbNquCtd6Rlzzi+emfNFpP2dGLwZzg==
|
||||
dependencies:
|
||||
"@ant-design/colors" "^8.0.1"
|
||||
"@ant-design/cssinjs" "^2.1.2"
|
||||
@@ -6745,10 +6745,10 @@ caniuse-api@^3.0.0:
|
||||
lodash.memoize "^4.1.2"
|
||||
lodash.uniq "^4.5.0"
|
||||
|
||||
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001799, caniuse-lite@^1.0.30001806:
|
||||
version "1.0.30001806"
|
||||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001806.tgz#1bc8e502b723fa393455dfbedd5ccec0c29bb74e"
|
||||
integrity sha512-72Cuvd95zbSYPKq6Fhg8eDJRlzgWDf7/mtoZv6Qe/DYNCEBdNxoA3+rZAU2ZhGCpZlns3EssFavaZomckT5Uuw==
|
||||
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001799, caniuse-lite@^1.0.30001807:
|
||||
version "1.0.30001807"
|
||||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001807.tgz#a113854941fb45b4c1f51793f4636920489079b4"
|
||||
integrity sha512-daRXJ9EB/rdRgu7kV+TTl1YUKtlsMWblPl2sLnpg9DZae16QCegol6A1SmCE31Lm9mXC1sRWGt/krouH+/dl7Q==
|
||||
|
||||
ccount@^2.0.0:
|
||||
version "2.0.1"
|
||||
@@ -14765,10 +14765,10 @@ stop-iteration-iterator@^1.1.0:
|
||||
es-errors "^1.3.0"
|
||||
internal-slot "^1.1.0"
|
||||
|
||||
storybook@^10.5.6:
|
||||
version "10.5.6"
|
||||
resolved "https://registry.yarnpkg.com/storybook/-/storybook-10.5.6.tgz#c91f22f617f3718dd06c58c87b46ff66f4ce7bf5"
|
||||
integrity sha512-VhYwqxPySa24CVXKoWD6gCZXx9//DTmo43YpusGuAoHDYj5Osjt8wuBRQVeGoaLUWnHiPWv8S+GYHrJEaBM6Rg==
|
||||
storybook@^10.5.7:
|
||||
version "10.5.7"
|
||||
resolved "https://registry.yarnpkg.com/storybook/-/storybook-10.5.7.tgz#adfc465e51f337291c095278c23f1b8024ef2da7"
|
||||
integrity sha512-oiKvWIwIoOhFP1i6dASYyMXwPHKEtVZMshqSB7EvIVYjWRh0l9H7gHEt1z4Gh2rLGFMekWdsm4s94rvwpR7gkg==
|
||||
dependencies:
|
||||
"@storybook/global" "^5.0.0"
|
||||
"@storybook/icons" "^2.0.2"
|
||||
|
||||
@@ -29,7 +29,7 @@ maintainers:
|
||||
- name: craig-rueda
|
||||
email: craig@craigrueda.com
|
||||
url: https://github.com/craig-rueda
|
||||
version: 0.22.5 # See [README](https://github.com/apache/superset/blob/master/helm/superset/README.md#versioning) for version details.
|
||||
version: 0.22.6 # See [README](https://github.com/apache/superset/blob/master/helm/superset/README.md#versioning) for version details.
|
||||
dependencies:
|
||||
- name: postgresql
|
||||
version: 16.7.27
|
||||
|
||||
+14
-14
@@ -23,7 +23,7 @@ NOTE: This file is generated by helm-docs: https://github.com/norwoodj/helm-docs
|
||||
|
||||
# superset
|
||||
|
||||

|
||||

|
||||
|
||||
Apache Superset is a modern, enterprise-ready business intelligence web application
|
||||
|
||||
@@ -205,9 +205,9 @@ Alternatively, perform a fresh install. This is a one-time migration; subsequent
|
||||
| supersetCeleryBeat.forceReload | bool | `false` | If true, forces deployment to reload on each upgrade |
|
||||
| supersetCeleryBeat.initContainers | list | a container waiting for postgres | List of init containers |
|
||||
| supersetCeleryBeat.podAnnotations | object | `{}` | Annotations to be added to supersetCeleryBeat pods |
|
||||
| supersetCeleryBeat.podDisruptionBudget | object | `{"enabled":false,"maxUnavailable":1,"minAvailable":1}` | Sets the [pod disruption budget](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) for supersetCeleryBeat pods |
|
||||
| supersetCeleryBeat.podDisruptionBudget | object | `{"enabled":false,"maxUnavailable":null,"minAvailable":1}` | Sets the [pod disruption budget](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) for supersetCeleryBeat pods |
|
||||
| supersetCeleryBeat.podDisruptionBudget.enabled | bool | `false` | Whether the pod disruption budget should be created |
|
||||
| supersetCeleryBeat.podDisruptionBudget.maxUnavailable | int | `1` | If set, minAvailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget |
|
||||
| supersetCeleryBeat.podDisruptionBudget.maxUnavailable | string | `nil` | If set, minAvailable must be unset (`minAvailable: ~`) - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget |
|
||||
| supersetCeleryBeat.podDisruptionBudget.minAvailable | int | `1` | If set, maxUnavailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget |
|
||||
| supersetCeleryBeat.podLabels | object | `{}` | Labels to be added to supersetCeleryBeat pods |
|
||||
| supersetCeleryBeat.podSecurityContext | object | `{}` | |
|
||||
@@ -231,9 +231,9 @@ Alternatively, perform a fresh install. This is a one-time migration; subsequent
|
||||
| supersetCeleryFlower.livenessProbe.successThreshold | int | `1` | |
|
||||
| supersetCeleryFlower.livenessProbe.timeoutSeconds | int | `1` | |
|
||||
| supersetCeleryFlower.podAnnotations | object | `{}` | Annotations to be added to supersetCeleryFlower pods |
|
||||
| supersetCeleryFlower.podDisruptionBudget | object | `{"enabled":false,"maxUnavailable":1,"minAvailable":1}` | Sets the [pod disruption budget](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) for supersetCeleryFlower pods |
|
||||
| supersetCeleryFlower.podDisruptionBudget | object | `{"enabled":false,"maxUnavailable":null,"minAvailable":1}` | Sets the [pod disruption budget](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) for supersetCeleryFlower pods |
|
||||
| supersetCeleryFlower.podDisruptionBudget.enabled | bool | `false` | Whether the pod disruption budget should be created |
|
||||
| supersetCeleryFlower.podDisruptionBudget.maxUnavailable | int | `1` | If set, minAvailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget |
|
||||
| supersetCeleryFlower.podDisruptionBudget.maxUnavailable | string | `nil` | If set, minAvailable must be unset (`minAvailable: ~`) - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget |
|
||||
| supersetCeleryFlower.podDisruptionBudget.minAvailable | int | `1` | If set, maxUnavailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget |
|
||||
| supersetCeleryFlower.podLabels | object | `{}` | Labels to be added to supersetCeleryFlower pods |
|
||||
| supersetCeleryFlower.podSecurityContext | object | `{}` | |
|
||||
@@ -285,10 +285,10 @@ Alternatively, perform a fresh install. This is a one-time migration; subsequent
|
||||
| supersetMcp.livenessProbe.successThreshold | int | `1` | |
|
||||
| supersetMcp.livenessProbe.timeoutSeconds | int | `3` | |
|
||||
| supersetMcp.podAnnotations | object | `{}` | Annotations to be added to supersetMcp pods |
|
||||
| supersetMcp.podDisruptionBudget | object | `{"enabled":false,"maxUnavailable":1,"minAvailable":1}` | Sets the [pod disruption budget](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) for supersetMcp pods |
|
||||
| supersetMcp.podDisruptionBudget | object | `{"enabled":false,"maxUnavailable":null,"minAvailable":1}` | Sets the [pod disruption budget](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) for supersetMcp pods |
|
||||
| supersetMcp.podDisruptionBudget.enabled | bool | `false` | Whether the pod disruption budget should be created |
|
||||
| supersetMcp.podDisruptionBudget.maxUnavailable | int | `1` | If set, minAvailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/\#specifying-a-poddisruptionbudget |
|
||||
| supersetMcp.podDisruptionBudget.minAvailable | int | `1` | If set, maxUnavailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/\#specifying-a-poddisruptionbudget |
|
||||
| supersetMcp.podDisruptionBudget.maxUnavailable | string | `nil` | If set, minAvailable must be unset (`minAvailable: ~`) - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget |
|
||||
| supersetMcp.podDisruptionBudget.minAvailable | int | `1` | If set, maxUnavailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget |
|
||||
| supersetMcp.podLabels | object | `{}` | Labels to be added to supersetMcp pods |
|
||||
| supersetMcp.podSecurityContext | object | `{}` | |
|
||||
| supersetMcp.priorityClassName | string | `nil` | Set priorityClassName for supersetMcp pods |
|
||||
@@ -341,9 +341,9 @@ Alternatively, perform a fresh install. This is a one-time migration; subsequent
|
||||
| supersetNode.livenessProbe.successThreshold | int | `1` | |
|
||||
| supersetNode.livenessProbe.timeoutSeconds | int | `1` | |
|
||||
| supersetNode.podAnnotations | object | `{}` | Annotations to be added to supersetNode pods |
|
||||
| supersetNode.podDisruptionBudget | object | `{"enabled":false,"maxUnavailable":1,"minAvailable":1}` | Sets the [pod disruption budget](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) for supersetNode pods |
|
||||
| supersetNode.podDisruptionBudget | object | `{"enabled":false,"maxUnavailable":null,"minAvailable":1}` | Sets the [pod disruption budget](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) for supersetNode pods |
|
||||
| supersetNode.podDisruptionBudget.enabled | bool | `false` | Whether the pod disruption budget should be created |
|
||||
| supersetNode.podDisruptionBudget.maxUnavailable | int | `1` | If set, minAvailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget |
|
||||
| supersetNode.podDisruptionBudget.maxUnavailable | string | `nil` | If set, minAvailable must be unset (`minAvailable: ~`) - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget |
|
||||
| supersetNode.podDisruptionBudget.minAvailable | int | `1` | If set, maxUnavailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget |
|
||||
| supersetNode.podLabels | object | `{}` | Labels to be added to supersetNode pods |
|
||||
| supersetNode.podSecurityContext | object | `{}` | |
|
||||
@@ -391,9 +391,9 @@ Alternatively, perform a fresh install. This is a one-time migration; subsequent
|
||||
| supersetWebsockets.livenessProbe.successThreshold | int | `1` | |
|
||||
| supersetWebsockets.livenessProbe.timeoutSeconds | int | `1` | |
|
||||
| supersetWebsockets.podAnnotations | object | `{}` | |
|
||||
| supersetWebsockets.podDisruptionBudget | object | `{"enabled":false,"maxUnavailable":1,"minAvailable":1}` | Sets the [pod disruption budget](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) for supersetWebsockets pods |
|
||||
| supersetWebsockets.podDisruptionBudget | object | `{"enabled":false,"maxUnavailable":null,"minAvailable":1}` | Sets the [pod disruption budget](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) for supersetWebsockets pods |
|
||||
| supersetWebsockets.podDisruptionBudget.enabled | bool | `false` | Whether the pod disruption budget should be created |
|
||||
| supersetWebsockets.podDisruptionBudget.maxUnavailable | int | `1` | If set, minAvailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget |
|
||||
| supersetWebsockets.podDisruptionBudget.maxUnavailable | string | `nil` | If set, minAvailable must be unset (`minAvailable: ~`) - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget |
|
||||
| supersetWebsockets.podDisruptionBudget.minAvailable | int | `1` | If set, maxUnavailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget |
|
||||
| supersetWebsockets.podLabels | object | `{}` | |
|
||||
| supersetWebsockets.podSecurityContext | object | `{}` | |
|
||||
@@ -448,9 +448,9 @@ Alternatively, perform a fresh install. This is a one-time migration; subsequent
|
||||
| supersetWorker.livenessProbe.successThreshold | int | `1` | |
|
||||
| supersetWorker.livenessProbe.timeoutSeconds | int | `60` | |
|
||||
| supersetWorker.podAnnotations | object | `{}` | Annotations to be added to supersetWorker pods |
|
||||
| supersetWorker.podDisruptionBudget | object | `{"enabled":false,"maxUnavailable":1,"minAvailable":1}` | Sets the [pod disruption budget](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) for supersetWorker pods |
|
||||
| supersetWorker.podDisruptionBudget | object | `{"enabled":false,"maxUnavailable":null,"minAvailable":1}` | Sets the [pod disruption budget](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) for supersetWorker pods |
|
||||
| supersetWorker.podDisruptionBudget.enabled | bool | `false` | Whether the pod disruption budget should be created |
|
||||
| supersetWorker.podDisruptionBudget.maxUnavailable | int | `1` | If set, minAvailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget |
|
||||
| supersetWorker.podDisruptionBudget.maxUnavailable | string | `nil` | If set, minAvailable must be unset (`minAvailable: ~`) - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget |
|
||||
| supersetWorker.podDisruptionBudget.minAvailable | int | `1` | If set, maxUnavailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget |
|
||||
| supersetWorker.podLabels | object | `{}` | Labels to be added to supersetWorker pods |
|
||||
| supersetWorker.podSecurityContext | object | `{}` | |
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
{{- with .Values.supersetCeleryBeat.podDisruptionBudget }}
|
||||
{{- if .enabled -}}
|
||||
{{- if and .minAvailable .maxUnavailable }}
|
||||
{{- fail "Only one of minAvailable or maxUnavailable should be set" }}
|
||||
{{- fail "supersetCeleryBeat.podDisruptionBudget: only one of minAvailable or maxUnavailable should be set - unset the other one (set it to null)" }}
|
||||
{{- end}}
|
||||
apiVersion: policy/v1
|
||||
kind: PodDisruptionBudget
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
{{- with .Values.supersetCeleryFlower.podDisruptionBudget }}
|
||||
{{- if .enabled -}}
|
||||
{{- if and .minAvailable .maxUnavailable }}
|
||||
{{- fail "Only one of minAvailable or maxUnavailable should be set" }}
|
||||
{{- fail "supersetCeleryFlower.podDisruptionBudget: only one of minAvailable or maxUnavailable should be set - unset the other one (set it to null)" }}
|
||||
{{- end}}
|
||||
apiVersion: policy/v1
|
||||
kind: PodDisruptionBudget
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
{{- with .Values.supersetMcp.podDisruptionBudget }}
|
||||
{{- if .enabled -}}
|
||||
{{- if and .minAvailable .maxUnavailable }}
|
||||
{{- fail "Only one of minAvailable or maxUnavailable should be set" }}
|
||||
{{- fail "supersetMcp.podDisruptionBudget: only one of minAvailable or maxUnavailable should be set - unset the other one (set it to null)" }}
|
||||
{{- end}}
|
||||
apiVersion: policy/v1
|
||||
kind: PodDisruptionBudget
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
{{- with .Values.supersetWorker.podDisruptionBudget }}
|
||||
{{- if .enabled -}}
|
||||
{{- if and .minAvailable .maxUnavailable }}
|
||||
{{- fail "Only one of minAvailable or maxUnavailable should be set" }}
|
||||
{{- fail "supersetWorker.podDisruptionBudget: only one of minAvailable or maxUnavailable should be set - unset the other one (set it to null)" }}
|
||||
{{- end}}
|
||||
apiVersion: policy/v1
|
||||
kind: PodDisruptionBudget
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
{{- with .Values.supersetWebsockets.podDisruptionBudget }}
|
||||
{{- if .enabled -}}
|
||||
{{- if and .minAvailable .maxUnavailable }}
|
||||
{{- fail "Only one of minAvailable or maxUnavailable should be set" }}
|
||||
{{- fail "supersetWebsockets.podDisruptionBudget: only one of minAvailable or maxUnavailable should be set - unset the other one (set it to null)" }}
|
||||
{{- end}}
|
||||
apiVersion: policy/v1
|
||||
kind: PodDisruptionBudget
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
{{- with .Values.supersetNode.podDisruptionBudget }}
|
||||
{{- if .enabled -}}
|
||||
{{- if and .minAvailable .maxUnavailable }}
|
||||
{{- fail "Only one of minAvailable or maxUnavailable should be set" }}
|
||||
{{- fail "supersetNode.podDisruptionBudget: only one of minAvailable or maxUnavailable should be set - unset the other one (set it to null)" }}
|
||||
{{- end}}
|
||||
apiVersion: policy/v1
|
||||
kind: PodDisruptionBudget
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
# contributor license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright ownership.
|
||||
# The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
# (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
suite: pod disruption budgets
|
||||
templates:
|
||||
- pdb.yaml
|
||||
- pdb-worker.yaml
|
||||
- pdb-beat.yaml
|
||||
- pdb-flower.yaml
|
||||
- pdb-ws.yaml
|
||||
- pdb-mcp.yaml
|
||||
|
||||
# The chart must not ship conflicting minAvailable/maxUnavailable defaults: enabling a
|
||||
# PDB with `enabled: true` alone has to render, since Helm merges user values on top of
|
||||
# the chart defaults and the templates fail when both fields are set.
|
||||
tests:
|
||||
- it: renders no PDB by default
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 0
|
||||
|
||||
- it: renders with minAvailable only when just enabled is set
|
||||
set:
|
||||
supersetNode.podDisruptionBudget.enabled: true
|
||||
supersetWorker.podDisruptionBudget.enabled: true
|
||||
supersetCeleryBeat.podDisruptionBudget.enabled: true
|
||||
supersetCeleryFlower.podDisruptionBudget.enabled: true
|
||||
supersetWebsockets.podDisruptionBudget.enabled: true
|
||||
supersetMcp.podDisruptionBudget.enabled: true
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 1
|
||||
- isKind:
|
||||
of: PodDisruptionBudget
|
||||
- equal:
|
||||
path: spec.minAvailable
|
||||
value: 1
|
||||
- notExists:
|
||||
path: spec.maxUnavailable
|
||||
|
||||
- it: honors an overridden minAvailable
|
||||
template: pdb.yaml
|
||||
set:
|
||||
supersetNode.podDisruptionBudget.enabled: true
|
||||
supersetNode.podDisruptionBudget.minAvailable: 2
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.minAvailable
|
||||
value: 2
|
||||
- notExists:
|
||||
path: spec.maxUnavailable
|
||||
|
||||
- it: honors maxUnavailable when minAvailable is unset
|
||||
template: pdb-worker.yaml
|
||||
set:
|
||||
supersetWorker.podDisruptionBudget.enabled: true
|
||||
supersetWorker.podDisruptionBudget.minAvailable: null
|
||||
supersetWorker.podDisruptionBudget.maxUnavailable: 1
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.maxUnavailable
|
||||
value: 1
|
||||
- notExists:
|
||||
path: spec.minAvailable
|
||||
|
||||
- it: fails when both minAvailable and maxUnavailable are set explicitly
|
||||
template: pdb.yaml
|
||||
set:
|
||||
supersetNode.podDisruptionBudget.enabled: true
|
||||
supersetNode.podDisruptionBudget.minAvailable: 1
|
||||
supersetNode.podDisruptionBudget.maxUnavailable: 1
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: "supersetNode.podDisruptionBudget: only one of minAvailable or maxUnavailable should be set - unset the other one (set it to null)"
|
||||
+13
-13
@@ -410,8 +410,8 @@ supersetNode:
|
||||
enabled: false
|
||||
# -- If set, maxUnavailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget
|
||||
minAvailable: 1
|
||||
# -- If set, minAvailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget
|
||||
maxUnavailable: 1
|
||||
# -- If set, minAvailable must be unset (`minAvailable: ~`) - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget
|
||||
maxUnavailable: ~
|
||||
|
||||
# -- Startup command
|
||||
# @default -- See `values.yaml`
|
||||
@@ -542,8 +542,8 @@ supersetWorker:
|
||||
enabled: false
|
||||
# -- If set, maxUnavailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget
|
||||
minAvailable: 1
|
||||
# -- If set, minAvailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget
|
||||
maxUnavailable: 1
|
||||
# -- If set, minAvailable must be unset (`minAvailable: ~`) - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget
|
||||
maxUnavailable: ~
|
||||
# -- Worker startup command
|
||||
# @default -- a `celery worker` command
|
||||
command:
|
||||
@@ -665,8 +665,8 @@ supersetCeleryBeat:
|
||||
enabled: false
|
||||
# -- If set, maxUnavailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget
|
||||
minAvailable: 1
|
||||
# -- If set, minAvailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget
|
||||
maxUnavailable: 1
|
||||
# -- If set, minAvailable must be unset (`minAvailable: ~`) - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget
|
||||
maxUnavailable: ~
|
||||
# -- Command
|
||||
# @default -- a `celery beat` command
|
||||
command:
|
||||
@@ -751,8 +751,8 @@ supersetCeleryFlower:
|
||||
enabled: false
|
||||
# -- If set, maxUnavailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget
|
||||
minAvailable: 1
|
||||
# -- If set, minAvailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget
|
||||
maxUnavailable: 1
|
||||
# -- If set, minAvailable must be unset (`minAvailable: ~`) - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget
|
||||
maxUnavailable: ~
|
||||
# -- Command
|
||||
# @default -- a `celery flower` command
|
||||
command:
|
||||
@@ -869,8 +869,8 @@ supersetWebsockets:
|
||||
enabled: false
|
||||
# -- If set, maxUnavailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget
|
||||
minAvailable: 1
|
||||
# -- If set, minAvailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget
|
||||
maxUnavailable: 1
|
||||
# -- If set, minAvailable must be unset (`minAvailable: ~`) - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget
|
||||
maxUnavailable: ~
|
||||
ingress:
|
||||
path: /ws
|
||||
pathType: Prefix
|
||||
@@ -999,10 +999,10 @@ supersetMcp:
|
||||
podDisruptionBudget:
|
||||
# -- Whether the pod disruption budget should be created
|
||||
enabled: false
|
||||
# -- If set, maxUnavailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/\#specifying-a-poddisruptionbudget
|
||||
# -- If set, maxUnavailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget
|
||||
minAvailable: 1
|
||||
# -- If set, minAvailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/\#specifying-a-poddisruptionbudget
|
||||
maxUnavailable: 1
|
||||
# -- If set, minAvailable must be unset (`minAvailable: ~`) - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget
|
||||
maxUnavailable: ~
|
||||
# -- Command
|
||||
# @default -- a `superset mcp run` command
|
||||
command:
|
||||
|
||||
+23
-30
@@ -60,15 +60,11 @@ dependencies = [
|
||||
"flask-login>=0.6.0, < 1.0",
|
||||
"flask-migrate>=4.1.0, <5.0",
|
||||
"flask-session>=0.4.0, <1.0",
|
||||
# Pinned explicitly below 3.0: 3.0.5 resolves without conflict and
|
||||
# supports both SQLAlchemy 1.4 and 2.0, but real CI runs surfaced a
|
||||
# structural incompatibility with Superset's current session/app-context
|
||||
# handling across Celery task boundaries (see PR #42542) -- widespread
|
||||
# "NoneType has no attribute X" failures and MySQL lock-wait timeouts,
|
||||
# not just a connection-pool quirk. Needs dedicated investigation, not a
|
||||
# driver-compat-prep bump; revisit alongside the actual SQLAlchemy 2.0
|
||||
# core bump (discussion #40273, step 6).
|
||||
"flask-sqlalchemy>=2.5.1, <4.0",
|
||||
# Bumped to 3.1.1 alongside the SQLAlchemy 2.0 core bump (discussion
|
||||
# #40273, step 6), which resolves the session/app-context handling
|
||||
# across Celery task boundaries that previously blocked this (see
|
||||
# PR #42542).
|
||||
"flask-sqlalchemy>=3.1.1, <4.0",
|
||||
"flask-wtf>=1.3.0, <2.0",
|
||||
"geopy",
|
||||
"greenlet<=3.5.4, >=3.5.4",
|
||||
@@ -115,7 +111,7 @@ dependencies = [
|
||||
"sshtunnel>=0.4.0, <0.5",
|
||||
"simplejson>=4.1.1",
|
||||
"slack_sdk>=3.43.0, <4",
|
||||
"sqlalchemy>=1.4.43, <2", # 1.4.43 adds the python-oracledb (oracle+oracledb) dialect
|
||||
"sqlalchemy>=2.0.0, <2.1",
|
||||
"sqlalchemy-continuum>=1.6.0, <2.0.0",
|
||||
"sqlalchemy-utils>=0.42.1, <0.43", # expanding lowerbound to work with pydoris
|
||||
"sqlglot>=30.16.0, <31", # 30.16.0 adds Trino inline UDF IF/CASE routine statement parsing
|
||||
@@ -164,11 +160,10 @@ databricks = [
|
||||
datafusion = ["flightsql-dbapi>=0.2.2, <0.3"]
|
||||
db2 = ["ibm-db-sa<=0.4.4, >=0.4.4"]
|
||||
denodo = ["denodo-sqlalchemy>=2.0.5,<2.1.0"]
|
||||
# sqlalchemy-dremio 3.0.5+ hard-pins sqlalchemy~=2.0.41, dropping 1.4; 3.0.4
|
||||
# is the last dual-compat release. Capped below 3.0.5 for now; widen back to
|
||||
# <4 in lockstep with Superset's own SQLAlchemy 2.0 core bump (discussion
|
||||
# #40273), not before.
|
||||
dremio = ["sqlalchemy-dremio>=1.2.1, <3.0.5"]
|
||||
# sqlalchemy-dremio 3.0.5+ hard-pins sqlalchemy~=2.0.41, dropping 1.4.
|
||||
# Widened now that Superset's own SQLAlchemy 2.0 core bump has landed
|
||||
# (discussion #40273).
|
||||
dremio = ["sqlalchemy-dremio>=3.0.5, <4"]
|
||||
# <2 was an artificial ceiling; upstream has no SQLAlchemy version cap and
|
||||
# 1.1.10 already supports SQLAlchemy 2.0 (added `import_dbapi` in 1.1.7).
|
||||
drill = ["sqlalchemy-drill>=1.1.10, <3"]
|
||||
@@ -181,10 +176,9 @@ dynamodb = ["pydynamodb>=0.8.2"]
|
||||
solr = ["sqlalchemy-solr>=0.2.4.3"]
|
||||
elasticsearch = ["elasticsearch-dbapi>=0.2.13, <0.3.0"]
|
||||
# sqlalchemy-exasol cuts hard from SQLAlchemy 1.4-only (<6.0.0) to 2.0-only
|
||||
# (>=6.0.0) with no dual-compat release. Capped below 6.0.0 for now; bump to
|
||||
# >=6.0.0,<8.0 in lockstep with Superset's own SQLAlchemy 2.0 core bump
|
||||
# (discussion #40273), not before.
|
||||
exasol = ["sqlalchemy-exasol>=2.4.0, <6.0.0"]
|
||||
# (>=6.0.0) with no dual-compat release. Bumped now that Superset's own
|
||||
# SQLAlchemy 2.0 core bump has landed (discussion #40273).
|
||||
exasol = ["sqlalchemy-exasol>=6.0.0, <8.0"]
|
||||
excel = ["xlrd>=2.0.2, <2.1"]
|
||||
# Async dashboard "Export Data/Images to Excel": uploads the workbook to S3 and
|
||||
# emails a pre-signed link. boto3 is imported lazily by superset.utils.s3, so
|
||||
@@ -199,9 +193,9 @@ fastmcp = [
|
||||
]
|
||||
# sqlalchemy-firebird >=2.0.0 unconditionally requires SQLAlchemy 2.0 on
|
||||
# Python >=3.8 (which covers Superset's >=3.11 floor), with no dual-compat
|
||||
# release. Capped below 2.0.0 for now; bump to >=2.2.0 in lockstep with
|
||||
# Superset's own SQLAlchemy 2.0 core bump (discussion #40273), not before.
|
||||
firebird = ["sqlalchemy-firebird>=0.8.0, <2.0.0"]
|
||||
# release. Bumped now that Superset's own SQLAlchemy 2.0 core bump has
|
||||
# landed (discussion #40273).
|
||||
firebird = ["sqlalchemy-firebird>=2.2.0"]
|
||||
firebolt = ["firebolt-sqlalchemy>=1.1.2, <2"]
|
||||
gevent = ["gevent>=26.7.0"]
|
||||
gsheets = ["shillelagh[gsheetsapi]>=1.4.5, <2"]
|
||||
@@ -240,15 +234,14 @@ presto = ["pyhive[presto]>=0.6.5"]
|
||||
trino = ["trino>=0.338.0"]
|
||||
prophet = ["prophet>=1.3.0, <2"]
|
||||
# sqlalchemy-redshift cuts hard from SQLAlchemy 1.4-only (0.8.x) to 2.0-only
|
||||
# (>=1.0.0) with no dual-compat release; the existing <0.9 ceiling already
|
||||
# keeps this on the 1.4-only line. Bump to >=1.0.0 in lockstep with
|
||||
# Superset's own SQLAlchemy 2.0 core bump (discussion #40273), not before.
|
||||
redshift = ["sqlalchemy-redshift>=0.8.1, <0.9"]
|
||||
# (>=1.0.0) with no dual-compat release. Bumped now that Superset's own
|
||||
# SQLAlchemy 2.0 core bump has landed (discussion #40273).
|
||||
redshift = ["sqlalchemy-redshift>=1.0.0"]
|
||||
# No release of sqlalchemy-risingwave has ever supported both SQLAlchemy 1.4
|
||||
# and 2.0 (version numbers don't track SQLAlchemy compat monotonically); pin
|
||||
# to the newest 1.4-only release for now. Bump to >=2.0.0 in lockstep with
|
||||
# Superset's own SQLAlchemy 2.0 core bump (discussion #40273), not before.
|
||||
risingwave = ["sqlalchemy-risingwave>=1.4.1, <3.0.0"]
|
||||
# and 2.0 (version numbers don't track SQLAlchemy compat monotonically).
|
||||
# Bumped to the 2.0-only line now that Superset's own SQLAlchemy 2.0 core
|
||||
# bump has landed (discussion #40273).
|
||||
risingwave = ["sqlalchemy-risingwave>=2.0.0"]
|
||||
shillelagh = ["shillelagh[all]>=1.4.5, <2"]
|
||||
singlestore = ["sqlalchemy-singlestoredb>=1.2.1, <2"]
|
||||
snowflake = ["snowflake-sqlalchemy>=1.11.0, <2"]
|
||||
|
||||
-20
@@ -23,25 +23,5 @@ python_files = *_test.py test_*.py *_tests.py *viz/utils.py
|
||||
asyncio_mode = auto
|
||||
|
||||
# `ignore` is effectively equivalent to `-p no:warnings`.
|
||||
# Always print RemovedIn20Warning when SQLALCHEMY_WARN_20=1.
|
||||
# Additionally, raise errors for refactored RemovedIn20Warning cases to prevent regression.
|
||||
filterwarnings =
|
||||
ignore
|
||||
always::sqlalchemy.exc.RemovedIn20Warning
|
||||
error:Passing a string to Connection.execute\(\) is deprecated:sqlalchemy.exc.RemovedIn20Warning
|
||||
error:"Query" object is being merged into a Session:sqlalchemy.exc.RemovedIn20Warning
|
||||
error:"ReportExecutionLog" object is being merged into a Session:sqlalchemy.exc.RemovedIn20Warning
|
||||
error:"ReportRecipients" object is being merged into a Session:sqlalchemy.exc.RemovedIn20Warning
|
||||
error:"SavedQuery" object is being merged into a Session:sqlalchemy.exc.RemovedIn20Warning
|
||||
error:"SqlaTable" object is being merged into a Session:sqlalchemy.exc.RemovedIn20Warning
|
||||
error:"SqlMetric" object is being merged into a Session:sqlalchemy.exc.RemovedIn20Warning
|
||||
error:"SSHTunnel" object is being merged into a Session:sqlalchemy.exc.RemovedIn20Warning
|
||||
error:"TableColumn" object is being merged into a Session:sqlalchemy.exc.RemovedIn20Warning
|
||||
error:"TaggedObject" object is being merged into a Session:sqlalchemy.exc.RemovedIn20Warning
|
||||
error:The autoload parameter is deprecated:sqlalchemy.exc.RemovedIn20Warning
|
||||
error:The connection.execute\(\) method:sqlalchemy.exc.RemovedIn20Warning
|
||||
error:The current statement is being autocommitted using implicit autocommit:sqlalchemy.exc.RemovedIn20Warning
|
||||
error:The ``declarative_base\(\)`` function is now available:sqlalchemy.exc.RemovedIn20Warning
|
||||
error:The Engine.execute\(\) method is considered legacy:sqlalchemy.exc.RemovedIn20Warning
|
||||
error:The legacy calling style of select\(\) is deprecated:sqlalchemy.exc.RemovedIn20Warning
|
||||
error:The "whens" argument to case:sqlalchemy.exc.RemovedIn20Warning
|
||||
|
||||
@@ -144,7 +144,7 @@ flask-migrate==4.1.0
|
||||
# via apache-superset (pyproject.toml)
|
||||
flask-session==0.8.0
|
||||
# via apache-superset (pyproject.toml)
|
||||
flask-sqlalchemy==2.5.1
|
||||
flask-sqlalchemy==3.1.1
|
||||
# via
|
||||
# apache-superset (pyproject.toml)
|
||||
# flask-appbuilder
|
||||
@@ -381,7 +381,7 @@ six==1.17.0
|
||||
# wtforms-json
|
||||
slack-sdk==3.43.0
|
||||
# via apache-superset (pyproject.toml)
|
||||
sqlalchemy==1.4.54
|
||||
sqlalchemy==2.0.51
|
||||
# via
|
||||
# apache-superset (pyproject.toml)
|
||||
# alembic
|
||||
@@ -419,6 +419,7 @@ typing-extensions==4.16.0
|
||||
# pyopenssl
|
||||
# referencing
|
||||
# shillelagh
|
||||
# sqlalchemy
|
||||
# typing-inspection
|
||||
typing-inspection==0.4.2
|
||||
# via pydantic
|
||||
|
||||
@@ -306,7 +306,7 @@ flask-session==0.8.0
|
||||
# via
|
||||
# -c requirements/base-constraint.txt
|
||||
# apache-superset
|
||||
flask-sqlalchemy==2.5.1
|
||||
flask-sqlalchemy==3.1.1
|
||||
# via
|
||||
# -c requirements/base-constraint.txt
|
||||
# apache-superset
|
||||
@@ -950,7 +950,7 @@ slack-sdk==3.43.0
|
||||
# apache-superset
|
||||
sniffio==1.3.1
|
||||
# via anyio
|
||||
sqlalchemy==1.4.54
|
||||
sqlalchemy==2.0.51
|
||||
# via
|
||||
# -c requirements/base-constraint.txt
|
||||
# alembic
|
||||
@@ -1033,6 +1033,7 @@ typing-extensions==4.16.0
|
||||
# pyopenssl
|
||||
# referencing
|
||||
# shillelagh
|
||||
# sqlalchemy
|
||||
# starlette
|
||||
# typing-inspection
|
||||
typing-inspection==0.4.2
|
||||
|
||||
Executable
+48
@@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env bash
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
# Computes the `--extra-flags` value passed to `supersetbot docker` for a
|
||||
# given build preset. Factored out of .github/workflows/docker.yml so the
|
||||
# PY_VER override logic below can be exercised by an always-on CI check
|
||||
# (docker.yml's docker-build job only runs when the change detector's
|
||||
# docker/python/frontend outputs are true, and the PR build matrix never
|
||||
# includes py311/py312 at all, so a regression here would otherwise go
|
||||
# unnoticed until the fix actually runs on master) without duplicating -
|
||||
# and risking drift from - the logic used by the real build step.
|
||||
#
|
||||
# supersetbot's "py311"/"py312" presets pin their own --build-arg PY_VER,
|
||||
# which lands ahead of --extra-flags on the assembled buildx command line;
|
||||
# docker/buildx keeps the last value for a repeated --build-arg key, so
|
||||
# appending PY_VER here would override supersetbot's pin and silently make
|
||||
# "py311"/"py312" build the exact same image as "lean". Every other preset
|
||||
# gets the override so its build lands on the Dockerfile's own supported
|
||||
# Python version.
|
||||
#
|
||||
# Usage: docker-build-extra-flags.sh <build_preset> <image_tag>
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
BUILD_PRESET="${1:?usage: docker-build-extra-flags.sh <build_preset> <image_tag>}"
|
||||
IMAGE_TAG="${2:?usage: docker-build-extra-flags.sh <build_preset> <image_tag>}"
|
||||
|
||||
EXTRA_FLAGS="--build-arg INCLUDE_CHROMIUM=false --tag $IMAGE_TAG"
|
||||
if [ "$BUILD_PRESET" != "py311" ] && [ "$BUILD_PRESET" != "py312" ]; then
|
||||
EXTRA_FLAGS="--build-arg PY_VER=3.11.14-slim-trixie $EXTRA_FLAGS"
|
||||
fi
|
||||
|
||||
echo "$EXTRA_FLAGS"
|
||||
@@ -45,7 +45,7 @@ dependencies = [
|
||||
"isodate>=0.7.0",
|
||||
"pyarrow>=16.0.0",
|
||||
"pydantic>=2.8.0",
|
||||
"sqlalchemy>=1.4.0,<2.0",
|
||||
"sqlalchemy>=2.0.0,<2.1",
|
||||
"sqlalchemy-utils>=0.38.0, <0.43", # expanding lowerbound to work with pydoris
|
||||
"sqlglot>=30.8.0, <31",
|
||||
"typing-extensions>=4.0.0",
|
||||
|
||||
+8
-7
@@ -3215,16 +3215,17 @@
|
||||
"integrity": "sha512-Fc8Ne62jJlKHiG/ajlonC4Sd66Pq68fFwK4ihJGNZpGqboc324SQk+lRvMzpPRuJOmfrJefdG8/7JdWX4bzJ2Q=="
|
||||
},
|
||||
"node_modules/brace-expansion": {
|
||||
"version": "5.0.7",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.7.tgz",
|
||||
"integrity": "sha512-7oFy703dxfY3/NLxC1fh2SUCQ0H9rmAY+5EpDVfXjUTTs+HEwR2nYaqLv+GWcTsumwxPfiz6CzCNkwXwBUwqCA==",
|
||||
"version": "5.0.8",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.8.tgz",
|
||||
"integrity": "sha512-JZyDyq3D4AUifKTPOB7DELf6XsB3WdPuNxCtob1vFXPsSXhdAiHBWJ/tJ8HAc9aH84BK+5JFZLNkJKx3G9kzQg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"balanced-match": "^4.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": "18 || 20 || >=22"
|
||||
"node": "20 || >=22"
|
||||
}
|
||||
},
|
||||
"node_modules/browserslist": {
|
||||
@@ -11184,9 +11185,9 @@
|
||||
"integrity": "sha512-Fc8Ne62jJlKHiG/ajlonC4Sd66Pq68fFwK4ihJGNZpGqboc324SQk+lRvMzpPRuJOmfrJefdG8/7JdWX4bzJ2Q=="
|
||||
},
|
||||
"brace-expansion": {
|
||||
"version": "5.0.7",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.7.tgz",
|
||||
"integrity": "sha512-7oFy703dxfY3/NLxC1fh2SUCQ0H9rmAY+5EpDVfXjUTTs+HEwR2nYaqLv+GWcTsumwxPfiz6CzCNkwXwBUwqCA==",
|
||||
"version": "5.0.8",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.8.tgz",
|
||||
"integrity": "sha512-JZyDyq3D4AUifKTPOB7DELf6XsB3WdPuNxCtob1vFXPsSXhdAiHBWJ/tJ8HAc9aH84BK+5JFZLNkJKx3G9kzQg==",
|
||||
"dev": true,
|
||||
"peer": true,
|
||||
"requires": {
|
||||
|
||||
@@ -36,6 +36,9 @@
|
||||
"cypress": {
|
||||
"form-data": "^2.3.4"
|
||||
},
|
||||
"minimatch@>=10": {
|
||||
"brace-expansion": ">=5.0.8"
|
||||
},
|
||||
"qs": "^6.14.2",
|
||||
"uuid": "^11.1.1"
|
||||
},
|
||||
|
||||
Generated
+125
-114
@@ -79,9 +79,9 @@
|
||||
"@visx/scale": "^4.0.0",
|
||||
"@visx/tooltip": "^4.0.0",
|
||||
"@visx/xychart": "^4.0.0",
|
||||
"ag-grid-community": "36.0.2",
|
||||
"ag-grid-react": "36.0.2",
|
||||
"antd": "^6.5.3",
|
||||
"ag-grid-community": "36.1.0",
|
||||
"ag-grid-react": "36.1.0",
|
||||
"antd": "^6.5.4",
|
||||
"chrono-node": "^2.10.1",
|
||||
"classnames": "^2.2.5",
|
||||
"content-disposition": "^2.0.1",
|
||||
@@ -100,7 +100,7 @@
|
||||
"geostyler-style": "11.0.2",
|
||||
"geostyler-wfs-parser": "^3.0.1",
|
||||
"google-auth-library": "^11.0.0",
|
||||
"immer": "^11.1.15",
|
||||
"immer": "^11.1.16",
|
||||
"interweave": "^13.1.1",
|
||||
"jquery": "^4.0.0",
|
||||
"js-levenshtein": "^1.1.6",
|
||||
@@ -108,7 +108,7 @@
|
||||
"json-stringify-pretty-compact": "^4.0.0",
|
||||
"lodash": "^4.18.1",
|
||||
"lodash-es": "^4.18.1",
|
||||
"mapbox-gl": "^3.27.0",
|
||||
"mapbox-gl": "^3.28.1",
|
||||
"markdown-to-jsx": "^9.10.2",
|
||||
"match-sorter": "^8.3.0",
|
||||
"memoize-one": "^6.0.0",
|
||||
@@ -116,7 +116,7 @@
|
||||
"mustache": "^4.2.0",
|
||||
"nanoid": "^6.0.1",
|
||||
"ol": "^10.10.0",
|
||||
"query-string": "9.4.1",
|
||||
"query-string": "9.5.0",
|
||||
"re-resizable": "^6.11.2",
|
||||
"react": "^18.3.0",
|
||||
"react-arborist": "^3.16.0",
|
||||
@@ -180,9 +180,9 @@
|
||||
"@istanbuljs/nyc-config-typescript": "^1.0.1",
|
||||
"@playwright/test": "^1.62.1",
|
||||
"@pmmmwh/react-refresh-webpack-plugin": "^0.6.2",
|
||||
"@storybook/addon-docs": "10.5.6",
|
||||
"@storybook/addon-links": "10.5.6",
|
||||
"@storybook/react-webpack5": "10.5.6",
|
||||
"@storybook/addon-docs": "10.5.7",
|
||||
"@storybook/addon-links": "10.5.7",
|
||||
"@storybook/react-webpack5": "10.5.7",
|
||||
"@storybook/test-runner": "0.24.4",
|
||||
"@svgr/webpack": "^8.1.0",
|
||||
"@swc/core": "^1.15.47",
|
||||
@@ -235,7 +235,7 @@
|
||||
"eslint-plugin-no-only-tests": "^3.4.0",
|
||||
"eslint-plugin-react-prefer-function-component": "^5.0.0",
|
||||
"eslint-plugin-react-you-might-not-need-an-effect": "^1.0.1",
|
||||
"eslint-plugin-storybook": "10.5.6",
|
||||
"eslint-plugin-storybook": "10.5.7",
|
||||
"eslint-plugin-testing-library": "^7.16.2",
|
||||
"eslint-plugin-theme-colors": "file:eslint-rules/eslint-plugin-theme-colors",
|
||||
"fetch-mock": "^12.6.0",
|
||||
@@ -266,13 +266,13 @@
|
||||
"source-map": "^0.8.0",
|
||||
"source-map-support": "^0.5.21",
|
||||
"speed-measure-webpack-plugin": "^1.6.0",
|
||||
"storybook": "10.5.6",
|
||||
"storybook": "10.5.7",
|
||||
"style-loader": "^4.0.0",
|
||||
"stylelint": "^17.14.1",
|
||||
"swc-loader": "^0.2.7",
|
||||
"ts-jest": "^29.4.12",
|
||||
"tscw-config": "^1.1.2",
|
||||
"tsx": "^4.23.5",
|
||||
"tsx": "^4.23.10",
|
||||
"typescript": "5.4.5",
|
||||
"unzipper": "^0.12.5",
|
||||
"wait-on": "^9.1.0",
|
||||
@@ -10741,16 +10741,16 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@storybook/addon-docs": {
|
||||
"version": "10.5.6",
|
||||
"resolved": "https://registry.npmjs.org/@storybook/addon-docs/-/addon-docs-10.5.6.tgz",
|
||||
"integrity": "sha512-zyUJBrrpC9NTrmsREaVFNr+9WW6pikJtmRvo7GgZGqthEyhjQKSarHrW0aNWkwae2ep3jp1CZi8vIUVG1Dnp0w==",
|
||||
"version": "10.5.7",
|
||||
"resolved": "https://registry.npmjs.org/@storybook/addon-docs/-/addon-docs-10.5.7.tgz",
|
||||
"integrity": "sha512-KNARJfjICaizinsR3INMEiipZm1ObYo+xw+E26gteu50Bcy2dIZUtk5uHY5XdtardU3AXX6yRXoBZ2HCY3lbHA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@mdx-js/react": "^3.0.0",
|
||||
"@storybook/csf-plugin": "10.5.6",
|
||||
"@storybook/csf-plugin": "10.5.7",
|
||||
"@storybook/icons": "^2.0.2",
|
||||
"@storybook/react-dom-shim": "10.5.6",
|
||||
"@storybook/react-dom-shim": "10.5.7",
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
||||
"ts-dedent": "^2.0.0"
|
||||
@@ -10761,7 +10761,7 @@
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
||||
"storybook": "10.5.6"
|
||||
"storybook": "10.5.7"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@types/react": {
|
||||
@@ -10770,9 +10770,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@storybook/addon-docs/node_modules/@storybook/csf-plugin": {
|
||||
"version": "10.5.6",
|
||||
"resolved": "https://registry.npmjs.org/@storybook/csf-plugin/-/csf-plugin-10.5.6.tgz",
|
||||
"integrity": "sha512-PJLyOmcKe1OZDBw7RaGX/gjuiJuVfS5pVgc4W2RnHYOFpU6F5Bv9+9MqQwp0i7tWZBWc4fsCJudgVqwgjuTROA==",
|
||||
"version": "10.5.7",
|
||||
"resolved": "https://registry.npmjs.org/@storybook/csf-plugin/-/csf-plugin-10.5.7.tgz",
|
||||
"integrity": "sha512-IaX8FlM0H36HNFhJ2+4L9bCldqfvHGqcLg841SJNyK/DhfMlM7JsvY/GDH2ZFuWrUf8FSOx96GRRnHq6XfRKag==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -10785,7 +10785,7 @@
|
||||
"peerDependencies": {
|
||||
"esbuild": "*",
|
||||
"rollup": "*",
|
||||
"storybook": "10.5.6",
|
||||
"storybook": "10.5.7",
|
||||
"vite": "*",
|
||||
"webpack": "*"
|
||||
},
|
||||
@@ -10805,9 +10805,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@storybook/addon-docs/node_modules/@storybook/react-dom-shim": {
|
||||
"version": "10.5.6",
|
||||
"resolved": "https://registry.npmjs.org/@storybook/react-dom-shim/-/react-dom-shim-10.5.6.tgz",
|
||||
"integrity": "sha512-dV3oOHc5ImggxEqeIiUj4vvnQO5SKScFtqAkxgIWLju1wiSZSIqQ5Q4Mp12Rhs9hQrjF039DueH7f2xJJZfvSw==",
|
||||
"version": "10.5.7",
|
||||
"resolved": "https://registry.npmjs.org/@storybook/react-dom-shim/-/react-dom-shim-10.5.7.tgz",
|
||||
"integrity": "sha512-lxOkyh+wu/MiBXvYQHjZfD+DRKOa4bHBzbuGuiHXnHXmdOcTRdcrQTsoeN2FPtfugmmOG66cZUEgDwNX+k5eRA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
@@ -10819,7 +10819,7 @@
|
||||
"@types/react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
||||
"storybook": "10.5.6"
|
||||
"storybook": "10.5.7"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@types/react": {
|
||||
@@ -10831,9 +10831,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@storybook/addon-links": {
|
||||
"version": "10.5.6",
|
||||
"resolved": "https://registry.npmjs.org/@storybook/addon-links/-/addon-links-10.5.6.tgz",
|
||||
"integrity": "sha512-pw+OS/wUZ4ijdVGOsE5QOt59+C2i4fwtFBs2ircB7KMlwEE7gslovZEjnrz8bbaznvmoLoYGWYZxXcLi+bYmzg==",
|
||||
"version": "10.5.7",
|
||||
"resolved": "https://registry.npmjs.org/@storybook/addon-links/-/addon-links-10.5.7.tgz",
|
||||
"integrity": "sha512-17PxEOocLhAEaPeQ4q+8yul/LF9YEIePS1arknCAS7U1pQXTe0uj+R0pB6uPLVflM5gECQMiP4WzIj4tEiL6+A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -10846,7 +10846,7 @@
|
||||
"peerDependencies": {
|
||||
"@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
||||
"storybook": "10.5.6"
|
||||
"storybook": "10.5.7"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@types/react": {
|
||||
@@ -10940,15 +10940,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@storybook/react-webpack5": {
|
||||
"version": "10.5.6",
|
||||
"resolved": "https://registry.npmjs.org/@storybook/react-webpack5/-/react-webpack5-10.5.6.tgz",
|
||||
"integrity": "sha512-UdsC+IrZHBAtEvvDkfCPhg5sy5jnJAHT4RS3I8wNHVJ+93gaUrZLElSIV+w5UB1u/yghoqmQm7/LfpPpZrjPZQ==",
|
||||
"version": "10.5.7",
|
||||
"resolved": "https://registry.npmjs.org/@storybook/react-webpack5/-/react-webpack5-10.5.7.tgz",
|
||||
"integrity": "sha512-vvl07oXp2qfmHJHZ77Aw1F3LFOo7XubOta+lC8UmlEw3rDDJhQxJN3erJJVHavNhdA2jBTK6VUXQKdqQh7X7nQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@storybook/builder-webpack5": "10.5.6",
|
||||
"@storybook/preset-react-webpack": "10.5.6",
|
||||
"@storybook/react": "10.5.6"
|
||||
"@storybook/builder-webpack5": "10.5.7",
|
||||
"@storybook/preset-react-webpack": "10.5.7",
|
||||
"@storybook/react": "10.5.7"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
@@ -10957,7 +10957,7 @@
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
||||
"storybook": "10.5.6",
|
||||
"storybook": "10.5.7",
|
||||
"typescript": ">= 4.9.x"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
@@ -10967,13 +10967,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@storybook/react-webpack5/node_modules/@storybook/builder-webpack5": {
|
||||
"version": "10.5.6",
|
||||
"resolved": "https://registry.npmjs.org/@storybook/builder-webpack5/-/builder-webpack5-10.5.6.tgz",
|
||||
"integrity": "sha512-uWo/MzNC6HXMEpy8QQfbeYh1j6aOC6Ly0sAR6RE0LPvpyGEWC0VaVOBERIJJBjeuPuonDBVKfEjh1iUvZhJopg==",
|
||||
"version": "10.5.7",
|
||||
"resolved": "https://registry.npmjs.org/@storybook/builder-webpack5/-/builder-webpack5-10.5.7.tgz",
|
||||
"integrity": "sha512-4n4c60LihFivZnjAcXGO5+XbgZthoUtKb/nPKVgypj3MpEetzjq6XR83A4UNnRsXYmjqfn6bsDWNgEJ/RvQg5A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@storybook/core-webpack": "10.5.6",
|
||||
"@storybook/core-webpack": "10.5.7",
|
||||
"case-sensitive-paths-webpack-plugin": "^2.4.0",
|
||||
"cjs-module-lexer": "^1.2.3",
|
||||
"css-loader": "^7.1.2",
|
||||
@@ -10995,7 +10995,7 @@
|
||||
"url": "https://opencollective.com/storybook"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"storybook": "10.5.6"
|
||||
"storybook": "10.5.7"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"typescript": {
|
||||
@@ -11004,9 +11004,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@storybook/react-webpack5/node_modules/@storybook/builder-webpack5/node_modules/@storybook/core-webpack": {
|
||||
"version": "10.5.6",
|
||||
"resolved": "https://registry.npmjs.org/@storybook/core-webpack/-/core-webpack-10.5.6.tgz",
|
||||
"integrity": "sha512-o5PP3K+NcJAitZF7Ywweow0d8dJrEA1jxV5T1LMGMiWHUrnpoaPTiK1HcYw39pOQkdKL88mMSfDDUipGurZthw==",
|
||||
"version": "10.5.7",
|
||||
"resolved": "https://registry.npmjs.org/@storybook/core-webpack/-/core-webpack-10.5.7.tgz",
|
||||
"integrity": "sha512-0dtDw/FNPREoeCHX2RgZz0OecxaAGol1R7bCobFevArxyFIPJisTfjDMUFHKr+3B7BilTd3vnatl7Nlvgs0EiA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -11017,17 +11017,17 @@
|
||||
"url": "https://opencollective.com/storybook"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"storybook": "10.5.6"
|
||||
"storybook": "10.5.7"
|
||||
}
|
||||
},
|
||||
"node_modules/@storybook/react-webpack5/node_modules/@storybook/preset-react-webpack": {
|
||||
"version": "10.5.6",
|
||||
"resolved": "https://registry.npmjs.org/@storybook/preset-react-webpack/-/preset-react-webpack-10.5.6.tgz",
|
||||
"integrity": "sha512-QPUl2t+0VIp1Wy7JfqvV8cI1NrULUt+XFMKdIaNp39TuyMn3El4txvmxQWKhcYvnSOEzQ2SGNDqSWcJISwmeAA==",
|
||||
"version": "10.5.7",
|
||||
"resolved": "https://registry.npmjs.org/@storybook/preset-react-webpack/-/preset-react-webpack-10.5.7.tgz",
|
||||
"integrity": "sha512-xwNRcoVlIDx1/YYCFBAxfh/91vFiOgrVI+0Ir4u9eO87SH2leehRnJh619QEOrlQEU5px487y2BmL2ZVtmTpYA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@storybook/core-webpack": "10.5.6",
|
||||
"@storybook/core-webpack": "10.5.7",
|
||||
"@storybook/react-docgen-typescript-plugin": "1.0.6--canary.9.0c3f3b7.0",
|
||||
"@types/semver": "^7.7.1",
|
||||
"magic-string": "^0.30.5",
|
||||
@@ -11044,7 +11044,7 @@
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
||||
"storybook": "10.5.6"
|
||||
"storybook": "10.5.7"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"typescript": {
|
||||
@@ -11053,9 +11053,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@storybook/react-webpack5/node_modules/@storybook/preset-react-webpack/node_modules/@storybook/core-webpack": {
|
||||
"version": "10.5.6",
|
||||
"resolved": "https://registry.npmjs.org/@storybook/core-webpack/-/core-webpack-10.5.6.tgz",
|
||||
"integrity": "sha512-o5PP3K+NcJAitZF7Ywweow0d8dJrEA1jxV5T1LMGMiWHUrnpoaPTiK1HcYw39pOQkdKL88mMSfDDUipGurZthw==",
|
||||
"version": "10.5.7",
|
||||
"resolved": "https://registry.npmjs.org/@storybook/core-webpack/-/core-webpack-10.5.7.tgz",
|
||||
"integrity": "sha512-0dtDw/FNPREoeCHX2RgZz0OecxaAGol1R7bCobFevArxyFIPJisTfjDMUFHKr+3B7BilTd3vnatl7Nlvgs0EiA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -11066,18 +11066,18 @@
|
||||
"url": "https://opencollective.com/storybook"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"storybook": "10.5.6"
|
||||
"storybook": "10.5.7"
|
||||
}
|
||||
},
|
||||
"node_modules/@storybook/react-webpack5/node_modules/@storybook/react": {
|
||||
"version": "10.5.6",
|
||||
"resolved": "https://registry.npmjs.org/@storybook/react/-/react-10.5.6.tgz",
|
||||
"integrity": "sha512-dXSdNoc9yAvpa4hiegQhmZPXOKunAxkPX94DxvRw/kM6+wujVFAGlZjYygKrWw357KOjPRK7SO1LRTc70mgrhQ==",
|
||||
"version": "10.5.7",
|
||||
"resolved": "https://registry.npmjs.org/@storybook/react/-/react-10.5.7.tgz",
|
||||
"integrity": "sha512-uFvty2MMdFXzW5PcQe1JqDAZkz6cQq7q/9G/cbGVnBEvP6zsOVeL+bmrQ0/WBlFQN0Ko9+ZoCTvaQ9s65zBa5g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@storybook/global": "^5.0.0",
|
||||
"@storybook/react-dom-shim": "10.5.6",
|
||||
"@storybook/react-dom-shim": "10.5.7",
|
||||
"react-docgen": "^8.0.2",
|
||||
"react-docgen-typescript": "^2.2.2"
|
||||
},
|
||||
@@ -11090,7 +11090,7 @@
|
||||
"@types/react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
||||
"storybook": "10.5.6",
|
||||
"storybook": "10.5.7",
|
||||
"typescript": ">= 4.9.x"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
@@ -11106,9 +11106,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@storybook/react-webpack5/node_modules/@storybook/react/node_modules/@storybook/react-dom-shim": {
|
||||
"version": "10.5.6",
|
||||
"resolved": "https://registry.npmjs.org/@storybook/react-dom-shim/-/react-dom-shim-10.5.6.tgz",
|
||||
"integrity": "sha512-dV3oOHc5ImggxEqeIiUj4vvnQO5SKScFtqAkxgIWLju1wiSZSIqQ5Q4Mp12Rhs9hQrjF039DueH7f2xJJZfvSw==",
|
||||
"version": "10.5.7",
|
||||
"resolved": "https://registry.npmjs.org/@storybook/react-dom-shim/-/react-dom-shim-10.5.7.tgz",
|
||||
"integrity": "sha512-lxOkyh+wu/MiBXvYQHjZfD+DRKOa4bHBzbuGuiHXnHXmdOcTRdcrQTsoeN2FPtfugmmOG66cZUEgDwNX+k5eRA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
@@ -11120,7 +11120,7 @@
|
||||
"@types/react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
||||
"storybook": "10.5.6"
|
||||
"storybook": "10.5.7"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@types/react": {
|
||||
@@ -15025,28 +15025,28 @@
|
||||
}
|
||||
},
|
||||
"node_modules/ag-charts-types": {
|
||||
"version": "14.0.2",
|
||||
"resolved": "https://registry.npmjs.org/ag-charts-types/-/ag-charts-types-14.0.2.tgz",
|
||||
"integrity": "sha512-F7ZG0g8Y+iKhJi50AfZRwEyUM/TBsNyh2IoXB0JaDN97lnbemIK8GE5kF1eBtXtN4mcC+lPXK9oZUeVXwO9EWA==",
|
||||
"version": "14.1.0",
|
||||
"resolved": "https://registry.npmjs.org/ag-charts-types/-/ag-charts-types-14.1.0.tgz",
|
||||
"integrity": "sha512-mmzkng88c0l+Z9PvCMowMilhVeNgDU/iMuMemcOQD4BG/qO4vbkxWvyQO0iqju8Dx7YOY81PNzC/RmElQNiVkA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/ag-grid-community": {
|
||||
"version": "36.0.2",
|
||||
"resolved": "https://registry.npmjs.org/ag-grid-community/-/ag-grid-community-36.0.2.tgz",
|
||||
"integrity": "sha512-TINZfuFvMY2nc3JfQHiUWT7dNIxI89ZxS5XkXIPi/rYICoNupRqpaM41KVzGPPfSkM0AwhuzTFxAiF08zEkV1Q==",
|
||||
"version": "36.1.0",
|
||||
"resolved": "https://registry.npmjs.org/ag-grid-community/-/ag-grid-community-36.1.0.tgz",
|
||||
"integrity": "sha512-WnvSQ4csRs8gv/b1B0lPHykQXvUJVgi2u5mpY0Aa6dv3pvhDVVqCT8dwUyOeCog4JNPptaXGrOrZ8qP2XoJzVA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ag-charts-types": "14.0.2",
|
||||
"ag-stack": "36.0.2"
|
||||
"ag-charts-types": "14.1.0",
|
||||
"ag-stack": "36.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/ag-grid-react": {
|
||||
"version": "36.0.2",
|
||||
"resolved": "https://registry.npmjs.org/ag-grid-react/-/ag-grid-react-36.0.2.tgz",
|
||||
"integrity": "sha512-yVPmqdhx1zp06FLyZmwmIxIO57w4ko+qN64MXgPlBMJVL0MNA5hULqAY/+SoB4cd0bBHqz8okuuAbHHpu5QoHQ==",
|
||||
"version": "36.1.0",
|
||||
"resolved": "https://registry.npmjs.org/ag-grid-react/-/ag-grid-react-36.1.0.tgz",
|
||||
"integrity": "sha512-FNsmrOmr+taZY11sCA+6Ow0mKs2JqnmrjBrMjkKC2rVTXPARtks+tv+Ne4ZkLGGtvIMDlBFCDbSzFXVP0CdwXQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ag-grid-community": "36.0.2",
|
||||
"ag-grid-community": "36.1.0",
|
||||
"prop-types": "^15.8.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
@@ -15055,9 +15055,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/ag-stack": {
|
||||
"version": "36.0.2",
|
||||
"resolved": "https://registry.npmjs.org/ag-stack/-/ag-stack-36.0.2.tgz",
|
||||
"integrity": "sha512-YuhQExQw5YsWK0wxrksRyYBAqOU0v08lJH5uxRsKx+49ko5vkDgnJuhX4yF995BBVdLY1LKlXukLEub+olKyuA==",
|
||||
"version": "36.1.0",
|
||||
"resolved": "https://registry.npmjs.org/ag-stack/-/ag-stack-36.1.0.tgz",
|
||||
"integrity": "sha512-Kmkf5iRZmyduNx2KtW450j6GbCdJ4ejacSpb1AWl0yrdquRmScLRc1SlLolx6lyCbTBSJGo4tRraKbBzre+GlQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/agent-base": {
|
||||
@@ -15214,9 +15214,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/antd": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/antd/-/antd-6.5.3.tgz",
|
||||
"integrity": "sha512-Q5r8sztf9Yk9B70bSUjnPYMCJ4A/eZM7uMoTj8UAhlSKR9aftjEuBEPcNSmRux7hB+87rxO8vN1X4HNjR97qyQ==",
|
||||
"version": "6.5.4",
|
||||
"resolved": "https://registry.npmjs.org/antd/-/antd-6.5.4.tgz",
|
||||
"integrity": "sha512-jchA6i0rEwHjLpgC+l6HeLHP0gL4Q4yjs6Mxqt6PlhGD5ArxCj3ZH+fKFbNquCtd6Rlzzi+emfNFpP2dGLwZzg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@ant-design/colors": "^8.0.1",
|
||||
@@ -18005,11 +18005,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/core-js": {
|
||||
"version": "3.49.0",
|
||||
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.49.0.tgz",
|
||||
"integrity": "sha512-es1U2+YTtzpwkxVLwAFdSpaIMyQaq0PBgm3YD1W3Qpsn1NAmO3KSgZfu+oGSWVu6NvLHoHCV/aYcsE5wiB7ALg==",
|
||||
"version": "3.50.0",
|
||||
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.50.0.tgz",
|
||||
"integrity": "sha512-BRWgOLKkFeCgRudR6zrs8p9XJZcE14grzKMMssoYrk6krtuEZ7MTKPIY5RzOnqsEKIR9kst7wNzphttraT+Yqw==",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "*"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/core-js"
|
||||
@@ -18910,9 +18913,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/decode-uri-component": {
|
||||
"version": "0.4.1",
|
||||
"resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.4.1.tgz",
|
||||
"integrity": "sha512-+8VxcR21HhTy8nOt6jf20w0c9CADrw1O8d+VZ/YzzCt4bJ3uBjw+D1q2osAB8RnpwwaeYBxy0HyKQxD5JBMuuQ==",
|
||||
"version": "0.5.0",
|
||||
"resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.5.0.tgz",
|
||||
"integrity": "sha512-1BiQVoK8C9gUbQU6NzAtO/tkz2qOFpEObMWpcFvhx4fYnj4Oc5yzaJN/LD36ihkVUdXyh5ZekzX+yM+ty/SrPg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=14.16"
|
||||
@@ -20519,9 +20522,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-storybook": {
|
||||
"version": "10.5.6",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-storybook/-/eslint-plugin-storybook-10.5.6.tgz",
|
||||
"integrity": "sha512-uOXhNkIH+iTdyViSmWnCrwtapasL57M3nq5yfST1H7y9djRLyuAIfNcf9cPBedc2G1oqI8jn3up/VHdN3y3Btw==",
|
||||
"version": "10.5.7",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-storybook/-/eslint-plugin-storybook-10.5.7.tgz",
|
||||
"integrity": "sha512-mLpamG1Rsica2jYbUzIZOEuy7Fm1IMtVLMvvxGTpjTVKUMxTXJsANx3MBpH2VSbGQB8Yzlt5399WL/O07K97Ig==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -20530,7 +20533,7 @@
|
||||
},
|
||||
"peerDependencies": {
|
||||
"eslint": ">=8",
|
||||
"storybook": "10.5.6"
|
||||
"storybook": "10.5.7"
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-testing-library": {
|
||||
@@ -24184,9 +24187,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/immer": {
|
||||
"version": "11.1.15",
|
||||
"resolved": "https://registry.npmjs.org/immer/-/immer-11.1.15.tgz",
|
||||
"integrity": "sha512-VrNANlmnWQnh5COXIIOQXM9oOJw7naGKlBT74ZOOR6lpVXc3gFEu9FJLDFcpCJ2j+NWr8TIwtWD//T6ZX6TKiQ==",
|
||||
"version": "11.1.16",
|
||||
"resolved": "https://registry.npmjs.org/immer/-/immer-11.1.16.tgz",
|
||||
"integrity": "sha512-Xs7H9rBc+kti1J6RueUvbEBkmOz7jqj11XYgf+YMXAYzu8EeE7hwZ9poLXdVfVnGmJu7QAf41T7H2KuF6QoK6Q==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
@@ -28745,15 +28748,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/mapbox-gl": {
|
||||
"version": "3.27.0",
|
||||
"resolved": "https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-3.27.0.tgz",
|
||||
"integrity": "sha512-K8W9LTTjFEJsg9qsnJbKk+zbXrmSqa+nU1EiFXez5gQ0T0RMtylZUelgg1/RE6vCUMvHX0gaYfWU9g2mTWuA0g==",
|
||||
"version": "3.28.1",
|
||||
"resolved": "https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-3.28.1.tgz",
|
||||
"integrity": "sha512-f8bCHFzZ51bKig7rnD7e08aoFLOV3MNFZduspZ4lgOgiaNVp9sw4NSWcgo3IWTyekYKKXjiICD2BP2o4DiYfxw==",
|
||||
"license": "SEE LICENSE IN LICENSE.txt",
|
||||
"workspaces": [
|
||||
"src/style-spec",
|
||||
"plugins/mapbox-gl-pmtiles-provider",
|
||||
"test/build/vite",
|
||||
"test/build/webpack",
|
||||
"test/bundlers/*",
|
||||
"test/build/typings"
|
||||
]
|
||||
},
|
||||
@@ -33666,12 +33668,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/query-string": {
|
||||
"version": "9.4.1",
|
||||
"resolved": "https://registry.npmjs.org/query-string/-/query-string-9.4.1.tgz",
|
||||
"integrity": "sha512-lSyJeN3RuaG7DZGWThtYRhk96+kEyZ/+doZpERuWbjeFL+Ok3vEat/swU498rAI0NcVt5/RJp8UDuLz7FckxrA==",
|
||||
"version": "9.5.0",
|
||||
"resolved": "https://registry.npmjs.org/query-string/-/query-string-9.5.0.tgz",
|
||||
"integrity": "sha512-YlJmwNyi0RGYjlxYcuDncMsxFU7YyutbuI7gTm8ySxIGBlwx5yiBCOD5ig9ZNoHkawk/1Dey0N5mEfcUybMVAA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"decode-uri-component": "^0.4.1",
|
||||
"decode-uri-component": "^0.5.0",
|
||||
"filter-obj": "^5.1.0",
|
||||
"split-on-first": "^3.0.0"
|
||||
},
|
||||
@@ -37989,9 +37991,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/storybook": {
|
||||
"version": "10.5.6",
|
||||
"resolved": "https://registry.npmjs.org/storybook/-/storybook-10.5.6.tgz",
|
||||
"integrity": "sha512-VhYwqxPySa24CVXKoWD6gCZXx9//DTmo43YpusGuAoHDYj5Osjt8wuBRQVeGoaLUWnHiPWv8S+GYHrJEaBM6Rg==",
|
||||
"version": "10.5.7",
|
||||
"resolved": "https://registry.npmjs.org/storybook/-/storybook-10.5.7.tgz",
|
||||
"integrity": "sha512-oiKvWIwIoOhFP1i6dASYyMXwPHKEtVZMshqSB7EvIVYjWRh0l9H7gHEt1z4Gh2rLGFMekWdsm4s94rvwpR7gkg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -39964,9 +39966,9 @@
|
||||
"license": "0BSD"
|
||||
},
|
||||
"node_modules/tsx": {
|
||||
"version": "4.23.5",
|
||||
"resolved": "https://registry.npmjs.org/tsx/-/tsx-4.23.5.tgz",
|
||||
"integrity": "sha512-rw55FUaqOoI7RvlQwLbhO4nSDApnQ4/CykPuiQ/EPvtrX3WA9Ig55jIt9VvbBJbzJuj12ueRu4PMZ2SxPVbihg==",
|
||||
"version": "4.23.10",
|
||||
"resolved": "https://registry.npmjs.org/tsx/-/tsx-4.23.10.tgz",
|
||||
"integrity": "sha512-0Vb9eKU47njkxv/6B8CRZRDsxNDT/Pz+BIU+M5jw7xL3TdzAjSxlZUxu0xFL/kLpaG3sHZ0LH2wbK1T1yo7CUQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -43229,11 +43231,11 @@
|
||||
"@types/json-bigint": "^1.0.4",
|
||||
"@visx/responsive": "^4.0.0",
|
||||
"ace-builds": "^1.44.0",
|
||||
"ag-grid-community": "36.0.2",
|
||||
"ag-grid-react": "36.0.2",
|
||||
"ag-grid-community": "36.1.0",
|
||||
"ag-grid-react": "36.1.0",
|
||||
"brace": "^0.11.1",
|
||||
"classnames": "^2.5.1",
|
||||
"core-js": "^3.49.0",
|
||||
"core-js": "^3.50.0",
|
||||
"csstype": "^3.2.3",
|
||||
"d3-format": "^3.1.2",
|
||||
"d3-interpolate": "^3.0.1",
|
||||
@@ -43351,6 +43353,15 @@
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"packages/superset-ui-core/node_modules/dompurify": {
|
||||
"version": "3.4.13",
|
||||
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.4.13.tgz",
|
||||
"integrity": "sha512-2vmYIoqjze2d+kakP8S/nS5shfsl587kzwEjcGlTdiksUVgFHnFCsLYDVj/JNqJVOQZGSYBTmuycv0PodwmnMQ==",
|
||||
"license": "(MPL-2.0 OR Apache-2.0)",
|
||||
"optionalDependencies": {
|
||||
"@types/trusted-types": "^2.0.7"
|
||||
}
|
||||
},
|
||||
"packages/superset-ui-core/node_modules/react-ace": {
|
||||
"version": "14.0.1",
|
||||
"resolved": "https://registry.npmjs.org/react-ace/-/react-ace-14.0.1.tgz",
|
||||
@@ -43934,7 +43945,7 @@
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@math.gl/web-mercator": "^4.1.0",
|
||||
"mapbox-gl": "^3.27.0",
|
||||
"mapbox-gl": "^3.28.1",
|
||||
"maplibre-gl": "^5.24.0",
|
||||
"react-map-gl": "^8.1.2",
|
||||
"supercluster": "^8.0.1"
|
||||
|
||||
@@ -156,9 +156,9 @@
|
||||
"@visx/scale": "^4.0.0",
|
||||
"@visx/tooltip": "^4.0.0",
|
||||
"@visx/xychart": "^4.0.0",
|
||||
"ag-grid-community": "36.0.2",
|
||||
"ag-grid-react": "36.0.2",
|
||||
"antd": "^6.5.3",
|
||||
"ag-grid-community": "36.1.0",
|
||||
"ag-grid-react": "36.1.0",
|
||||
"antd": "^6.5.4",
|
||||
"chrono-node": "^2.10.1",
|
||||
"classnames": "^2.2.5",
|
||||
"content-disposition": "^2.0.1",
|
||||
@@ -177,7 +177,7 @@
|
||||
"geostyler-style": "11.0.2",
|
||||
"geostyler-wfs-parser": "^3.0.1",
|
||||
"google-auth-library": "^11.0.0",
|
||||
"immer": "^11.1.15",
|
||||
"immer": "^11.1.16",
|
||||
"interweave": "^13.1.1",
|
||||
"jquery": "^4.0.0",
|
||||
"js-levenshtein": "^1.1.6",
|
||||
@@ -185,7 +185,7 @@
|
||||
"json-stringify-pretty-compact": "^4.0.0",
|
||||
"lodash": "^4.18.1",
|
||||
"lodash-es": "^4.18.1",
|
||||
"mapbox-gl": "^3.27.0",
|
||||
"mapbox-gl": "^3.28.1",
|
||||
"markdown-to-jsx": "^9.10.2",
|
||||
"match-sorter": "^8.3.0",
|
||||
"memoize-one": "^6.0.0",
|
||||
@@ -193,7 +193,7 @@
|
||||
"mustache": "^4.2.0",
|
||||
"nanoid": "^6.0.1",
|
||||
"ol": "^10.10.0",
|
||||
"query-string": "9.4.1",
|
||||
"query-string": "9.5.0",
|
||||
"re-resizable": "^6.11.2",
|
||||
"react": "^18.3.0",
|
||||
"react-arborist": "^3.16.0",
|
||||
@@ -257,9 +257,9 @@
|
||||
"@istanbuljs/nyc-config-typescript": "^1.0.1",
|
||||
"@playwright/test": "^1.62.1",
|
||||
"@pmmmwh/react-refresh-webpack-plugin": "^0.6.2",
|
||||
"@storybook/addon-docs": "10.5.6",
|
||||
"@storybook/addon-links": "10.5.6",
|
||||
"@storybook/react-webpack5": "10.5.6",
|
||||
"@storybook/addon-docs": "10.5.7",
|
||||
"@storybook/addon-links": "10.5.7",
|
||||
"@storybook/react-webpack5": "10.5.7",
|
||||
"@storybook/test-runner": "0.24.4",
|
||||
"@svgr/webpack": "^8.1.0",
|
||||
"@swc/core": "^1.15.47",
|
||||
@@ -312,7 +312,7 @@
|
||||
"eslint-plugin-no-only-tests": "^3.4.0",
|
||||
"eslint-plugin-react-prefer-function-component": "^5.0.0",
|
||||
"eslint-plugin-react-you-might-not-need-an-effect": "^1.0.1",
|
||||
"eslint-plugin-storybook": "10.5.6",
|
||||
"eslint-plugin-storybook": "10.5.7",
|
||||
"eslint-plugin-testing-library": "^7.16.2",
|
||||
"eslint-plugin-theme-colors": "file:eslint-rules/eslint-plugin-theme-colors",
|
||||
"fetch-mock": "^12.6.0",
|
||||
@@ -343,13 +343,13 @@
|
||||
"source-map": "^0.8.0",
|
||||
"source-map-support": "^0.5.21",
|
||||
"speed-measure-webpack-plugin": "^1.6.0",
|
||||
"storybook": "10.5.6",
|
||||
"storybook": "10.5.7",
|
||||
"style-loader": "^4.0.0",
|
||||
"stylelint": "^17.14.1",
|
||||
"swc-loader": "^0.2.7",
|
||||
"ts-jest": "^29.4.12",
|
||||
"tscw-config": "^1.1.2",
|
||||
"tsx": "^4.23.5",
|
||||
"tsx": "^4.23.10",
|
||||
"typescript": "5.4.5",
|
||||
"unzipper": "^0.12.5",
|
||||
"wait-on": "^9.1.0",
|
||||
@@ -412,6 +412,9 @@
|
||||
"lerna": {
|
||||
"js-yaml": "^4.3.0"
|
||||
},
|
||||
"minimatch@>=10": {
|
||||
"brace-expansion": ">=5.0.8"
|
||||
},
|
||||
"nwsapi": "^2.2.13",
|
||||
"puppeteer": "^22.4.1",
|
||||
"tar": "^7.5.16",
|
||||
|
||||
@@ -0,0 +1,205 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import { useLayoutEffect, type ReactNode } from 'react';
|
||||
import { render, screen, act } from '@testing-library/react';
|
||||
import { theme as antdThemeImport } from 'antd';
|
||||
import { Theme } from './Theme';
|
||||
|
||||
// SupersetThemeProvider stores theme state via React.useState, then
|
||||
// registers a listener (in a useLayoutEffect, on mount) that calls
|
||||
// setThemeState whenever a *later* call to setConfig/toggleDarkMode runs
|
||||
// on the same Theme instance. Every provider currently mounted from that
|
||||
// instance listens independently, so toggling the instance updates all of
|
||||
// them, not just the most recently rendered one. Consumers
|
||||
// (docs/src/components/StorybookWrapper.jsx in particular) rely on this:
|
||||
// they call toggleDarkMode() from outside, on one or more already-mounted
|
||||
// providers sharing a single Theme instance, expecting it to propagate to
|
||||
// all of them.
|
||||
//
|
||||
// The probe below reads the theme via antd's theme.useToken() -- the same
|
||||
// context-consumption path every real antd component (Button, Input, ...)
|
||||
// uses internally -- rather than reading themeObject.theme directly off the
|
||||
// singleton. That distinction matters: React bails out of re-rendering a
|
||||
// child whose element reference didn't change (the common "static children
|
||||
// prop" case, true here since <Probe /> is passed once and never
|
||||
// recreated), UNLESS that child consumes a React Context whose value
|
||||
// changed, which bypasses the bail-out. A probe reading the plain object
|
||||
// directly would misleadingly appear "not updated" even though every real
|
||||
// themed component downstream re-renders correctly.
|
||||
function makeProbe() {
|
||||
let renderCount = 0;
|
||||
let lastColorBgBase: string | undefined;
|
||||
function Probe() {
|
||||
const { token } = antdThemeImport.useToken();
|
||||
renderCount += 1;
|
||||
lastColorBgBase = token.colorBgBase;
|
||||
return <div data-test="probe" />;
|
||||
}
|
||||
return {
|
||||
Probe,
|
||||
getRenderCount: () => renderCount,
|
||||
getLastColorBgBase: () => lastColorBgBase,
|
||||
};
|
||||
}
|
||||
|
||||
test('an already-mounted SupersetThemeProvider re-renders context-consuming children when toggleDarkMode is called on the same instance', () => {
|
||||
const themeObject = Theme.fromConfig();
|
||||
const { Probe, getRenderCount, getLastColorBgBase } = makeProbe();
|
||||
|
||||
render(
|
||||
<themeObject.SupersetThemeProvider>
|
||||
<Probe />
|
||||
</themeObject.SupersetThemeProvider>,
|
||||
);
|
||||
|
||||
expect(screen.getByTestId('probe')).toBeTruthy();
|
||||
const rendersBefore = getRenderCount();
|
||||
const tokenBefore = getLastColorBgBase();
|
||||
|
||||
act(() => {
|
||||
themeObject.toggleDarkMode(true);
|
||||
});
|
||||
|
||||
expect(getRenderCount()).toBeGreaterThan(rendersBefore);
|
||||
expect(getLastColorBgBase()).not.toBe(tokenBefore);
|
||||
});
|
||||
|
||||
test('toggleDarkMode updates every concurrently mounted provider for the same theme instance', () => {
|
||||
const themeObject = Theme.fromConfig();
|
||||
const first = makeProbe();
|
||||
const second = makeProbe();
|
||||
|
||||
render(
|
||||
<>
|
||||
<themeObject.SupersetThemeProvider>
|
||||
<first.Probe />
|
||||
</themeObject.SupersetThemeProvider>
|
||||
<themeObject.SupersetThemeProvider>
|
||||
<second.Probe />
|
||||
</themeObject.SupersetThemeProvider>
|
||||
</>,
|
||||
);
|
||||
|
||||
const firstTokenBefore = first.getLastColorBgBase();
|
||||
const secondTokenBefore = second.getLastColorBgBase();
|
||||
|
||||
act(() => {
|
||||
themeObject.toggleDarkMode(true);
|
||||
});
|
||||
|
||||
// Both providers share the same Theme instance, so both must pick up the
|
||||
// toggle -- not just whichever one rendered last.
|
||||
expect(first.getLastColorBgBase()).not.toBe(firstTokenBefore);
|
||||
expect(second.getLastColorBgBase()).not.toBe(secondTokenBefore);
|
||||
});
|
||||
|
||||
test('a toggleDarkMode call on a different theme instance does not affect a mounted provider', () => {
|
||||
const mounted = Theme.fromConfig();
|
||||
const other = Theme.fromConfig();
|
||||
const { Probe, getRenderCount, getLastColorBgBase } = makeProbe();
|
||||
|
||||
render(
|
||||
<mounted.SupersetThemeProvider>
|
||||
<Probe />
|
||||
</mounted.SupersetThemeProvider>,
|
||||
);
|
||||
|
||||
const rendersBefore = getRenderCount();
|
||||
const tokenBefore = getLastColorBgBase();
|
||||
|
||||
act(() => {
|
||||
other.toggleDarkMode(true);
|
||||
});
|
||||
|
||||
// Each Theme instance owns its own set of provider listeners; toggling a
|
||||
// *different* instance must not re-render a provider mounted from another.
|
||||
expect(getRenderCount()).toBe(rendersBefore);
|
||||
expect(getLastColorBgBase()).toBe(tokenBefore);
|
||||
});
|
||||
|
||||
test('a toggleDarkMode call after a provider unmounts does not throw and no longer updates it', () => {
|
||||
const themeObject = Theme.fromConfig();
|
||||
const { Probe, getRenderCount, getLastColorBgBase } = makeProbe();
|
||||
|
||||
const { unmount } = render(
|
||||
<themeObject.SupersetThemeProvider>
|
||||
<Probe />
|
||||
</themeObject.SupersetThemeProvider>,
|
||||
);
|
||||
|
||||
const rendersBefore = getRenderCount();
|
||||
const tokenBefore = getLastColorBgBase();
|
||||
|
||||
unmount();
|
||||
|
||||
expect(() => {
|
||||
act(() => {
|
||||
themeObject.toggleDarkMode(true);
|
||||
});
|
||||
}).not.toThrow();
|
||||
|
||||
// The unmounted provider's listener was deregistered, so it shouldn't
|
||||
// have re-rendered (or updated) in response to the toggle.
|
||||
expect(getRenderCount()).toBe(rendersBefore);
|
||||
expect(getLastColorBgBase()).toBe(tokenBefore);
|
||||
});
|
||||
|
||||
test('a toggleDarkMode call from an ancestor layout effect during the initial commit is not dropped', () => {
|
||||
// Regression harness for the initial-mount race: StorybookWrapper.jsx
|
||||
// toggles the singleton from its own layout effect (ThemeSync) as soon
|
||||
// as a demo mounts. SupersetThemeProvider must have its listener
|
||||
// registered *before* that ancestor effect fires, which only holds if
|
||||
// registration itself runs in a layout effect -- layout effects fire
|
||||
// bottom-up, so this component (nested inside the toggling ancestor)
|
||||
// registers first. If that registration ever regresses to a plain
|
||||
// useEffect, it runs after the ancestor's toggle (passive effects are
|
||||
// deferred until after all layout effects), the notification is
|
||||
// dropped, and this probe would still show the pre-toggle palette.
|
||||
const lightBaseline = Theme.fromConfig();
|
||||
const baseline = makeProbe();
|
||||
|
||||
render(
|
||||
<lightBaseline.SupersetThemeProvider>
|
||||
<baseline.Probe />
|
||||
</lightBaseline.SupersetThemeProvider>,
|
||||
);
|
||||
|
||||
const lightColorBgBase = baseline.getLastColorBgBase();
|
||||
|
||||
const themeObject = Theme.fromConfig();
|
||||
const { Probe, getLastColorBgBase } = makeProbe();
|
||||
|
||||
function AncestorToggler({ children }: { children: ReactNode }) {
|
||||
useLayoutEffect(() => {
|
||||
themeObject.toggleDarkMode(true);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
return children;
|
||||
}
|
||||
|
||||
render(
|
||||
<AncestorToggler>
|
||||
<themeObject.SupersetThemeProvider>
|
||||
<Probe />
|
||||
</themeObject.SupersetThemeProvider>
|
||||
</AncestorToggler>,
|
||||
);
|
||||
|
||||
expect(getLastColorBgBase()).not.toBe(lightColorBgBase);
|
||||
});
|
||||
@@ -243,6 +243,47 @@ test('Theme.toggleDarkMode preserves other algorithms when toggling dark mode',
|
||||
expect(serialized.algorithm).not.toContain(ThemeAlgorithm.DARK);
|
||||
});
|
||||
|
||||
test('Theme.toggleDarkMode is a no-op when the requested mode is already active', () => {
|
||||
// Pages with many live component demos (see docs/src/components/
|
||||
// StorybookWrapper.jsx's ThemeSync) mount one dark-mode-sync bridge per
|
||||
// demo, so a single toggle event can call toggleDarkMode once per demo
|
||||
// with the same isDark value. Only the first of those calls should
|
||||
// actually recompute the theme and fan out to providers.
|
||||
const theme = Theme.fromConfig();
|
||||
const setConfigSpy = jest.spyOn(theme, 'setConfig');
|
||||
|
||||
theme.toggleDarkMode(true);
|
||||
expect(setConfigSpy).toHaveBeenCalledTimes(1);
|
||||
|
||||
// Repeating the same toggle should not recompute the theme again.
|
||||
theme.toggleDarkMode(true);
|
||||
theme.toggleDarkMode(true);
|
||||
expect(setConfigSpy).toHaveBeenCalledTimes(1);
|
||||
|
||||
// Toggling to the other mode should still go through.
|
||||
theme.toggleDarkMode(false);
|
||||
expect(setConfigSpy).toHaveBeenCalledTimes(2);
|
||||
|
||||
setConfigSpy.mockRestore();
|
||||
});
|
||||
|
||||
test('Theme.toggleDarkMode no-op check accounts for other algorithms in the array', () => {
|
||||
// Start already in dark mode alongside a non-mode algorithm (compact).
|
||||
const theme = Theme.fromConfig({
|
||||
algorithm: [
|
||||
antdThemeImport.compactAlgorithm,
|
||||
antdThemeImport.darkAlgorithm,
|
||||
],
|
||||
});
|
||||
const setConfigSpy = jest.spyOn(theme, 'setConfig');
|
||||
|
||||
// Already dark, so this should be a no-op rather than reordering the array.
|
||||
theme.toggleDarkMode(true);
|
||||
expect(setConfigSpy).not.toHaveBeenCalled();
|
||||
|
||||
setConfigSpy.mockRestore();
|
||||
});
|
||||
|
||||
test('Theme.toSerializedConfig serializes theme config correctly', () => {
|
||||
const theme = Theme.fromConfig({
|
||||
token: {
|
||||
|
||||
@@ -25,7 +25,7 @@ import {
|
||||
CacheProvider as EmotionCacheProvider,
|
||||
} from '@emotion/react';
|
||||
import createCache from '@emotion/cache';
|
||||
import { noop, mergeWith } from 'lodash-es';
|
||||
import { mergeWith } from 'lodash-es';
|
||||
import { GlobalStyles } from './GlobalStyles';
|
||||
import {
|
||||
AntdThemeConfig,
|
||||
@@ -156,8 +156,8 @@ export class Theme {
|
||||
}),
|
||||
} as SupersetTheme;
|
||||
|
||||
// Update the providers with the fully formed theme
|
||||
this.updateProviders(
|
||||
// Update every mounted provider with the fully formed theme
|
||||
this.notifyProviders(
|
||||
this.theme,
|
||||
this.antdConfig,
|
||||
createCache({ key: 'superset' }),
|
||||
@@ -196,6 +196,27 @@ export class Theme {
|
||||
newConfig.algorithm = newAlgorithm;
|
||||
}
|
||||
|
||||
// Skip the update (and the notifyProviders fan-out it triggers) if the
|
||||
// theme is already in the requested mode. Docs pages mount one
|
||||
// dark-mode-sync bridge per live component demo (see
|
||||
// docs/src/components/StorybookWrapper.jsx's ThemeSync), so a single
|
||||
// toggle event calls this once per demo on the page. Without this
|
||||
// check, every one of those calls would recompute the theme and
|
||||
// notify every mounted provider, turning a single real toggle into
|
||||
// O(n^2) provider notifications across n demos.
|
||||
// Compare the algorithm sets rather than positions: reordering
|
||||
// non-mode algorithms to the front doesn't change the effective
|
||||
// theme, so it shouldn't count as a change either.
|
||||
const currentAlgorithm = this.antdConfig.algorithm;
|
||||
const algorithmUnchanged = Array.isArray(newConfig.algorithm)
|
||||
? Array.isArray(currentAlgorithm) &&
|
||||
newConfig.algorithm.length === currentAlgorithm.length &&
|
||||
newConfig.algorithm.every(alg => currentAlgorithm.includes(alg))
|
||||
: newConfig.algorithm === currentAlgorithm;
|
||||
if (algorithmUnchanged) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Update the theme with the new configuration
|
||||
this.setConfig(newConfig);
|
||||
}
|
||||
@@ -204,13 +225,29 @@ export class Theme {
|
||||
return JSON.stringify(serializeThemeConfig(this.antdConfig), null, 2);
|
||||
}
|
||||
|
||||
private updateProviders(
|
||||
// Every currently-mounted SupersetThemeProvider for this Theme instance
|
||||
// registers a listener here (see the useEffect below). A single
|
||||
// "last write wins" callback isn't enough once more than one provider can
|
||||
// be mounted from the same Theme instance at a time -- e.g. multiple live
|
||||
// component demos on one docs page -- since each render would overwrite
|
||||
// the previous provider's callback and only the most-recently-rendered
|
||||
// provider would ever hear about a setConfig/toggleDarkMode call.
|
||||
private providerListeners = new Set<
|
||||
(
|
||||
theme: SupersetTheme,
|
||||
antdConfig: AntdThemeConfig,
|
||||
emotionCache: any,
|
||||
) => void
|
||||
>();
|
||||
|
||||
private notifyProviders(
|
||||
theme: SupersetTheme,
|
||||
antdConfig: AntdThemeConfig,
|
||||
emotionCache: any,
|
||||
): void {
|
||||
noop(theme, antdConfig, emotionCache);
|
||||
// Overridden at runtime by SupersetThemeProvider using setThemeState
|
||||
this.providerListeners.forEach(listener =>
|
||||
listener(theme, antdConfig, emotionCache),
|
||||
);
|
||||
}
|
||||
|
||||
SupersetThemeProvider({ children }: { children: React.ReactNode }) {
|
||||
@@ -225,9 +262,42 @@ export class Theme {
|
||||
emotionCache: createCache({ key: 'superset' }),
|
||||
});
|
||||
|
||||
this.updateProviders = (theme, antdConfig, emotionCache) => {
|
||||
setThemeState({ theme, antdConfig, emotionCache });
|
||||
};
|
||||
// Register (and, on unmount, deregister) this provider instance's own
|
||||
// listener rather than assigning a single shared callback on every
|
||||
// render, so every concurrently mounted provider for this Theme
|
||||
// instance receives updates, not just the last one to render.
|
||||
//
|
||||
// Use useLayoutEffect (not useEffect) so registration happens in the
|
||||
// same commit phase as any layout effect elsewhere that might call
|
||||
// setConfig/toggleDarkMode on this instance during mount (e.g. the
|
||||
// docs site's dark-mode sync in StorybookWrapper.jsx, which reads the
|
||||
// toggle and pushes it onto the singleton via a layout effect of its
|
||||
// own). Layout effects run bottom-up, so a listener registered here
|
||||
// (this component is nested inside that caller) is guaranteed to be
|
||||
// in place before an ancestor's layout effect can fire and notify it.
|
||||
// If this were a passive effect instead, an ancestor's layout effect
|
||||
// could call toggleDarkMode before this listener exists, dropping that
|
||||
// notification, and the provider would render stale until a later
|
||||
// toggle.
|
||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
React.useLayoutEffect(() => {
|
||||
const listener = (
|
||||
nextTheme: SupersetTheme,
|
||||
nextAntdConfig: AntdThemeConfig,
|
||||
nextEmotionCache: any,
|
||||
) => {
|
||||
setThemeState({
|
||||
theme: nextTheme,
|
||||
antdConfig: nextAntdConfig,
|
||||
emotionCache: nextEmotionCache,
|
||||
});
|
||||
};
|
||||
this.providerListeners.add(listener);
|
||||
return () => {
|
||||
this.providerListeners.delete(listener);
|
||||
};
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<EmotionCacheProvider value={themeState.emotionCache}>
|
||||
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import { QueryFormMetric } from '@superset-ui/core';
|
||||
import { getTotalsMetrics } from './getTotalsMetrics';
|
||||
|
||||
const simpleMetric = (aggregate: string): QueryFormMetric =>
|
||||
({
|
||||
label: 'simple_metric',
|
||||
expressionType: 'SIMPLE',
|
||||
column: { column_name: 'col' },
|
||||
aggregate,
|
||||
}) as QueryFormMetric;
|
||||
|
||||
const sqlMetric = (): QueryFormMetric =>
|
||||
({
|
||||
label: 'sql_metric',
|
||||
expressionType: 'SQL',
|
||||
sqlExpression: 'SUM(col) / COUNT(*)',
|
||||
}) as QueryFormMetric;
|
||||
|
||||
const savedMetric = (): QueryFormMetric => 'saved_metric';
|
||||
|
||||
describe('getTotalsMetrics', () => {
|
||||
test('overrides the aggregate on simple (adhoc) metrics', () => {
|
||||
const [result] = getTotalsMetrics([simpleMetric('SUM')], 'AVG');
|
||||
expect(result).toEqual(
|
||||
expect.objectContaining({ aggregate: 'AVG', expressionType: 'SIMPLE' }),
|
||||
);
|
||||
});
|
||||
|
||||
test('is a no-op when the simple metric already uses the requested aggregate', () => {
|
||||
const [result] = getTotalsMetrics([simpleMetric('SUM')], 'SUM');
|
||||
expect(result).toEqual(
|
||||
expect.objectContaining({ aggregate: 'SUM', expressionType: 'SIMPLE' }),
|
||||
);
|
||||
});
|
||||
|
||||
test('leaves custom SQL metrics unchanged', () => {
|
||||
const metric = sqlMetric();
|
||||
const [result] = getTotalsMetrics([metric], 'AVG');
|
||||
expect(result).toBe(metric);
|
||||
});
|
||||
|
||||
test('leaves saved (string) metrics unchanged', () => {
|
||||
const metric = savedMetric();
|
||||
const [result] = getTotalsMetrics([metric], 'AVG');
|
||||
expect(result).toBe(metric);
|
||||
});
|
||||
|
||||
test('handles a mix of metric types, only rewriting simple metrics', () => {
|
||||
const metrics = [simpleMetric('SUM'), sqlMetric(), savedMetric()];
|
||||
const result = getTotalsMetrics(metrics, 'AVG');
|
||||
|
||||
expect(result).toHaveLength(3);
|
||||
expect(result[0]).toEqual(expect.objectContaining({ aggregate: 'AVG' }));
|
||||
expect(result[1]).toBe(metrics[1]);
|
||||
expect(result[2]).toBe(metrics[2]);
|
||||
});
|
||||
|
||||
test('returns an empty array when given no metrics', () => {
|
||||
expect(getTotalsMetrics([], 'AVG')).toEqual([]);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import { isAdhocMetricSimple, QueryFormMetric } from '@superset-ui/core';
|
||||
|
||||
export type TotalsAggregate = 'SUM' | 'AVG';
|
||||
|
||||
/**
|
||||
* Build the metrics for a chart's "Show summary" totals query, overriding
|
||||
* each Simple (adhoc) metric's aggregate function with the user-chosen
|
||||
* totals aggregate. The totals query has no GROUP BY, so the database
|
||||
* evaluates each metric fresh over all rows -- swapping the aggregate here
|
||||
* is a correct, independent computation, not a re-aggregation of
|
||||
* already-aggregated per-row values.
|
||||
*
|
||||
* Custom-SQL metrics and saved (string) metrics pass through unchanged:
|
||||
* there is no safe way to rewrite an arbitrary SQL expression's aggregate
|
||||
* function without parsing it, so the totals row keeps their own native
|
||||
* aggregate for those.
|
||||
*/
|
||||
export function getTotalsMetrics(
|
||||
metrics: QueryFormMetric[],
|
||||
aggregate: TotalsAggregate,
|
||||
): QueryFormMetric[] {
|
||||
return metrics.map(metric =>
|
||||
isAdhocMetricSimple(metric) ? { ...metric, aggregate } : metric,
|
||||
);
|
||||
}
|
||||
@@ -22,6 +22,7 @@ export * from './selectOptions';
|
||||
export * from './D3Formatting';
|
||||
export * from './expandControlConfig';
|
||||
export * from './getColorFormatters';
|
||||
export * from './getTotalsMetrics';
|
||||
export { default as mainMetric } from './mainMetric';
|
||||
export { default as columnChoices, columnsByType } from './columnChoices';
|
||||
export * from './defineSavedMetrics';
|
||||
|
||||
@@ -56,11 +56,11 @@
|
||||
"@types/json-bigint": "^1.0.4",
|
||||
"@visx/responsive": "^4.0.0",
|
||||
"ace-builds": "^1.44.0",
|
||||
"ag-grid-community": "36.0.2",
|
||||
"ag-grid-react": "36.0.2",
|
||||
"ag-grid-community": "36.1.0",
|
||||
"ag-grid-react": "36.1.0",
|
||||
"brace": "^0.11.1",
|
||||
"classnames": "^2.5.1",
|
||||
"core-js": "^3.49.0",
|
||||
"core-js": "^3.50.0",
|
||||
"csstype": "^3.2.3",
|
||||
"d3-format": "^3.1.2",
|
||||
"d3-interpolate": "^3.0.1",
|
||||
|
||||
@@ -45,6 +45,13 @@ export interface ContextMenuFilters {
|
||||
filters: BinaryQueryObjectFilterClause[];
|
||||
groupbyFieldName: string;
|
||||
adhocFilterFieldName?: string;
|
||||
/**
|
||||
* Filters scoped to the clicked x-axis value (category or time bucket),
|
||||
* as opposed to `filters`, which are scoped to the clicked series.
|
||||
* When both are present, the Drill By UI lets the user choose which
|
||||
* of the two (or both) to apply to the drilled chart.
|
||||
*/
|
||||
xAxisFilters?: BinaryQueryObjectFilterClause[];
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -57,6 +57,9 @@ export interface AceCompleterKeywordData {
|
||||
meta: string;
|
||||
docText?: string;
|
||||
docHTML?: string;
|
||||
// The label Ace displays in the autocomplete popup and passes back to
|
||||
// `insertMatch`; may differ from `value`, the text actually inserted.
|
||||
caption?: string;
|
||||
}
|
||||
|
||||
export type TextMode = OrigTextMode & { $id: string };
|
||||
|
||||
@@ -29,6 +29,9 @@ export interface AceCompleterKeywordData {
|
||||
meta: string;
|
||||
docText?: string;
|
||||
docHTML?: string;
|
||||
// The label Ace displays in the autocomplete popup and passes back to
|
||||
// `insertMatch`; may differ from `value`, the text actually inserted.
|
||||
caption?: string;
|
||||
}
|
||||
|
||||
export type TextMode = OrigTextMode & { $id: string };
|
||||
|
||||
+34
-1
@@ -17,12 +17,45 @@
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import { createRef } from 'react';
|
||||
import { render, fireEvent, screen } from '@superset-ui/core/spec';
|
||||
import { NoAnimationDropdown } from '.';
|
||||
import { MenuDotsDropdown, NoAnimationDropdown } from '.';
|
||||
|
||||
const props = {
|
||||
overlay: <div>Test Overlay</div>,
|
||||
};
|
||||
|
||||
describe('MenuDotsDropdown', () => {
|
||||
test('renders a focusable, labeled button trigger', () => {
|
||||
render(<MenuDotsDropdown {...props} />);
|
||||
expect(screen.getByTestId('dropdown-trigger')).toEqual(
|
||||
screen.getByRole('button', { name: 'Actions' }),
|
||||
);
|
||||
});
|
||||
|
||||
test('forwards a ref to the trigger so callers can focus it programmatically', () => {
|
||||
const ref = createRef<HTMLButtonElement>();
|
||||
render(<MenuDotsDropdown {...props} ref={ref} />);
|
||||
ref.current?.focus();
|
||||
expect(screen.getByTestId('dropdown-trigger')).toHaveFocus();
|
||||
});
|
||||
|
||||
test('opens the menu when activated with the keyboard', async () => {
|
||||
// Callers (e.g. the SQL Lab tab menu) open the dropdown on click, since
|
||||
// antd's default trigger is hover, which keyboard activation can't
|
||||
// reach.
|
||||
render(<MenuDotsDropdown {...props} trigger={['click']} />);
|
||||
const trigger = screen.getByTestId('dropdown-trigger');
|
||||
trigger.focus();
|
||||
// A native <button> converts an Enter keypress into a click once
|
||||
// activated, so we simulate that browser behavior directly since
|
||||
// jsdom does not implement it for us.
|
||||
fireEvent.keyDown(trigger, { key: 'Enter', code: 'Enter' });
|
||||
fireEvent.click(trigger);
|
||||
expect(await screen.findByText('Test Overlay')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
describe('NoAnimationDropdown', () => {
|
||||
test('requires children', () => {
|
||||
expect(() => {
|
||||
|
||||
@@ -16,10 +16,11 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import { ReactElement, cloneElement } from 'react';
|
||||
import { ReactElement, cloneElement, forwardRef } from 'react';
|
||||
|
||||
import { Dropdown as AntdDropdown, DropdownProps } from 'antd';
|
||||
import { styled } from '@apache-superset/core/theme';
|
||||
import { t } from '@apache-superset/core/translation';
|
||||
import { Icons } from '@superset-ui/core/components/Icons';
|
||||
import {
|
||||
IconOrientation,
|
||||
@@ -65,11 +66,14 @@ const MenuDots = styled.div`
|
||||
}
|
||||
`;
|
||||
|
||||
const MenuDotsWrapper = styled.div`
|
||||
const MenuDotsWrapper = styled.button`
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: ${({ theme }) => theme.sizeUnit * 2}px;
|
||||
padding-left: ${({ theme }) => theme.sizeUnit}px;
|
||||
border: none;
|
||||
background: transparent;
|
||||
cursor: pointer;
|
||||
`;
|
||||
|
||||
const RenderIcon = (
|
||||
@@ -84,17 +88,23 @@ const RenderIcon = (
|
||||
return component;
|
||||
};
|
||||
|
||||
export const MenuDotsDropdown = ({
|
||||
overlay,
|
||||
iconOrientation = IconOrientation.Vertical,
|
||||
...rest
|
||||
}: MenuDotsDropdownProps) => (
|
||||
export const MenuDotsDropdown = forwardRef<
|
||||
HTMLButtonElement,
|
||||
MenuDotsDropdownProps
|
||||
>(({ overlay, iconOrientation = IconOrientation.Vertical, ...rest }, ref) => (
|
||||
<AntdDropdown popupRender={() => overlay} {...rest}>
|
||||
<MenuDotsWrapper data-test="dropdown-trigger">
|
||||
<MenuDotsWrapper
|
||||
ref={ref}
|
||||
type="button"
|
||||
aria-label={t('Actions')}
|
||||
data-test="dropdown-trigger"
|
||||
>
|
||||
{RenderIcon(iconOrientation)}
|
||||
</MenuDotsWrapper>
|
||||
</AntdDropdown>
|
||||
);
|
||||
));
|
||||
|
||||
MenuDotsDropdown.displayName = 'MenuDotsDropdown';
|
||||
|
||||
export const NoAnimationDropdown = (props: NoAnimationDropdownProps) => {
|
||||
const { children, onBlur, onKeyDown, ...rest } = props;
|
||||
|
||||
+16
@@ -49,6 +49,7 @@ const titleStyles = (theme: SupersetTheme) => css`
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
padding: 0;
|
||||
font-weight: inherit;
|
||||
color: ${theme.colorText};
|
||||
background-color: ${theme.colorBgContainer};
|
||||
|
||||
@@ -127,6 +128,21 @@ export const DynamicEditableTitle = memo(
|
||||
}
|
||||
}, [currentTitle, placeholder]);
|
||||
|
||||
// Webfont metrics differ from the fallback font's, so a measurement
|
||||
// taken before fonts finish loading under- or over-sizes the input.
|
||||
// Re-measure once all fonts are ready.
|
||||
useEffect(() => {
|
||||
let cancelled = false;
|
||||
document.fonts?.ready?.then(() => {
|
||||
if (!cancelled && sizerRef.current) {
|
||||
setInputWidth(sizerRef.current.offsetWidth);
|
||||
}
|
||||
});
|
||||
return () => {
|
||||
cancelled = true;
|
||||
};
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
const inputElement = inputRef.current?.input;
|
||||
|
||||
|
||||
+18
@@ -20,6 +20,7 @@ import { ReactNode, ReactElement, memo } from 'react';
|
||||
import { t } from '@apache-superset/core/translation';
|
||||
import { css, SupersetTheme, useTheme } from '@apache-superset/core/theme';
|
||||
import { Icons } from '@superset-ui/core/components/Icons';
|
||||
import { FeatureFlag, isFeatureEnabled } from '../../utils/featureFlags';
|
||||
import type { DropdownProps } from '../Dropdown/types';
|
||||
import type { TooltipPlacement } from '../Tooltip/types';
|
||||
import type { CertifiedBadgeProps } from '../CertifiedBadge/types';
|
||||
@@ -82,6 +83,20 @@ const headerStyles = (theme: SupersetTheme) => css`
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/* Mobile consumption mode: center the title between left/right panels */
|
||||
${
|
||||
isFeatureEnabled(FeatureFlag.MobileConsumptionMode) &&
|
||||
css`
|
||||
@media (max-width: ${theme.screenSMMax}px) {
|
||||
.title-panel {
|
||||
flex: 1;
|
||||
justify-content: center;
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
`
|
||||
}
|
||||
`;
|
||||
|
||||
const buttonsStyles = (theme: SupersetTheme) => css`
|
||||
@@ -109,6 +124,7 @@ export type PageHeaderWithActionsProps = {
|
||||
showFaveStar: boolean;
|
||||
showMenuDropdown?: boolean;
|
||||
faveStarProps: FaveStarProps;
|
||||
leftPanelItems?: ReactNode;
|
||||
titlePanelAdditionalItems: ReactNode;
|
||||
rightPanelAdditionalItems: ReactNode;
|
||||
additionalActionsMenu: ReactElement;
|
||||
@@ -126,6 +142,7 @@ export const PageHeaderWithActions = memo(
|
||||
certificatiedBadgeProps,
|
||||
showFaveStar,
|
||||
faveStarProps,
|
||||
leftPanelItems,
|
||||
titlePanelAdditionalItems,
|
||||
rightPanelAdditionalItems,
|
||||
additionalActionsMenu,
|
||||
@@ -136,6 +153,7 @@ export const PageHeaderWithActions = memo(
|
||||
const theme = useTheme();
|
||||
return (
|
||||
<div css={headerStyles} className="header-with-actions">
|
||||
{leftPanelItems}
|
||||
<div className="title-panel">
|
||||
<DynamicEditableTitle {...editableTitleProps} />
|
||||
{showTitlePanelItems && (
|
||||
|
||||
+46
@@ -989,6 +989,52 @@ test('shows all options when filterOption is false', async () => {
|
||||
expect(options[0]).toHaveTextContent('Server 0');
|
||||
});
|
||||
|
||||
test('renders a server-matched option whose label diverges from the search term when filterOption is false (regression for #42041)', async () => {
|
||||
// Mirrors the real permissions-search bug: the remote fetch legitimately
|
||||
// matches the raw, underscore-containing value (e.g. a schema name like
|
||||
// "stg_silver"), but the returned option's displayed label has had
|
||||
// underscores replaced with spaces (see formatPermissionLabel in
|
||||
// features/roles/utils.ts). filterOption defaults to true, which
|
||||
// re-filters already-matched options against that same relabeled text
|
||||
// client-side, so the underscore search term never matches and the
|
||||
// legitimately fetched option gets hidden -- this is why
|
||||
// PermissionsField (features/roles/RoleFormItems.tsx) sets
|
||||
// filterOption={false}: the loader is already the authoritative filter,
|
||||
// and its match doesn't depend on the label used to render the option.
|
||||
const searchData = [{ label: 'stg silver', value: 100 }];
|
||||
const loadOptions = jest.fn(async (search: string) =>
|
||||
// totalCount must exceed the empty initial page here, otherwise
|
||||
// AsyncSelect marks allValuesLoaded and short-circuits every later
|
||||
// fetch, including the search request this test depends on.
|
||||
search === ''
|
||||
? { data: [], totalCount: 1 }
|
||||
: { data: searchData, totalCount: 1 },
|
||||
);
|
||||
|
||||
render(
|
||||
<AsyncSelect
|
||||
{...defaultProps}
|
||||
options={loadOptions}
|
||||
filterOption={false}
|
||||
/>,
|
||||
);
|
||||
await open();
|
||||
|
||||
await type('stg_silver');
|
||||
await waitFor(() =>
|
||||
expect(loadOptions).toHaveBeenCalledWith(
|
||||
'stg_silver',
|
||||
expect.anything(),
|
||||
expect.anything(),
|
||||
),
|
||||
);
|
||||
|
||||
// The backend legitimately matched and returned this option (asserted
|
||||
// above); it should render in the dropdown despite the search term using
|
||||
// underscores while the label uses spaces.
|
||||
expect(await findSelectOption('stg silver')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('preserves new option entry across search fetch when allowNewOptions is on', async () => {
|
||||
const page0Data = Array.from({ length: 10 }, (_, i) => ({
|
||||
label: `Option ${i}`,
|
||||
|
||||
@@ -57,6 +57,7 @@ export enum FeatureFlag {
|
||||
GranularExportControls = 'GRANULAR_EXPORT_CONTROLS',
|
||||
ListviewsDefaultCardView = 'LISTVIEWS_DEFAULT_CARD_VIEW',
|
||||
Matrixify = 'MATRIXIFY',
|
||||
MobileConsumptionMode = 'MOBILE_CONSUMPTION_MODE',
|
||||
ScheduledQueries = 'SCHEDULED_QUERIES',
|
||||
SemanticLayers = 'SEMANTIC_LAYERS',
|
||||
SoftDelete = 'SOFT_DELETE',
|
||||
|
||||
@@ -336,3 +336,29 @@ test('getErrorText', async () => {
|
||||
),
|
||||
).toEqual('Sorry, an unknown error occurred.');
|
||||
});
|
||||
|
||||
test('getErrorText for a non-JSON 403 response', async () => {
|
||||
// A 403 originating outside Superset (reverse proxy, WAF, SSO gateway)
|
||||
// carries an HTML or plain-text body instead of the API's JSON
|
||||
// `{"message": "Forbidden"}`, so it must fall back to the generic
|
||||
// status-derived text rather than the permission-denied copy.
|
||||
const proxyForbidden = new Response(
|
||||
'<html><head><title>403 Forbidden</title></head><body>Forbidden</body></html>',
|
||||
{
|
||||
status: 403,
|
||||
statusText: 'Forbidden',
|
||||
headers: { 'Content-Type': 'text/html' },
|
||||
},
|
||||
);
|
||||
expect(await getErrorText(proxyForbidden, 'dashboard')).toEqual(
|
||||
'Sorry, there was an error saving this dashboard: Forbidden',
|
||||
);
|
||||
|
||||
const supersetForbidden = new Response(
|
||||
JSON.stringify({ message: 'Forbidden' }),
|
||||
{ status: 403, statusText: 'FORBIDDEN' },
|
||||
);
|
||||
expect(await getErrorText(supersetForbidden, 'dashboard')).toEqual(
|
||||
'You do not have permission to edit this dashboard',
|
||||
);
|
||||
});
|
||||
|
||||
@@ -96,6 +96,7 @@ export default defineConfig({
|
||||
'**/tests/auth/**/*.spec.ts',
|
||||
'**/tests/sqllab/**/*.spec.ts',
|
||||
'**/tests/embedded/**/*.spec.ts',
|
||||
'**/tests/mobile/**/*.spec.ts',
|
||||
...(process.env.INCLUDE_EXPERIMENTAL ? [] : ['**/experimental/**']),
|
||||
],
|
||||
use: {
|
||||
@@ -156,6 +157,23 @@ export default defineConfig({
|
||||
},
|
||||
]
|
||||
: []),
|
||||
// Mobile consumption-mode tests need the MOBILE_CONSUMPTION_MODE feature
|
||||
// flag enabled in the Flask backend (the workflow's mobile step sets
|
||||
// SUPERSET_FEATURE_MOBILE_CONSUMPTION_MODE), so they only run when the
|
||||
// environment opts in. Same strict 'true' check as INCLUDE_EMBEDDED.
|
||||
...(process.env.INCLUDE_MOBILE?.toLowerCase() === 'true'
|
||||
? [
|
||||
{
|
||||
name: 'chromium-mobile',
|
||||
testMatch: '**/tests/mobile/**/*.spec.ts',
|
||||
use: {
|
||||
browserName: 'chromium' as const,
|
||||
testIdAttribute: 'data-test',
|
||||
storageState: 'playwright/.auth/user.json',
|
||||
},
|
||||
},
|
||||
]
|
||||
: []),
|
||||
],
|
||||
|
||||
// Web server setup - disabled in CI (Flask started separately in workflow)
|
||||
|
||||
@@ -0,0 +1,173 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Mobile Experience Documentation Screenshot Generator
|
||||
*
|
||||
* Captures phone-sized screenshots for the mobile consumption mode docs
|
||||
* (docs/docs/using-superset/mobile-experience.mdx). Depends on example data
|
||||
* loaded via `superset load_examples` AND the MOBILE_CONSUMPTION_MODE
|
||||
* feature flag being enabled in the target environment:
|
||||
*
|
||||
* FEATURE_FLAGS = {"MOBILE_CONSUMPTION_MODE": True}
|
||||
*
|
||||
* Run locally:
|
||||
* cd superset-frontend
|
||||
* PLAYWRIGHT_BASE_URL=http://localhost:8088 PLAYWRIGHT_ADMIN_PASSWORD=admin npm run docs:screenshots
|
||||
*
|
||||
* Screenshots are saved under docs/static/img/screenshots/mobile/.
|
||||
*/
|
||||
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { Page, test, expect } from '@playwright/test';
|
||||
import { URL } from '../../utils/urls';
|
||||
|
||||
const MOBILE_SCREENSHOTS_DIR = path.resolve(
|
||||
__dirname,
|
||||
'../../../../docs/static/img/screenshots/mobile',
|
||||
);
|
||||
// Committed to the repo alongside the generated images, but create it
|
||||
// defensively in case someone deletes the directory and re-runs this
|
||||
// generator standalone (Playwright does not create missing parent
|
||||
// directories for screenshot paths).
|
||||
fs.mkdirSync(MOBILE_SCREENSHOTS_DIR, { recursive: true });
|
||||
|
||||
// iPhone 12-class viewport; 2x scale factor for crisp docs images
|
||||
test.use({
|
||||
viewport: { width: 390, height: 844 },
|
||||
deviceScaleFactor: 2,
|
||||
hasTouch: true,
|
||||
});
|
||||
|
||||
/**
|
||||
* Waits for animations and async renders to settle before taking a
|
||||
* screenshot. ECharts entry animations, drawer transitions, and image
|
||||
* lazy-loading require a short pause that can't be expressed as a
|
||||
* deterministic wait condition.
|
||||
*/
|
||||
async function settle(page: Page, ms = 1000): Promise<void> {
|
||||
await page.waitForTimeout(ms);
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens the Sales Dashboard (from example data) at phone size and waits for
|
||||
* the stacked charts to finish rendering.
|
||||
*/
|
||||
async function openSalesDashboardMobile(page: Page): Promise<void> {
|
||||
await page.goto(URL.DASHBOARD_LIST);
|
||||
// Mobile list is card-only; cards navigate on tap (titles are plain
|
||||
// text, not links, in consumption mode)
|
||||
const dashboardCard = page.getByText('Sales Dashboard', { exact: true });
|
||||
await expect(dashboardCard.first()).toBeVisible({ timeout: 15000 });
|
||||
await dashboardCard.first().click();
|
||||
|
||||
await expect(
|
||||
page.locator('[data-test="dashboard-content-wrapper"]'),
|
||||
).toBeVisible({ timeout: 30000 });
|
||||
await expect(
|
||||
page.locator('.dashboard-component-chart-holder canvas').first(),
|
||||
).toBeVisible({ timeout: 30000 });
|
||||
}
|
||||
|
||||
test('mobile dashboard screenshot', async ({ page }) => {
|
||||
await openSalesDashboardMobile(page);
|
||||
await settle(page, 2000);
|
||||
await page.screenshot({
|
||||
path: path.join(MOBILE_SCREENSHOTS_DIR, 'mobile_dashboard.jpg'),
|
||||
type: 'jpeg',
|
||||
});
|
||||
});
|
||||
|
||||
test('mobile dashboard filter drawer screenshot', async ({ page }) => {
|
||||
await openSalesDashboardMobile(page);
|
||||
|
||||
const filterTrigger = page.locator('[data-test="mobile-filters-trigger"]');
|
||||
await expect(filterTrigger).toBeVisible({ timeout: 15000 });
|
||||
await filterTrigger.click();
|
||||
|
||||
// Wait for the drawer and its filter controls to render
|
||||
await expect(page.locator('.ant-drawer-body')).toBeVisible({
|
||||
timeout: 10000,
|
||||
});
|
||||
await expect(page.locator('[data-test="filter-bar"]')).toBeVisible({
|
||||
timeout: 10000,
|
||||
});
|
||||
// Park the pointer so no hover card is open in the capture
|
||||
await page.mouse.move(5, 830);
|
||||
await settle(page);
|
||||
await page.screenshot({
|
||||
path: path.join(MOBILE_SCREENSHOTS_DIR, 'mobile_filter_drawer.jpg'),
|
||||
type: 'jpeg',
|
||||
});
|
||||
});
|
||||
|
||||
test('mobile dashboard list screenshot', async ({ page }) => {
|
||||
await page.goto(URL.DASHBOARD_LIST);
|
||||
// Card view is forced on mobile; wait for cards to render
|
||||
await expect(page.locator('[data-test="styled-card"]').first()).toBeVisible({
|
||||
timeout: 15000,
|
||||
});
|
||||
await settle(page);
|
||||
await page.screenshot({
|
||||
path: path.join(MOBILE_SCREENSHOTS_DIR, 'mobile_dashboard_list.jpg'),
|
||||
type: 'jpeg',
|
||||
});
|
||||
});
|
||||
|
||||
test('mobile home screenshot', async ({ page }) => {
|
||||
await page.goto(URL.WELCOME);
|
||||
await expect(page.getByText('Recents')).toBeVisible({ timeout: 15000 });
|
||||
await settle(page, 2000);
|
||||
await page.screenshot({
|
||||
path: path.join(MOBILE_SCREENSHOTS_DIR, 'mobile_home.jpg'),
|
||||
type: 'jpeg',
|
||||
});
|
||||
});
|
||||
|
||||
test('mobile navigation drawer screenshot', async ({ page }) => {
|
||||
await page.goto(URL.WELCOME);
|
||||
await expect(page.getByText('Recents')).toBeVisible({ timeout: 15000 });
|
||||
|
||||
const menuButton = page.getByRole('button', { name: 'Menu' });
|
||||
await expect(menuButton).toBeVisible({ timeout: 10000 });
|
||||
await menuButton.click();
|
||||
|
||||
await expect(page.locator('.ant-drawer-body')).toBeVisible({
|
||||
timeout: 10000,
|
||||
});
|
||||
await expect(page.getByText('Dashboards').first()).toBeVisible();
|
||||
await settle(page);
|
||||
await page.screenshot({
|
||||
path: path.join(MOBILE_SCREENSHOTS_DIR, 'mobile_nav_drawer.jpg'),
|
||||
type: 'jpeg',
|
||||
});
|
||||
});
|
||||
|
||||
test('mobile unsupported route screenshot', async ({ page }) => {
|
||||
await page.goto(URL.SQLLAB);
|
||||
await expect(
|
||||
page.getByText("This view isn't available on mobile"),
|
||||
).toBeVisible({ timeout: 15000 });
|
||||
await settle(page);
|
||||
await page.screenshot({
|
||||
path: path.join(MOBILE_SCREENSHOTS_DIR, 'mobile_unsupported.jpg'),
|
||||
type: 'jpeg',
|
||||
});
|
||||
});
|
||||
@@ -103,16 +103,40 @@ export class EmbeddedPage {
|
||||
/**
|
||||
* Wait for dashboard content to render inside the iframe.
|
||||
* Looks for the grid-container which indicates charts are loading/loaded.
|
||||
*
|
||||
* Races the grid against the test app's `#error` box so an embed failure
|
||||
* surfaces its message immediately, instead of blindly timing out on the
|
||||
* grid selector and hiding the real reason.
|
||||
*/
|
||||
async waitForDashboardContent(options?: { timeout?: number }): Promise<void> {
|
||||
const frame = this.iframe;
|
||||
await frame
|
||||
const timeout = options?.timeout ?? EMBEDDED.DASHBOARD_RENDER;
|
||||
const grid = this.iframe
|
||||
.locator('.grid-container, [data-test="grid-container"]')
|
||||
.first()
|
||||
.waitFor({
|
||||
state: 'visible',
|
||||
timeout: options?.timeout ?? EMBEDDED.DASHBOARD_RENDER,
|
||||
});
|
||||
.first();
|
||||
const errorBox = this.page.locator(EmbeddedPage.SELECTORS.ERROR);
|
||||
|
||||
const ready = grid
|
||||
.waitFor({ state: 'visible', timeout })
|
||||
.then(() => 'ready' as const)
|
||||
.catch(() => 'gridTimeout' as const);
|
||||
const failed = errorBox
|
||||
.waitFor({ state: 'visible', timeout })
|
||||
.then(() => 'error' as const)
|
||||
.catch(() => 'errorTimeout' as const);
|
||||
|
||||
const outcome = await Promise.race([ready, failed]);
|
||||
if (outcome === 'ready') return;
|
||||
if (outcome === 'error') {
|
||||
const message = (await errorBox.textContent())?.trim() || 'unknown error';
|
||||
throw new Error(`Embedded dashboard failed to render: ${message}`);
|
||||
}
|
||||
const status = (
|
||||
await this.page.locator(EmbeddedPage.SELECTORS.STATUS).textContent()
|
||||
)?.trim();
|
||||
throw new Error(
|
||||
`Embedded dashboard did not render within ${timeout}ms ` +
|
||||
`(status: ${status ?? 'unknown'})`,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,162 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Regression coverage for the Drill to Detail modal's results table.
|
||||
*
|
||||
* The drill pane measures its available height with a resize detector and
|
||||
* hands it to a virtualized table, so the rows only render if the modal's
|
||||
* internal height chain (resizable wrapper -> modal container -> modal body ->
|
||||
* flex pane) actually resolves to a real height. That chain is wired together
|
||||
* with CSS selectors targeting Ant Design's internal modal classes, which
|
||||
* TypeScript cannot see and unit tests do not exercise: when the antd v6
|
||||
* upgrade renamed `.ant-modal-content` to `.ant-modal-container`, the chain
|
||||
* silently broke, the pane measured ~0, and the table briefly flashed its rows
|
||||
* before collapsing to an empty body with only the header and pagination
|
||||
* visible.
|
||||
*
|
||||
* Only a real browser sees layout, so this is pinned here rather than in the
|
||||
* DOM-contract unit suite. Because the failure mode is
|
||||
* render-then-collapse, a single "rows are visible" read could pass during
|
||||
* the initial flash — the assertion therefore lets the height settle once,
|
||||
* then requires it to hold across further spaced reads with no more
|
||||
* retrying, so a later or partial collapse cannot be masked by an early-exit
|
||||
* retry that stopped at the first passing sample.
|
||||
*
|
||||
* CI green => the drill modal's table renders rows at a stable, non-collapsed
|
||||
* height.
|
||||
* CI red => the modal height chain broke again (or drill-to-detail failed to
|
||||
* open/load at all).
|
||||
*/
|
||||
import { testWithAssets, expect } from '../../helpers/fixtures';
|
||||
import { TIMEOUT } from '../../utils/constants';
|
||||
import { DashboardPage } from '../../pages/DashboardPage';
|
||||
import { createDashboardWithCharts } from './dashboard-test-helpers';
|
||||
|
||||
const MIN_STABLE_BODY_HEIGHT = 100;
|
||||
// Max fraction the body height may drift from the settled baseline below; a
|
||||
// partial collapse (e.g. 400px -> 150px) still clears MIN_STABLE_BODY_HEIGHT
|
||||
// but fails this, so the check enforces stability, not just a floor.
|
||||
const HEIGHT_DRIFT_TOLERANCE = 0.25;
|
||||
// Extra spaced reads taken *after* the height has settled, and the gap
|
||||
// between them. These are plain assertions, not wrapped in a retrying
|
||||
// helper: once settled, a retry would return on the first passing sample
|
||||
// and could mask a collapse that only shows up later in the window.
|
||||
const HEIGHT_SAMPLE_COUNT = 2;
|
||||
const HEIGHT_SAMPLE_INTERVAL_MS = 300;
|
||||
|
||||
testWithAssets(
|
||||
'drill to detail modal renders result rows at a stable height',
|
||||
async ({ page, testAssets }) => {
|
||||
testWithAssets.setTimeout(TIMEOUT.SLOW_TEST);
|
||||
|
||||
const { dashboardId } = await createDashboardWithCharts(
|
||||
page,
|
||||
testAssets,
|
||||
testWithAssets.info(),
|
||||
{
|
||||
datasetName: 'birth_names',
|
||||
chartNamePrefix: 'drill_detail',
|
||||
dashboardTitlePrefix: 'drill_detail_modal',
|
||||
chartSpecs: [
|
||||
{
|
||||
viz_type: 'pie',
|
||||
params: {
|
||||
groupby: ['gender'],
|
||||
metric: 'count',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
);
|
||||
|
||||
const dashboard = new DashboardPage(page);
|
||||
await dashboard.gotoById(dashboardId);
|
||||
await dashboard.waitForLoad();
|
||||
await dashboard.waitForChartsToLoad();
|
||||
|
||||
// Open the chart context menu. The ECharts canvas exposes no data-test
|
||||
// hooks for its regions, so right-click the centre of the chart container;
|
||||
// the exact-text match below then works whether the click landed on a
|
||||
// slice (which adds "Drill to detail by" items) or on the chart background.
|
||||
// The first right-click after load can be swallowed by a chart re-render
|
||||
// closing the menu, so retry the click until the menu actually shows.
|
||||
const chart = page.locator('[data-test="chart-container"]').first();
|
||||
await chart.scrollIntoViewIfNeeded();
|
||||
const contextMenu = page.locator('[data-test="chart-context-menu"]');
|
||||
await expect(async () => {
|
||||
const box = await chart.boundingBox();
|
||||
if (!box) {
|
||||
throw new Error('chart container has no bounding box');
|
||||
}
|
||||
await page.mouse.click(box.x + box.width / 2, box.y + box.height / 2, {
|
||||
button: 'right',
|
||||
});
|
||||
await expect(contextMenu).toBeVisible({ timeout: 2000 });
|
||||
}).toPass({ timeout: TIMEOUT.CHART_RENDER });
|
||||
await page
|
||||
.getByRole('menuitem', { name: 'Drill to detail', exact: true })
|
||||
.click();
|
||||
|
||||
const modal = page.locator('.ant-modal:visible');
|
||||
await expect(modal).toBeVisible({ timeout: TIMEOUT.FORM_LOAD });
|
||||
|
||||
// Wait for the samples request to resolve into a rendered table: the row
|
||||
// count pill and the virtualized body both come from the loaded page.
|
||||
const tableBody = modal.locator('.virtual-grid');
|
||||
await expect(tableBody).toBeAttached({ timeout: TIMEOUT.CHART_RENDER });
|
||||
|
||||
// The regression collapses the body *after* first paint, so first let the
|
||||
// height settle above the floor (retrying is safe here: the collapse is
|
||||
// persistent, so a broken build never finds a passing read and this
|
||||
// still times out red), then, without any further retrying, take extra
|
||||
// spaced reads and require each to hold within tolerance of that settled
|
||||
// baseline — a delayed or partial collapse can no longer be masked by an
|
||||
// early-exit retry that stopped at the first passing sample.
|
||||
let baselineHeight = 0;
|
||||
await expect
|
||||
.poll(
|
||||
async () => {
|
||||
baselineHeight = (await tableBody.boundingBox())?.height ?? 0;
|
||||
return baselineHeight;
|
||||
},
|
||||
{ timeout: TIMEOUT.CHART_RENDER },
|
||||
)
|
||||
.toBeGreaterThan(MIN_STABLE_BODY_HEIGHT);
|
||||
for (let sample = 0; sample < HEIGHT_SAMPLE_COUNT; sample += 1) {
|
||||
// eslint-disable-next-line no-await-in-loop -- reads must be sequential
|
||||
// and spaced out to observe a delayed collapse; there is nothing to
|
||||
// parallelize.
|
||||
await page.waitForTimeout(HEIGHT_SAMPLE_INTERVAL_MS);
|
||||
// eslint-disable-next-line no-await-in-loop -- see above
|
||||
const box = await tableBody.boundingBox();
|
||||
const height = box?.height ?? 0;
|
||||
expect(height).toBeGreaterThan(MIN_STABLE_BODY_HEIGHT);
|
||||
expect(Math.abs(height - baselineHeight)).toBeLessThanOrEqual(
|
||||
baselineHeight * HEIGHT_DRIFT_TOLERANCE,
|
||||
);
|
||||
}
|
||||
|
||||
// And the rows are real data, not just an expanded empty scroller:
|
||||
// birth_names sample rows always carry a gender value.
|
||||
await expect(modal.getByText(/^(boy|girl)$/).first()).toBeVisible({
|
||||
timeout: TIMEOUT.API_RESPONSE,
|
||||
});
|
||||
},
|
||||
);
|
||||
@@ -0,0 +1,284 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import { test, expect, devices, Page } from '@playwright/test';
|
||||
|
||||
// NOTE: These tests exercise the mobile consumption experience and require
|
||||
// the MOBILE_CONSUMPTION_MODE feature flag to be enabled in the target
|
||||
// environment (FEATURE_FLAGS = {"MOBILE_CONSUMPTION_MODE": True}).
|
||||
import { TIMEOUT } from '../../utils/constants';
|
||||
import { URL } from '../../utils/urls';
|
||||
|
||||
/**
|
||||
* Mobile dashboard viewing tests verify that dashboards can be viewed
|
||||
* and interacted with on mobile devices.
|
||||
*
|
||||
* These tests assume the World Bank's Health sample dashboard exists.
|
||||
*/
|
||||
|
||||
// Use iPhone 12 viewport for mobile tests
|
||||
const mobileViewport = devices['iPhone 12'];
|
||||
|
||||
/**
|
||||
* Navigates to the dashboard list, clicks the first available dashboard
|
||||
* card, and waits for navigation into that dashboard. Skips the current
|
||||
* test when no dashboards are available to open.
|
||||
*/
|
||||
async function openFirstDashboard(page: Page): Promise<void> {
|
||||
await page.goto(URL.DASHBOARD_LIST);
|
||||
await page.waitForLoadState('networkidle');
|
||||
|
||||
const cards = page.locator('[data-test="styled-card"]');
|
||||
const cardCount = await cards.count();
|
||||
|
||||
test.skip(cardCount === 0, 'No dashboards available to open on mobile');
|
||||
|
||||
await cards.first().click();
|
||||
|
||||
await page.waitForURL(url => /\/dashboard\/(?!list)/.test(url.pathname), {
|
||||
timeout: TIMEOUT.PAGE_LOAD,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Navigates to the World Bank's Health dashboard and returns a locator
|
||||
* for its mobile filter button. Skips the current test when the fixture
|
||||
* has no native filters configured.
|
||||
*/
|
||||
async function getMobileFilterButton(page: Page) {
|
||||
// Navigate directly to the World Bank's Health dashboard, which this
|
||||
// spec's fixtures require, rather than an arbitrary first card from
|
||||
// the list. Whether it has native filters configured depends on the
|
||||
// fixture, so callers skip themselves when none are present.
|
||||
await page.goto('dashboard/world_health/');
|
||||
await page.waitForLoadState('networkidle');
|
||||
|
||||
// Give filters time to load
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
const filterButton = page
|
||||
.locator('[data-test="mobile-filters-trigger"]')
|
||||
.or(page.locator('[aria-label="Open filters"]'));
|
||||
|
||||
const filterCount = await filterButton.count();
|
||||
|
||||
test.skip(
|
||||
filterCount === 0,
|
||||
'world_health dashboard fixture has no native filters configured; ' +
|
||||
'cannot verify mobile filter behavior.',
|
||||
);
|
||||
|
||||
return filterButton;
|
||||
}
|
||||
|
||||
test.describe('Mobile Dashboard Viewing', () => {
|
||||
test.use({
|
||||
viewport: mobileViewport.viewport,
|
||||
userAgent: mobileViewport.userAgent,
|
||||
});
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
// Navigate to dashboard list to find a dashboard
|
||||
await page.goto(URL.DASHBOARD_LIST);
|
||||
await page.waitForLoadState('networkidle');
|
||||
});
|
||||
|
||||
test('dashboard list renders in card view on mobile', async ({ page }) => {
|
||||
// On mobile, dashboard list should show cards, not table
|
||||
// Look for card elements
|
||||
const cards = page.locator('[data-test="styled-card"]');
|
||||
|
||||
// Should have at least one card if dashboards exist
|
||||
// (This test may need adjustment based on test data availability)
|
||||
const cardCount = await cards.count();
|
||||
|
||||
// Either cards are visible, or the empty state is shown; the table
|
||||
// view must never render on mobile
|
||||
if (cardCount > 0) {
|
||||
await expect(cards.first()).toBeVisible({ timeout: TIMEOUT.PAGE_LOAD });
|
||||
} else {
|
||||
await expect(page.locator('[data-test="empty-state"]')).toBeVisible({
|
||||
timeout: TIMEOUT.PAGE_LOAD,
|
||||
});
|
||||
}
|
||||
await expect(page.locator('[data-test="listview-table"]')).toHaveCount(0);
|
||||
});
|
||||
|
||||
test('mobile search button appears in dashboard list', async ({ page }) => {
|
||||
// On mobile, the search/filter button should appear in the header
|
||||
const searchButton = page
|
||||
.locator('[aria-label="Search"]')
|
||||
.or(page.locator('[data-test="mobile-search-button"]'));
|
||||
|
||||
// Search button should be visible on mobile
|
||||
await expect(searchButton.first()).toBeVisible({
|
||||
timeout: TIMEOUT.PAGE_LOAD,
|
||||
});
|
||||
});
|
||||
|
||||
test('tapping dashboard card opens the dashboard', async ({ page }) => {
|
||||
// Find a dashboard card
|
||||
const cards = page.locator('[data-test="styled-card"]');
|
||||
const cardCount = await cards.count();
|
||||
|
||||
if (cardCount > 0) {
|
||||
// Click the first card
|
||||
await cards.first().click();
|
||||
|
||||
// Should navigate to dashboard view
|
||||
await page.waitForURL(url => /\/dashboard\/(?!list)/.test(url.pathname), {
|
||||
timeout: TIMEOUT.PAGE_LOAD,
|
||||
});
|
||||
|
||||
// Dashboard should load (look for dashboard content)
|
||||
await expect(
|
||||
page
|
||||
.locator('[data-test="dashboard-content-wrapper"]')
|
||||
.or(page.locator('.dashboard')),
|
||||
).toBeVisible({ timeout: TIMEOUT.PAGE_LOAD });
|
||||
} else {
|
||||
test.skip();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
test.describe('Mobile Dashboard Interaction', () => {
|
||||
test.use({
|
||||
viewport: mobileViewport.viewport,
|
||||
userAgent: mobileViewport.userAgent,
|
||||
});
|
||||
|
||||
// Skip this test suite if no dashboards exist
|
||||
test.beforeAll(async ({ browser }) => {
|
||||
// browser.newPage() does not inherit the project's `storageState`, so
|
||||
// it must be passed explicitly to reuse the authenticated session -
|
||||
// otherwise this check hits the login page and always finds 0 cards.
|
||||
const page = await browser.newPage({
|
||||
viewport: mobileViewport.viewport,
|
||||
userAgent: mobileViewport.userAgent,
|
||||
storageState: 'playwright/.auth/user.json',
|
||||
});
|
||||
|
||||
await page.goto(URL.DASHBOARD_LIST);
|
||||
await page.waitForLoadState('networkidle');
|
||||
|
||||
const cards = page.locator('[data-test="styled-card"]');
|
||||
const cardCount = await cards.count();
|
||||
|
||||
await page.close();
|
||||
|
||||
if (cardCount === 0) {
|
||||
test.skip();
|
||||
}
|
||||
});
|
||||
|
||||
test('dashboard loads and shows charts on mobile', async ({ page }) => {
|
||||
await openFirstDashboard(page);
|
||||
|
||||
// Dashboard content should be visible
|
||||
await expect(
|
||||
page
|
||||
.locator('[data-test="dashboard-content-wrapper"]')
|
||||
.or(page.locator('.dashboard')),
|
||||
).toBeVisible({ timeout: TIMEOUT.PAGE_LOAD });
|
||||
|
||||
// Charts should start loading (look for chart containers)
|
||||
const chartContainers = page
|
||||
.locator('[data-test="chart-container"]')
|
||||
.or(page.locator('.dashboard-chart'));
|
||||
|
||||
// Wait for at least one chart to be visible (with timeout)
|
||||
await expect(chartContainers.first()).toBeVisible({
|
||||
timeout: TIMEOUT.PAGE_LOAD * 2,
|
||||
});
|
||||
});
|
||||
|
||||
test('dashboard header shows hamburger menu on mobile', async ({ page }) => {
|
||||
await openFirstDashboard(page);
|
||||
|
||||
// Look for the hamburger menu / more actions button
|
||||
const menuButton = page
|
||||
.locator('[data-test="actions-trigger"]')
|
||||
.or(page.locator('[aria-label="Menu actions trigger"]'));
|
||||
|
||||
await expect(menuButton.first()).toBeVisible({
|
||||
timeout: TIMEOUT.PAGE_LOAD,
|
||||
});
|
||||
});
|
||||
|
||||
test('refresh dashboard works from mobile menu', async ({ page }) => {
|
||||
await openFirstDashboard(page);
|
||||
|
||||
// Open the actions menu
|
||||
const menuButton = page
|
||||
.locator('[data-test="actions-trigger"]')
|
||||
.or(page.locator('[aria-label="Menu actions trigger"]'));
|
||||
|
||||
test.skip(
|
||||
(await menuButton.count()) === 0,
|
||||
'Mobile actions menu button not found on this dashboard',
|
||||
);
|
||||
|
||||
await menuButton.first().click();
|
||||
|
||||
// Look for refresh option
|
||||
const refreshOption = page.getByText('Refresh dashboard');
|
||||
|
||||
test.skip(
|
||||
(await refreshOption.count()) === 0,
|
||||
'Refresh dashboard option not found in mobile actions menu',
|
||||
);
|
||||
|
||||
await refreshOption.click();
|
||||
|
||||
// Should show success toast or refresh the charts
|
||||
// This is hard to verify without checking network requests
|
||||
// Just verify the menu closes and we're still on the dashboard
|
||||
await page.waitForTimeout(1000);
|
||||
expect(page.url()).toMatch(/\/dashboard\/(?!list)/);
|
||||
});
|
||||
});
|
||||
|
||||
test.describe('Mobile Filter Drawer', () => {
|
||||
test.use({
|
||||
viewport: mobileViewport.viewport,
|
||||
userAgent: mobileViewport.userAgent,
|
||||
});
|
||||
|
||||
test('filter button appears on dashboards with filters', async ({ page }) => {
|
||||
const filterButton = await getMobileFilterButton(page);
|
||||
|
||||
await expect(filterButton.first()).toBeVisible();
|
||||
});
|
||||
|
||||
test('filter drawer opens when filter button is tapped', async ({ page }) => {
|
||||
const filterButton = await getMobileFilterButton(page);
|
||||
|
||||
await filterButton.first().click();
|
||||
|
||||
// Filter drawer should open
|
||||
const drawer = page
|
||||
.locator('.ant-drawer-open')
|
||||
.or(page.locator('[data-test="filter-bar"]'));
|
||||
|
||||
await expect(drawer.first()).toBeVisible({
|
||||
timeout: TIMEOUT.FORM_LOAD,
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,192 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import { test, expect, devices } from '@playwright/test';
|
||||
|
||||
// NOTE: These tests exercise the mobile consumption experience and require
|
||||
// the MOBILE_CONSUMPTION_MODE feature flag to be enabled in the target
|
||||
// environment (FEATURE_FLAGS = {"MOBILE_CONSUMPTION_MODE": True}).
|
||||
import { URL } from '../../utils/urls';
|
||||
import { TIMEOUT } from '../../utils/constants';
|
||||
|
||||
/**
|
||||
* Mobile navigation tests verify the MobileRouteGuard behavior
|
||||
* and mobile-specific navigation patterns.
|
||||
*
|
||||
* These tests run with a mobile viewport to trigger mobile-specific behavior.
|
||||
*/
|
||||
|
||||
// Use iPhone 12 viewport for mobile tests
|
||||
const mobileViewport = devices['iPhone 12'];
|
||||
|
||||
test.describe('Mobile Navigation', () => {
|
||||
test.use({
|
||||
viewport: mobileViewport.viewport,
|
||||
userAgent: mobileViewport.userAgent,
|
||||
});
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto('/');
|
||||
});
|
||||
|
||||
test('mobile viewport redirects from chart list to MobileUnsupported page', async ({
|
||||
page,
|
||||
}) => {
|
||||
// Navigate to chart list (not mobile-supported)
|
||||
await page.goto(URL.CHART_LIST);
|
||||
|
||||
// Should show the MobileUnsupported page
|
||||
await expect(
|
||||
page.getByText("This view isn't available on mobile"),
|
||||
).toBeVisible({ timeout: TIMEOUT.PAGE_LOAD });
|
||||
|
||||
// Primary action buttons should be visible
|
||||
await expect(
|
||||
page.getByRole('button', { name: 'View Dashboards' }),
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
page.getByRole('button', { name: 'Go to Welcome Page' }),
|
||||
).toBeVisible();
|
||||
});
|
||||
|
||||
test('mobile viewport allows access to dashboard list', async ({ page }) => {
|
||||
// Navigate to dashboard list (mobile-supported)
|
||||
await page.goto(URL.DASHBOARD_LIST);
|
||||
|
||||
// Should NOT show MobileUnsupported page
|
||||
await expect(
|
||||
page.getByText("This view isn't available on mobile"),
|
||||
).not.toBeVisible({ timeout: TIMEOUT.FORM_LOAD });
|
||||
|
||||
// Should show dashboard list content (look for dashboard list elements)
|
||||
await expect(
|
||||
page
|
||||
.locator('[data-test="listview-table"]')
|
||||
.or(page.locator('[data-test="styled-card"]'))
|
||||
.first(),
|
||||
).toBeVisible({ timeout: TIMEOUT.PAGE_LOAD });
|
||||
});
|
||||
|
||||
test('mobile viewport allows access to welcome page', async ({ page }) => {
|
||||
// Navigate to welcome page (mobile-supported)
|
||||
await page.goto(URL.WELCOME);
|
||||
|
||||
// Should NOT show MobileUnsupported page
|
||||
await expect(
|
||||
page.getByText("This view isn't available on mobile"),
|
||||
).not.toBeVisible({ timeout: TIMEOUT.FORM_LOAD });
|
||||
|
||||
// Should show welcome page content
|
||||
await expect(
|
||||
page.getByText('Recents').or(page.getByText('Dashboards')).first(),
|
||||
).toBeVisible({
|
||||
timeout: TIMEOUT.PAGE_LOAD,
|
||||
});
|
||||
});
|
||||
|
||||
test('View Dashboards button navigates to dashboard list', async ({
|
||||
page,
|
||||
}) => {
|
||||
// Navigate to unsupported route
|
||||
await page.goto(URL.CHART_LIST);
|
||||
|
||||
// Wait for MobileUnsupported page
|
||||
await expect(
|
||||
page.getByText("This view isn't available on mobile"),
|
||||
).toBeVisible({ timeout: TIMEOUT.PAGE_LOAD });
|
||||
|
||||
// Click View Dashboards button
|
||||
await page.getByRole('button', { name: 'View Dashboards' }).click();
|
||||
|
||||
// Should navigate to dashboard list
|
||||
await page.waitForURL(url => url.pathname.includes('dashboard/list'), {
|
||||
timeout: TIMEOUT.PAGE_LOAD,
|
||||
});
|
||||
|
||||
// Dashboard list should be accessible
|
||||
await expect(
|
||||
page
|
||||
.locator('[data-test="listview-table"]')
|
||||
.or(page.locator('[data-test="styled-card"]'))
|
||||
.first(),
|
||||
).toBeVisible({ timeout: TIMEOUT.PAGE_LOAD });
|
||||
});
|
||||
|
||||
test('Go to Welcome Page button navigates to welcome', async ({ page }) => {
|
||||
// Navigate to unsupported route
|
||||
await page.goto(URL.CHART_LIST);
|
||||
|
||||
// Wait for MobileUnsupported page
|
||||
await expect(
|
||||
page.getByText("This view isn't available on mobile"),
|
||||
).toBeVisible({ timeout: TIMEOUT.PAGE_LOAD });
|
||||
|
||||
// Click Go to Welcome Page button
|
||||
await page.getByRole('button', { name: 'Go to Welcome Page' }).click();
|
||||
|
||||
// Should navigate to welcome page
|
||||
await page.waitForURL(url => url.pathname.includes('welcome'), {
|
||||
timeout: TIMEOUT.PAGE_LOAD,
|
||||
});
|
||||
});
|
||||
|
||||
test('unsupported screen offers no bypass', async ({ page }) => {
|
||||
// The "Continue anyway" bypass was removed: desktop views are unusable
|
||||
// at phone width, and growing the viewport unblocks routes automatically
|
||||
await page.goto(URL.CHART_LIST);
|
||||
|
||||
await expect(
|
||||
page.getByText("This view isn't available on mobile"),
|
||||
).toBeVisible({ timeout: TIMEOUT.PAGE_LOAD });
|
||||
|
||||
await expect(page.getByText('Continue anyway')).toHaveCount(0);
|
||||
});
|
||||
|
||||
test('SQL Lab is not accessible on mobile', async ({ page }) => {
|
||||
// Navigate to SQL Lab (not mobile-supported)
|
||||
await page.goto(URL.SQLLAB);
|
||||
|
||||
// Should show the MobileUnsupported page
|
||||
await expect(
|
||||
page.getByText("This view isn't available on mobile"),
|
||||
).toBeVisible({ timeout: TIMEOUT.PAGE_LOAD });
|
||||
});
|
||||
});
|
||||
|
||||
test.describe('Desktop Navigation (control group)', () => {
|
||||
// Use default desktop viewport
|
||||
|
||||
test('desktop viewport allows access to all routes', async ({ page }) => {
|
||||
// Navigate to chart list
|
||||
await page.goto(URL.CHART_LIST);
|
||||
|
||||
// Should NOT show MobileUnsupported page
|
||||
await expect(
|
||||
page.getByText("This view isn't available on mobile"),
|
||||
).not.toBeVisible({ timeout: TIMEOUT.FORM_LOAD });
|
||||
|
||||
// Should show chart list content
|
||||
await expect(
|
||||
page
|
||||
.locator('[data-test="listview-table"]')
|
||||
.or(page.locator('[data-test="styled-card"]'))
|
||||
.first(),
|
||||
).toBeVisible({ timeout: TIMEOUT.PAGE_LOAD });
|
||||
});
|
||||
});
|
||||
@@ -101,7 +101,7 @@ export const EMBEDDED = {
|
||||
/** Timeout for iframe to appear in the DOM */
|
||||
IFRAME_LOAD: 15000, // 15s
|
||||
/** Timeout for dashboard content to render inside the iframe */
|
||||
DASHBOARD_RENDER: 30000, // 30s
|
||||
DASHBOARD_RENDER: 60000, // 60s (embedded dashboards are slow to render on cold CI)
|
||||
/** Timeout for individual chart cells to finish rendering */
|
||||
CHART_RENDER: TIMEOUT.CHART_RENDER,
|
||||
} as const;
|
||||
|
||||
@@ -35,8 +35,10 @@ import {
|
||||
BuildQuery,
|
||||
} from '@superset-ui/core';
|
||||
import {
|
||||
getTotalsMetrics,
|
||||
isTimeComparison,
|
||||
timeCompareOperator,
|
||||
TotalsAggregate,
|
||||
} from '@superset-ui/chart-controls';
|
||||
import { isEmpty } from 'lodash-es';
|
||||
import { TableChartFormData } from './types';
|
||||
@@ -694,6 +696,19 @@ export const buildQueryUncached: BuildQuery<TableChartFormData> = (
|
||||
formData.show_totals &&
|
||||
queryMode === QueryMode.Aggregate,
|
||||
);
|
||||
const totalsAggregate: TotalsAggregate =
|
||||
formData.totals_aggregate === 'AVG' ? 'AVG' : 'SUM';
|
||||
const totalsMetrics =
|
||||
rawSummaryColumns.length > 0
|
||||
? rawSummaryColumns.map(columnName => ({
|
||||
expressionType: 'SIMPLE' as const,
|
||||
aggregate: totalsAggregate,
|
||||
column: { column_name: columnName },
|
||||
label: columnName,
|
||||
}))
|
||||
: showAggregateTotals
|
||||
? getTotalsMetrics(metrics ?? [], totalsAggregate)
|
||||
: undefined;
|
||||
|
||||
if (showAggregateTotals || rawSummaryColumns.length > 0) {
|
||||
// Create a copy of extras without the AG Grid WHERE clause
|
||||
@@ -728,14 +743,7 @@ export const buildQueryUncached: BuildQuery<TableChartFormData> = (
|
||||
extraQueries.push({
|
||||
...queryObject,
|
||||
columns: [],
|
||||
...(rawSummaryColumns.length > 0 && {
|
||||
metrics: rawSummaryColumns.map(columnName => ({
|
||||
expressionType: 'SIMPLE' as const,
|
||||
aggregate: 'SUM' as const,
|
||||
column: { column_name: columnName },
|
||||
label: columnName,
|
||||
})),
|
||||
}),
|
||||
...(totalsMetrics ? { metrics: totalsMetrics } : {}),
|
||||
extras: totalsExtras, // Use extras with AG Grid WHERE removed
|
||||
row_limit: 0,
|
||||
row_offset: 0,
|
||||
|
||||
@@ -490,11 +490,36 @@ const config: ControlPanelConfig = {
|
||||
default: false,
|
||||
renderTrigger: true,
|
||||
description: t(
|
||||
'Show a summary row of total aggregations: the selected metrics in aggregate mode, or the sum of numeric columns in raw records mode. Note that row limit does not apply to the result.',
|
||||
'Show a summary row of total aggregations: the selected metrics in aggregate mode, or an aggregation of numeric columns in raw records mode. Note that row limit does not apply to the result.',
|
||||
),
|
||||
},
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
name: 'totals_aggregate',
|
||||
config: {
|
||||
type: 'SelectControl',
|
||||
label: t('Summary aggregation'),
|
||||
renderTrigger: true,
|
||||
description: t(
|
||||
'Aggregation used for the summary row, independent of each ' +
|
||||
"metric's own aggregation. Only applies to simple metrics " +
|
||||
'(a metric built from custom SQL keeps its own aggregation ' +
|
||||
'in the summary row).',
|
||||
),
|
||||
default: 'SUM',
|
||||
clearable: false,
|
||||
choices: [
|
||||
['SUM', t('Sum')],
|
||||
['AVG', t('Average')],
|
||||
],
|
||||
visibility: ({ controls }) =>
|
||||
Boolean(controls?.show_totals?.value),
|
||||
resetOnHide: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
name: 'show_numbered_column',
|
||||
|
||||
@@ -1560,6 +1560,74 @@ describe('plugin-chart-ag-grid-table', () => {
|
||||
expect(queries[1].columns).toEqual([]);
|
||||
expect(queries[1].metrics).toEqual(['count']);
|
||||
});
|
||||
|
||||
test('defaults aggregate-mode totals to SUM for a simple metric', () => {
|
||||
const simpleMetric = {
|
||||
expressionType: 'SIMPLE' as const,
|
||||
column: { column_name: 'sales' },
|
||||
aggregate: 'SUM' as const,
|
||||
label: 'sum_sales',
|
||||
};
|
||||
const { queries } = buildQuery(
|
||||
{
|
||||
viz_type: VizType.Table,
|
||||
datasource: '11__table',
|
||||
query_mode: QueryMode.Aggregate,
|
||||
groupby: ['state'],
|
||||
metrics: [simpleMetric],
|
||||
show_totals: true,
|
||||
},
|
||||
{ ownState: {} },
|
||||
);
|
||||
|
||||
expect(queries[1].metrics).toEqual([
|
||||
{ ...simpleMetric, aggregate: 'SUM' },
|
||||
]);
|
||||
});
|
||||
|
||||
test('overrides aggregate-mode totals to AVG for a simple metric when totals_aggregate is set', () => {
|
||||
const simpleMetric = {
|
||||
expressionType: 'SIMPLE' as const,
|
||||
column: { column_name: 'sales' },
|
||||
aggregate: 'SUM' as const,
|
||||
label: 'sum_sales',
|
||||
};
|
||||
const { queries } = buildQuery(
|
||||
{
|
||||
viz_type: VizType.Table,
|
||||
datasource: '11__table',
|
||||
query_mode: QueryMode.Aggregate,
|
||||
groupby: ['state'],
|
||||
metrics: [simpleMetric],
|
||||
show_totals: true,
|
||||
totals_aggregate: 'AVG',
|
||||
},
|
||||
{ ownState: {} },
|
||||
);
|
||||
|
||||
// Main query keeps the metric's own aggregation.
|
||||
expect(queries[0].metrics).toEqual([simpleMetric]);
|
||||
// Summary query uses the chosen totals aggregate instead.
|
||||
expect(queries[1].metrics).toEqual([
|
||||
{ ...simpleMetric, aggregate: 'AVG' },
|
||||
]);
|
||||
});
|
||||
|
||||
test('applies totals_aggregate to raw-mode summary columns', () => {
|
||||
const { queries } = buildQuery(
|
||||
{ ...rawFormData, totals_aggregate: 'AVG' },
|
||||
{ ownState: { rawSummaryColumns: ['num'] } },
|
||||
);
|
||||
|
||||
expect(queries[1].metrics).toEqual([
|
||||
{
|
||||
expressionType: 'SIMPLE',
|
||||
aggregate: 'AVG',
|
||||
column: { column_name: 'num' },
|
||||
label: 'num',
|
||||
},
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('buildQuery - server pagination row limit', () => {
|
||||
|
||||
@@ -195,7 +195,10 @@ const config: ControlPanelConfig = {
|
||||
(!control?.value ||
|
||||
(Array.isArray(control?.value) && control.value.length === 0))
|
||||
) {
|
||||
return [getTemporalColumns(state.datasource).defaultTemporalColumn];
|
||||
const { defaultTemporalColumn } = getTemporalColumns(
|
||||
state.datasource,
|
||||
);
|
||||
return defaultTemporalColumn ? [defaultTemporalColumn] : [];
|
||||
}
|
||||
return control.value;
|
||||
},
|
||||
|
||||
+98
-1
@@ -21,7 +21,8 @@ import {
|
||||
waitFor,
|
||||
cleanup,
|
||||
} from '../../../../spec/helpers/testing-library';
|
||||
import { AxisType } from '@superset-ui/core';
|
||||
import { AxisType, TimeGranularity } from '@superset-ui/core';
|
||||
import { GenericDataType } from '@apache-superset/core/common';
|
||||
import type { EChartsCoreOption } from 'echarts/core';
|
||||
import type { ECElementEvent } from 'echarts/types/src/util/types';
|
||||
import type { ReactNode } from 'react';
|
||||
@@ -655,3 +656,99 @@ test('context menu cross-filter uses the category value for a horizontal categor
|
||||
]);
|
||||
}
|
||||
});
|
||||
|
||||
// A category axis can still sit on a temporal column when the axis is
|
||||
// forced categorical (xAxisForceCategorical); the drillBy x-axis filter must
|
||||
// then bucket by the configured time grain rather than doing an exact match.
|
||||
test('drillBy filters by time bucket when a categorical axis is forced onto a temporal column', async () => {
|
||||
const onContextMenuMock = jest.fn();
|
||||
|
||||
const propsWithForcedCategoricalTemporalAxis: TimeseriesChartTransformedProps =
|
||||
{
|
||||
...defaultProps,
|
||||
onContextMenu: onContextMenuMock,
|
||||
formData: {
|
||||
...defaultFormData,
|
||||
xAxisForceCategorical: true,
|
||||
timeGrainSqla: TimeGranularity.MONTH,
|
||||
},
|
||||
coltypeMapping: { order_date: GenericDataType.Temporal },
|
||||
xAxis: {
|
||||
label: 'order_date',
|
||||
type: AxisType.Category,
|
||||
},
|
||||
};
|
||||
|
||||
render(<EchartsTimeseries {...propsWithForcedCategoricalTemporalAxis} />);
|
||||
|
||||
const contextMenuHandler = getLatestEchartProps().eventHandlers?.contextmenu;
|
||||
expect(contextMenuHandler).toBeDefined();
|
||||
await contextMenuHandler?.({
|
||||
componentType: 'series',
|
||||
seriesName: 'Sales',
|
||||
data: ['2021-02-01T00:00:00', 100],
|
||||
name: '2021-02-01T00:00:00',
|
||||
event: { stop: jest.fn(), event: { clientX: 10, clientY: 20 } },
|
||||
});
|
||||
|
||||
await waitFor(() => {
|
||||
expect(onContextMenuMock).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
const { drillBy } = onContextMenuMock.mock.calls[0][2];
|
||||
expect(drillBy.xAxisFilters).toEqual([
|
||||
{
|
||||
col: 'order_date',
|
||||
op: 'TEMPORAL_RANGE',
|
||||
val: '2021-02-01T00:00:00 : 2021-03-01T00:00:00',
|
||||
formattedVal: '2021-02-01T00:00:00',
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
// For horizontal orientation the [x, value] pair reported by ECharts is
|
||||
// swapped, so the drillBy x-axis filter must read the clicked time value
|
||||
// from the second element of the data tuple rather than the first.
|
||||
test('drillBy uses the swapped data index for a horizontal time-based axis', async () => {
|
||||
const onContextMenuMock = jest.fn();
|
||||
|
||||
const propsWithHorizontalTimeAxis: TimeseriesChartTransformedProps = {
|
||||
...defaultProps,
|
||||
onContextMenu: onContextMenuMock,
|
||||
formData: {
|
||||
...defaultFormData,
|
||||
orientation: OrientationType.Horizontal,
|
||||
},
|
||||
xAxis: {
|
||||
label: 'order_date',
|
||||
type: AxisType.Time,
|
||||
},
|
||||
};
|
||||
|
||||
render(<EchartsTimeseries {...propsWithHorizontalTimeAxis} />);
|
||||
|
||||
const contextMenuHandler = getLatestEchartProps().eventHandlers?.contextmenu;
|
||||
expect(contextMenuHandler).toBeDefined();
|
||||
await contextMenuHandler?.({
|
||||
componentType: 'series',
|
||||
seriesName: 'Sales',
|
||||
// Horizontal: value first, x (time) value second
|
||||
data: [100, '2021-02-01T00:00:00'],
|
||||
name: '2021-02-01T00:00:00',
|
||||
event: { stop: jest.fn(), event: { clientX: 10, clientY: 20 } },
|
||||
});
|
||||
|
||||
await waitFor(() => {
|
||||
expect(onContextMenuMock).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
const { drillBy } = onContextMenuMock.mock.calls[0][2];
|
||||
expect(drillBy.xAxisFilters).toEqual([
|
||||
{
|
||||
col: 'order_date',
|
||||
op: '==',
|
||||
val: '2021-02-01T00:00:00',
|
||||
formattedVal: '2021-02-01T00:00:00',
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
+56
-1
@@ -28,6 +28,7 @@ import {
|
||||
ensureIsArray,
|
||||
} from '@superset-ui/core';
|
||||
import { useTheme } from '@apache-superset/core/theme';
|
||||
import { GenericDataType } from '@apache-superset/core/common';
|
||||
import type {
|
||||
ECElementEvent,
|
||||
ViewRootGroup,
|
||||
@@ -43,6 +44,7 @@ import {
|
||||
} from './percentChange';
|
||||
import { OrientationType, TimeseriesChartTransformedProps } from './types';
|
||||
import { formatSeriesName } from '../utils/series';
|
||||
import { getTemporalXAxisDrillByFilter } from '../utils/xAxisDrillByFilter';
|
||||
import { ExtraControls } from '../components/ExtraControls';
|
||||
|
||||
const TIMER_DURATION = 300;
|
||||
@@ -507,6 +509,55 @@ export default function EchartsTimeseries({
|
||||
});
|
||||
});
|
||||
|
||||
// Filters for the clicked x-axis value, so Drill By can subset the
|
||||
// drilled data to the clicked bar/point rather than only the series
|
||||
const xAxisFilters: BinaryQueryObjectFilterClause[] = [];
|
||||
const xAxisCol =
|
||||
// if the xAxis is '__timestamp', granularity_sqla will be the column of filter
|
||||
xAxis.label === DTTM_ALIAS ? formData.granularitySqla : xAxis.label;
|
||||
if (data && xAxis.type === AxisType.Time && xAxisCol) {
|
||||
// For horizontal orientation the [x, value] pair is swapped
|
||||
const xValue = Array.isArray(data)
|
||||
? data[categoryAxisValueIndex]
|
||||
: data;
|
||||
const xAxisFilter = getTemporalXAxisDrillByFilter(
|
||||
xAxisCol,
|
||||
xValue,
|
||||
formData.timeGrainSqla,
|
||||
String(xValueFormatter(xValue as number)),
|
||||
);
|
||||
if (xAxisFilter) {
|
||||
xAxisFilters.push(xAxisFilter);
|
||||
}
|
||||
} else if (xAxis.type === AxisType.Category && xAxisCol) {
|
||||
const categoryAxisValue = getCategoryAxisValue(
|
||||
data,
|
||||
eventParams.name,
|
||||
);
|
||||
if (categoryAxisValue !== undefined) {
|
||||
// A category axis can still sit on a temporal column when the
|
||||
// axis is forced categorical; filter by time bucket in that case
|
||||
const xAxisFilter =
|
||||
coltypeMapping?.[getColumnLabel(xAxis.label)] ===
|
||||
GenericDataType.Temporal
|
||||
? getTemporalXAxisDrillByFilter(
|
||||
xAxisCol,
|
||||
categoryAxisValue,
|
||||
formData.timeGrainSqla,
|
||||
String(eventParams.name ?? categoryAxisValue),
|
||||
)
|
||||
: {
|
||||
col: xAxisCol,
|
||||
op: '==' as const,
|
||||
val: categoryAxisValue,
|
||||
formattedVal: String(categoryAxisValue),
|
||||
};
|
||||
if (xAxisFilter) {
|
||||
xAxisFilters.push(xAxisFilter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Provide cross-filter for dimensions OR categorical X-axis (issue #25334)
|
||||
let crossFilter;
|
||||
if (hasDimensions) {
|
||||
@@ -526,7 +577,11 @@ export default function EchartsTimeseries({
|
||||
|
||||
onContextMenu(pointerEvent.clientX, pointerEvent.clientY, {
|
||||
drillToDetail: drillToDetailFilters,
|
||||
drillBy: { filters: drillByFilters, groupbyFieldName: 'groupby' },
|
||||
drillBy: {
|
||||
filters: drillByFilters,
|
||||
groupbyFieldName: 'groupby',
|
||||
...(xAxisFilters.length > 0 && { xAxisFilters }),
|
||||
},
|
||||
crossFilter,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -182,6 +182,50 @@ function getSymbolMarker(symbol: string, color: string) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Given the fully-built ECharts series (each already carrying its resolved
|
||||
* `stack` id, see `getTimeCompareStackId`), find the largest per-index total
|
||||
* across all series sharing a stack, then return the largest such total
|
||||
* across all stacks. Series without a `stack` id (e.g. annotation layers)
|
||||
* are ignored since they aren't part of any stacked total.
|
||||
*/
|
||||
function getMaxStackedValueByStack(
|
||||
series: SeriesOption[],
|
||||
isHorizontal: boolean,
|
||||
): number {
|
||||
const totalsByStack = new Map<string, number[]>();
|
||||
series.forEach(entry => {
|
||||
const rawStackId = (entry as { stack?: unknown }).stack;
|
||||
const stackId = typeof rawStackId === 'string' ? rawStackId : undefined;
|
||||
if (!stackId || !Array.isArray(entry.data)) return;
|
||||
const totals = totalsByStack.get(stackId) ?? [];
|
||||
(entry.data as unknown[]).forEach((datum, idx) => {
|
||||
let value: unknown = datum;
|
||||
if (Array.isArray(datum)) {
|
||||
value = isHorizontal ? datum[0] : datum[1];
|
||||
} else if (datum && typeof datum === 'object' && 'value' in datum) {
|
||||
const rawValue = (datum as { value: unknown }).value;
|
||||
if (Array.isArray(rawValue)) {
|
||||
value = isHorizontal ? rawValue[0] : rawValue[1];
|
||||
} else {
|
||||
value = rawValue;
|
||||
}
|
||||
}
|
||||
if (typeof value === 'number' && !Number.isNaN(value)) {
|
||||
totals[idx] = (totals[idx] ?? 0) + value;
|
||||
}
|
||||
});
|
||||
totalsByStack.set(stackId, totals);
|
||||
});
|
||||
let max = Number.NEGATIVE_INFINITY;
|
||||
totalsByStack.forEach(totals => {
|
||||
totals.forEach(value => {
|
||||
if (value > max) max = value;
|
||||
});
|
||||
});
|
||||
return max;
|
||||
}
|
||||
|
||||
export default function transformProps(
|
||||
chartProps: EchartsTimeseriesChartProps,
|
||||
): TimeseriesChartTransformedProps {
|
||||
@@ -783,6 +827,14 @@ export default function transformProps(
|
||||
|
||||
series.unshift(baselineSeries);
|
||||
}
|
||||
|
||||
// Snapshot the observation-series count before annotation layers are
|
||||
// appended below. Annotation series (formula/interval/event/timeseries)
|
||||
// carry their own configured values, which the Y axis clamp further
|
||||
// below must not rewrite, or an annotation could be moved to a location
|
||||
// that doesn't match its configuration.
|
||||
const observationSeriesCount = series.length;
|
||||
|
||||
const selectedValues = (filterState.selectedValues || []).reduce(
|
||||
(acc: Record<string, number>, selectedValue: string) => {
|
||||
const index = series.findIndex(({ name }) => name === selectedValue);
|
||||
@@ -875,7 +927,38 @@ export default function transformProps(
|
||||
// default to 0-100% range when doing row-level contribution chart
|
||||
if ((contributionMode === 'row' || isAreaExpand) && stack) {
|
||||
if (yAxisMin === undefined) yAxisMin = 0;
|
||||
if (yAxisMax === undefined) yAxisMax = 1;
|
||||
if (yAxisMax === undefined) {
|
||||
if (contributionMode === 'row') {
|
||||
// Contribution percentages are normalized so each stacked row should
|
||||
// sum to 1, but floating point rounding can push the actual stacked
|
||||
// total fractionally above 1 (e.g. 1.0000000000000002). Hard-capping
|
||||
// the axis max at exactly 1 in that case causes echarts to clip the
|
||||
// topmost stacked segment entirely rather than just rounding the
|
||||
// pixel width, which is most visible in horizontal orientation where
|
||||
// this axis is swapped onto the x-axis. Pad the max up to the actual
|
||||
// stacked total when it exceeds 1 so no segment gets clipped.
|
||||
//
|
||||
// This padding only applies in row-contribution mode: for an Expand
|
||||
// ("100% stacked") chart, `sortedTotalValues` holds the raw,
|
||||
// pre-normalization row totals (e.g. 100), not values near 1, so
|
||||
// padding against them here would stretch the axis out to the raw
|
||||
// total instead of the intended 0-1 range.
|
||||
//
|
||||
// `sortedTotalValues` sums every series value per row regardless of
|
||||
// which ECharts stack it belongs to, but with time_compare each
|
||||
// comparison period is its own independently-normalized stack (see
|
||||
// getTimeCompareStackId), so a chart with N comparison periods would
|
||||
// sum to ~N instead of ~1. Compute the max per stack instead, using
|
||||
// the already-built series (which carry the resolved stack ids).
|
||||
const stackedTotalMax = getMaxStackedValueByStack(series, isHorizontal);
|
||||
yAxisMax =
|
||||
Number.isFinite(stackedTotalMax) && stackedTotalMax > 1
|
||||
? stackedTotalMax
|
||||
: 1;
|
||||
} else {
|
||||
yAxisMax = 1;
|
||||
}
|
||||
}
|
||||
} else if (
|
||||
logAxis &&
|
||||
yAxisMin === undefined &&
|
||||
@@ -911,6 +994,60 @@ export default function transformProps(
|
||||
}
|
||||
}
|
||||
|
||||
// Whenever a Y axis bound is defined, whether explicitly configured or
|
||||
// derived above from the data, clamp series values to those bounds
|
||||
// instead of leaving raw out-of-range values in place. ECharts axis
|
||||
// clipping can otherwise drop an out-of-bounds point (and the line
|
||||
// segments around it) entirely rather than truncating it at the
|
||||
// boundary (see https://github.com/apache/superset/issues/27449).
|
||||
if (yAxisMin !== undefined || yAxisMax !== undefined) {
|
||||
const valueIndex = isHorizontal ? 0 : 1;
|
||||
type AxisValue = string | number | null | undefined;
|
||||
type AxisPoint = AxisValue[];
|
||||
const clampAxisValue = (value: AxisValue): AxisValue => {
|
||||
if (typeof value !== 'number' || Number.isNaN(value)) return value;
|
||||
let clamped = value;
|
||||
if (yAxisMin !== undefined) clamped = Math.max(clamped, yAxisMin);
|
||||
if (yAxisMax !== undefined) clamped = Math.min(clamped, yAxisMax);
|
||||
return clamped;
|
||||
};
|
||||
const clampPoint = (point: AxisPoint): AxisPoint => {
|
||||
const newPoint = [...point];
|
||||
newPoint[valueIndex] = clampAxisValue(newPoint[valueIndex]);
|
||||
return newPoint;
|
||||
};
|
||||
series.forEach((s, index) => {
|
||||
// Skip annotation series appended above; only clamp the chart's own
|
||||
// observation/legend/baseline series.
|
||||
if (index >= observationSeriesCount) return;
|
||||
if (!Array.isArray(s.data)) return;
|
||||
const clampedData = (
|
||||
s.data as (AxisPoint | Record<string, unknown>)[]
|
||||
).map(point => {
|
||||
if (Array.isArray(point)) {
|
||||
return clampPoint(point);
|
||||
}
|
||||
// Some series paths (e.g. colorByPrimaryAxis, or negative bar
|
||||
// label positioning) wrap the tuple in an object of the shape
|
||||
// `{ value: [x, y], ... }` instead of passing the tuple
|
||||
// directly; clamp the wrapped tuple in place so those points
|
||||
// aren't skipped and left to be dropped by ECharts axis clipping.
|
||||
if (
|
||||
point &&
|
||||
typeof point === 'object' &&
|
||||
Array.isArray((point as { value?: unknown }).value)
|
||||
) {
|
||||
return {
|
||||
...point,
|
||||
value: clampPoint((point as { value: AxisPoint }).value),
|
||||
};
|
||||
}
|
||||
return point;
|
||||
});
|
||||
s.data = clampedData as typeof s.data;
|
||||
});
|
||||
}
|
||||
|
||||
// A dashboard-level time grain override (e.g. via a filter or the temporal
|
||||
// range control) is delivered in extraFormData and should take precedence
|
||||
// over the chart's own time grain when formatting temporal axes/tooltips.
|
||||
|
||||
@@ -413,7 +413,14 @@ export function extractDataTotalValues(
|
||||
return prev;
|
||||
}
|
||||
const value = datum[curr] || 0;
|
||||
return prev + (value as number);
|
||||
// Query results with integers beyond Number.MAX_SAFE_INTEGER are
|
||||
// parsed as native BigInt (see
|
||||
// packages/superset-ui-core/src/connection/callApi/parseResponse.ts).
|
||||
// Normalize to Number before summing so BigInt and Number values
|
||||
// can be combined without throwing (see #36401).
|
||||
const numericValue =
|
||||
typeof value === 'bigint' ? Number(value) : (value as number);
|
||||
return prev + numericValue;
|
||||
}, 0);
|
||||
totalStackedValues.push(values);
|
||||
thresholdValues.push(((percentageThreshold || 0) / 100) * values);
|
||||
@@ -623,13 +630,25 @@ export function extractSeries(
|
||||
xAxisType,
|
||||
} = opts;
|
||||
if (data.length === 0) return [[], [], undefined];
|
||||
const rows: DataRecord[] = data.map(datum => ({
|
||||
...datum,
|
||||
[xAxis]:
|
||||
const rows: DataRecord[] = data.map(datum => {
|
||||
// Query results with integers beyond Number.MAX_SAFE_INTEGER are
|
||||
// parsed as native BigInt (see
|
||||
// packages/superset-ui-core/src/connection/callApi/parseResponse.ts).
|
||||
// Normalize every metric value to Number here, before sorting/
|
||||
// aggregation (sortAndFilterSeries, sortRows) and stream-mode baseline
|
||||
// calculations (getBaselineSeriesForStream) run, so BigInt and Number
|
||||
// values can be combined without throwing (see #36401).
|
||||
const normalized: DataRecord = {};
|
||||
Object.keys(datum).forEach(key => {
|
||||
const value = datum[key];
|
||||
normalized[key] = typeof value === 'bigint' ? Number(value) : value;
|
||||
});
|
||||
normalized[xAxis] =
|
||||
datum[xAxis] === null && xAxisType === AxisType.Category
|
||||
? NULL_STRING
|
||||
: datum[xAxis],
|
||||
}));
|
||||
: normalized[xAxis];
|
||||
return normalized;
|
||||
});
|
||||
const sortedSeries = sortAndFilterSeries(
|
||||
rows,
|
||||
xAxis,
|
||||
@@ -678,7 +697,17 @@ export function extractSeries(
|
||||
stack === StackControlsValue.Expand &&
|
||||
totalStackedValue !== undefined
|
||||
) {
|
||||
value = ((value || 0) as number) / totalStackedValue;
|
||||
// Query results with integers beyond Number.MAX_SAFE_INTEGER are
|
||||
// parsed as native BigInt (see
|
||||
// packages/superset-ui-core/src/connection/callApi/parseResponse.ts).
|
||||
// totalStackedValue is always a Number (extractDataTotalValues
|
||||
// normalizes it), so dividing a raw BigInt datum value by it
|
||||
// throws; normalize to Number first (see #36401).
|
||||
const numericValue =
|
||||
typeof value === 'bigint'
|
||||
? Number(value)
|
||||
: ((value || 0) as number);
|
||||
value = numericValue / totalStackedValue;
|
||||
}
|
||||
return [row[xAxis], value];
|
||||
})
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
* under the License.
|
||||
*/
|
||||
import { DataRecord, DataRecordValue } from '@superset-ui/core';
|
||||
import { groupBy as _groupBy, transform } from 'lodash-es';
|
||||
|
||||
export type TreeNode = {
|
||||
name: DataRecordValue;
|
||||
@@ -31,6 +30,47 @@ function getMetricValue(datum: DataRecord, metric: string) {
|
||||
return typeof datum[metric] === 'number' ? (datum[metric] as number) : 0;
|
||||
}
|
||||
|
||||
// Groups records by the raw value of `groupByKey`, keyed with a Map instead
|
||||
// of a plain object. A plain-object accumulator (e.g. lodash's `groupBy`)
|
||||
// has to coerce every key to a string to use it as a property name, so a SQL
|
||||
// NULL and the literal string "null" both collapse to the same "null" key
|
||||
// and get merged into a single group. A Map keeps them as distinct keys, so
|
||||
// null filtering stays deterministic regardless of what else is in the
|
||||
// column.
|
||||
//
|
||||
// `Date` values need special handling: a `Map` compares object keys by
|
||||
// identity, not value, so two separately-parsed `Date` instances for the
|
||||
// same timestamp would otherwise land in different groups. Canonicalizing
|
||||
// by epoch time keeps identical timestamps together while still keeping
|
||||
// `null` and `'null'` distinct.
|
||||
function groupByValue(
|
||||
data: DataRecord[],
|
||||
groupByKey: string,
|
||||
): Map<DataRecordValue, DataRecord[]> {
|
||||
const groups = new Map<DataRecordValue, DataRecord[]>();
|
||||
const keysByCanonicalTime = new Map<number, DataRecordValue>();
|
||||
data.forEach(datum => {
|
||||
const rawKey = datum[groupByKey];
|
||||
let key = rawKey;
|
||||
if (rawKey instanceof Date) {
|
||||
const time = rawKey.getTime();
|
||||
const existingKey = keysByCanonicalTime.get(time);
|
||||
if (existingKey !== undefined) {
|
||||
key = existingKey;
|
||||
} else {
|
||||
keysByCanonicalTime.set(time, rawKey);
|
||||
}
|
||||
}
|
||||
const group = groups.get(key);
|
||||
if (group) {
|
||||
group.push(datum);
|
||||
} else {
|
||||
groups.set(key, [datum]);
|
||||
}
|
||||
});
|
||||
return groups;
|
||||
}
|
||||
|
||||
export function treeBuilder(
|
||||
data: DataRecord[],
|
||||
groupBy: string[],
|
||||
@@ -39,57 +79,52 @@ export function treeBuilder(
|
||||
filterNullNames?: boolean,
|
||||
): TreeNode[] {
|
||||
const [curGroupBy, ...restGroupby] = groupBy;
|
||||
const curData = _groupBy(data, curGroupBy);
|
||||
const nodes = transform(
|
||||
curData,
|
||||
(result, value, key) => {
|
||||
const name = curData[key][0][curGroupBy]!;
|
||||
if (!restGroupby.length) {
|
||||
(value ?? []).forEach(datum => {
|
||||
const metricValue = getMetricValue(datum, metric);
|
||||
const secondaryValue = secondaryMetric
|
||||
? getMetricValue(datum, secondaryMetric)
|
||||
: metricValue;
|
||||
const item = {
|
||||
name,
|
||||
value: metricValue,
|
||||
secondaryValue,
|
||||
groupBy: curGroupBy,
|
||||
};
|
||||
result.push(item);
|
||||
});
|
||||
} else {
|
||||
// Children are already null-filtered by the recursive call, so the
|
||||
// parent's value/secondaryValue exclude hidden nulls. This keeps the
|
||||
// parent arc sized to its visible children (no empty gap).
|
||||
const children = treeBuilder(
|
||||
value,
|
||||
restGroupby,
|
||||
metric,
|
||||
secondaryMetric,
|
||||
filterNullNames,
|
||||
);
|
||||
const metricValue = children.reduce(
|
||||
(prev, cur) => prev + (cur.value as number),
|
||||
0,
|
||||
);
|
||||
const curData = groupByValue(data, curGroupBy);
|
||||
const nodes: TreeNode[] = [];
|
||||
curData.forEach((value, name) => {
|
||||
if (!restGroupby.length) {
|
||||
value.forEach(datum => {
|
||||
const metricValue = getMetricValue(datum, metric);
|
||||
const secondaryValue = secondaryMetric
|
||||
? children.reduce(
|
||||
(prev, cur) => prev + (cur.secondaryValue as number),
|
||||
0,
|
||||
)
|
||||
? getMetricValue(datum, secondaryMetric)
|
||||
: metricValue;
|
||||
result.push({
|
||||
nodes.push({
|
||||
name,
|
||||
children,
|
||||
value: metricValue,
|
||||
secondaryValue,
|
||||
groupBy: curGroupBy,
|
||||
});
|
||||
}
|
||||
},
|
||||
[] as TreeNode[],
|
||||
);
|
||||
});
|
||||
} else {
|
||||
// Children are already null-filtered by the recursive call, so the
|
||||
// parent's value/secondaryValue exclude hidden nulls. This keeps the
|
||||
// parent arc sized to its visible children (no empty gap).
|
||||
const children = treeBuilder(
|
||||
value,
|
||||
restGroupby,
|
||||
metric,
|
||||
secondaryMetric,
|
||||
filterNullNames,
|
||||
);
|
||||
const metricValue = children.reduce(
|
||||
(prev, cur) => prev + (cur.value as number),
|
||||
0,
|
||||
);
|
||||
const secondaryValue = secondaryMetric
|
||||
? children.reduce(
|
||||
(prev, cur) => prev + (cur.secondaryValue as number),
|
||||
0,
|
||||
)
|
||||
: metricValue;
|
||||
nodes.push({
|
||||
name,
|
||||
children,
|
||||
value: metricValue,
|
||||
secondaryValue,
|
||||
groupBy: curGroupBy,
|
||||
});
|
||||
}
|
||||
});
|
||||
// Filter at every level so single-level charts and root nodes are covered,
|
||||
// not just nested children. A parent whose children were all null-filtered
|
||||
// is dropped too: keeping it would leave a zero-value arc that yields a NaN
|
||||
|
||||
@@ -0,0 +1,164 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import {
|
||||
BinaryQueryObjectFilterClause,
|
||||
QueryFormColumn,
|
||||
TimeGranularity,
|
||||
} from '@superset-ui/core';
|
||||
|
||||
const DAY_MS = 24 * 60 * 60 * 1000;
|
||||
|
||||
/**
|
||||
* Format a Date as a naive ISO datetime string (UTC, no timezone suffix),
|
||||
* the format Superset's time range parser expects, e.g. "2021-01-01T00:00:00".
|
||||
* Sub-second precision is preserved when present (e.g.
|
||||
* "2021-01-01T00:00:00.123") so exact-match filters on high-frequency
|
||||
* timestamps don't get truncated to the containing second.
|
||||
*/
|
||||
export const formatNaiveDateTime = (date: Date): string => {
|
||||
const iso = date.toISOString();
|
||||
return date.getUTCMilliseconds() === 0 ? iso.slice(0, 19) : iso.slice(0, 23);
|
||||
};
|
||||
|
||||
/**
|
||||
* Given the start (label) of a time bucket and its time grain, return the
|
||||
* [since, until) range covering the bucket, using calendar-aware UTC
|
||||
* arithmetic. Week-ending grains are labeled by the last day of the bucket,
|
||||
* so their range extends backwards from the label. Returns undefined for
|
||||
* unknown grains.
|
||||
*/
|
||||
export const getTimeBucketRange = (
|
||||
bucketLabel: Date,
|
||||
grain: TimeGranularity,
|
||||
): { since: Date; until: Date } | undefined => {
|
||||
const until = new Date(bucketLabel.getTime());
|
||||
switch (grain) {
|
||||
case TimeGranularity.SECOND:
|
||||
until.setUTCSeconds(until.getUTCSeconds() + 1);
|
||||
break;
|
||||
case TimeGranularity.MINUTE:
|
||||
until.setUTCMinutes(until.getUTCMinutes() + 1);
|
||||
break;
|
||||
case TimeGranularity.FIVE_MINUTES:
|
||||
until.setUTCMinutes(until.getUTCMinutes() + 5);
|
||||
break;
|
||||
case TimeGranularity.TEN_MINUTES:
|
||||
until.setUTCMinutes(until.getUTCMinutes() + 10);
|
||||
break;
|
||||
case TimeGranularity.FIFTEEN_MINUTES:
|
||||
until.setUTCMinutes(until.getUTCMinutes() + 15);
|
||||
break;
|
||||
case TimeGranularity.THIRTY_MINUTES:
|
||||
until.setUTCMinutes(until.getUTCMinutes() + 30);
|
||||
break;
|
||||
case TimeGranularity.HOUR:
|
||||
until.setUTCHours(until.getUTCHours() + 1);
|
||||
break;
|
||||
case TimeGranularity.DATE:
|
||||
case TimeGranularity.DAY:
|
||||
until.setUTCDate(until.getUTCDate() + 1);
|
||||
break;
|
||||
case TimeGranularity.WEEK:
|
||||
case TimeGranularity.WEEK_STARTING_SUNDAY:
|
||||
case TimeGranularity.WEEK_STARTING_MONDAY:
|
||||
until.setUTCDate(until.getUTCDate() + 7);
|
||||
break;
|
||||
case TimeGranularity.WEEK_ENDING_SATURDAY:
|
||||
case TimeGranularity.WEEK_ENDING_SUNDAY:
|
||||
// These buckets are labeled with their last day: the bucket spans
|
||||
// the 6 days before the label plus the label day itself.
|
||||
until.setUTCDate(until.getUTCDate() + 1);
|
||||
return { since: new Date(bucketLabel.getTime() - 6 * DAY_MS), until };
|
||||
case TimeGranularity.MONTH:
|
||||
until.setUTCMonth(until.getUTCMonth() + 1);
|
||||
break;
|
||||
case TimeGranularity.QUARTER:
|
||||
until.setUTCMonth(until.getUTCMonth() + 3);
|
||||
break;
|
||||
case TimeGranularity.YEAR:
|
||||
until.setUTCFullYear(until.getUTCFullYear() + 1);
|
||||
break;
|
||||
default:
|
||||
return undefined;
|
||||
}
|
||||
return { since: new Date(bucketLabel.getTime()), until };
|
||||
};
|
||||
|
||||
// Matches an explicit timezone designator (Z or ±HH:MM/±HHMM) at the end of
|
||||
// a datetime string.
|
||||
const TIMEZONE_SUFFIX_RE = /(Z|[+-]\d{2}:?\d{2})$/;
|
||||
|
||||
/**
|
||||
* Parse a datetime string the same way regardless of the host's local
|
||||
* timezone. Superset's backend returns naive datetime strings (no timezone
|
||||
* designator) that represent UTC instants; passing those directly to `new
|
||||
* Date()` would interpret them as local wall-clock time and shift the
|
||||
* result by the browser's UTC offset. Strings that already carry an
|
||||
* explicit timezone designator are parsed as-is.
|
||||
*/
|
||||
const parseAsUtc = (value: string): Date =>
|
||||
new Date(TIMEZONE_SUFFIX_RE.test(value) ? value : `${value}Z`);
|
||||
|
||||
/**
|
||||
* Build a drill-by filter clause matching the clicked value on a temporal
|
||||
* x-axis. When a known time grain is active, the clause is a TEMPORAL_RANGE
|
||||
* covering the clicked bucket; otherwise it falls back to an exact match on
|
||||
* the timestamp.
|
||||
*/
|
||||
export const getTemporalXAxisDrillByFilter = (
|
||||
col: QueryFormColumn,
|
||||
value: unknown,
|
||||
grain?: TimeGranularity,
|
||||
formattedVal?: string,
|
||||
): BinaryQueryObjectFilterClause | undefined => {
|
||||
if (
|
||||
!col ||
|
||||
(typeof value !== 'number' &&
|
||||
typeof value !== 'string' &&
|
||||
!(value instanceof Date))
|
||||
) {
|
||||
return undefined;
|
||||
}
|
||||
let bucketLabel: Date;
|
||||
if (value instanceof Date) {
|
||||
bucketLabel = value;
|
||||
} else if (typeof value === 'string') {
|
||||
bucketLabel = parseAsUtc(value);
|
||||
} else {
|
||||
bucketLabel = new Date(value);
|
||||
}
|
||||
if (Number.isNaN(bucketLabel.getTime())) {
|
||||
return undefined;
|
||||
}
|
||||
const range = grain ? getTimeBucketRange(bucketLabel, grain) : undefined;
|
||||
if (!range) {
|
||||
return {
|
||||
col,
|
||||
op: '==',
|
||||
val: formatNaiveDateTime(bucketLabel),
|
||||
formattedVal,
|
||||
};
|
||||
}
|
||||
return {
|
||||
col,
|
||||
op: 'TEMPORAL_RANGE',
|
||||
val: `${formatNaiveDateTime(range.since)} : ${formatNaiveDateTime(range.until)}`,
|
||||
formattedVal,
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,57 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import { validateNonEmpty } from '@superset-ui/core';
|
||||
import {
|
||||
ControlPanelState,
|
||||
ControlState,
|
||||
Dataset,
|
||||
TestDataset,
|
||||
} from '@superset-ui/chart-controls';
|
||||
import controlPanel from '../../src/BoxPlot/controlPanel';
|
||||
|
||||
const getColumnsInitialValue = (datasource: Dataset) => {
|
||||
const initialValue = controlPanel.controlOverrides?.columns
|
||||
?.initialValue as unknown as (
|
||||
control: ControlState,
|
||||
state: ControlPanelState | null,
|
||||
) => unknown;
|
||||
|
||||
return initialValue(
|
||||
{ value: [] } as unknown as ControlState,
|
||||
{
|
||||
datasource,
|
||||
} as ControlPanelState,
|
||||
);
|
||||
};
|
||||
|
||||
test('columns defaults to the default temporal column of the datasource', () => {
|
||||
expect(getColumnsInitialValue(TestDataset)).toEqual(['ds']);
|
||||
});
|
||||
|
||||
test('columns stays empty when the datasource has no temporal column', () => {
|
||||
const value = getColumnsInitialValue({
|
||||
...TestDataset,
|
||||
columns: [],
|
||||
main_dttm_col: undefined,
|
||||
} as unknown as Dataset);
|
||||
|
||||
expect(value).toEqual([]);
|
||||
// an empty value must be flagged as required rather than silently accepted
|
||||
expect(validateNonEmpty(value)).toBeTruthy();
|
||||
});
|
||||
+90
@@ -971,4 +971,94 @@ describe('Bar Chart X-axis Time Formatting', () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Regression test for Issue #42560', () => {
|
||||
const numericXAxisData = [
|
||||
{
|
||||
data: [
|
||||
{ x_value: 1000, metric: 10 },
|
||||
{ x_value: 2000, metric: 20 },
|
||||
{ x_value: 3000, metric: 30 },
|
||||
],
|
||||
colnames: ['x_value', 'metric'],
|
||||
coltypes: [GenericDataType.Numeric, GenericDataType.Numeric],
|
||||
},
|
||||
];
|
||||
|
||||
const categoricalXAxisData = [
|
||||
{
|
||||
data: [
|
||||
{ category: 'A', metric: 10 },
|
||||
{ category: 'B', metric: 20 },
|
||||
{ category: 'C', metric: 30 },
|
||||
],
|
||||
colnames: ['category', 'metric'],
|
||||
coltypes: [GenericDataType.String, GenericDataType.Numeric],
|
||||
},
|
||||
];
|
||||
|
||||
test('custom X Axis Title is preserved verbatim, not overwritten by the axis number/currency format ("unit")', () => {
|
||||
// Uses a numeric (non-temporal) x-axis column so `xAxisNumberFormat`
|
||||
// actually drives `getNumberFormatter` in the axis-label formatter
|
||||
// path, rather than being ignored in favor of the temporal formatter.
|
||||
const formData = {
|
||||
...baseFormData,
|
||||
orientation: 'vertical',
|
||||
groupby: [],
|
||||
x_axis: 'x_value',
|
||||
metric: 'metric',
|
||||
xAxisTitle: 'My X Axis',
|
||||
xAxisNumberFormat: 'SMART_NUMBER',
|
||||
yAxisFormat: '$,.2f',
|
||||
};
|
||||
|
||||
const chartProps = new ChartProps({
|
||||
...baseChartPropsConfig,
|
||||
queriesData: numericXAxisData,
|
||||
formData,
|
||||
});
|
||||
|
||||
const transformedProps = transformProps(
|
||||
chartProps as unknown as EchartsTimeseriesChartProps,
|
||||
);
|
||||
const xAxis = transformedProps.echartOptions.xAxis as any;
|
||||
|
||||
expect(xAxis.name).toBe('My X Axis');
|
||||
});
|
||||
|
||||
test('X Axis Title control maps onto the rendered category (left) axis in horizontal orientation, not the bottom axis', () => {
|
||||
// Documents the axis swap for horizontal bar charts: `xAxisTitle` ends
|
||||
// up on `echartOptions.yAxis.name` (the vertical category axis) and
|
||||
// `yAxisTitle` ends up on `echartOptions.xAxis.name` (the horizontal
|
||||
// value axis). This is existing, intentional swap behavior, not the
|
||||
// "unit" overwrite described in the issue. Uses categorical x-axis
|
||||
// data so the rendered left axis is actually type `category`, matching
|
||||
// what the test name claims.
|
||||
const formData = {
|
||||
...baseFormData,
|
||||
orientation: 'horizontal',
|
||||
groupby: [],
|
||||
x_axis: 'category',
|
||||
metric: 'metric',
|
||||
xAxisTitle: 'My X Axis',
|
||||
yAxisTitle: 'My Y Axis',
|
||||
};
|
||||
|
||||
const chartProps = new ChartProps({
|
||||
...baseChartPropsConfig,
|
||||
queriesData: categoricalXAxisData,
|
||||
formData,
|
||||
});
|
||||
|
||||
const transformedProps = transformProps(
|
||||
chartProps as unknown as EchartsTimeseriesChartProps,
|
||||
);
|
||||
const renderedXAxis = transformedProps.echartOptions.xAxis as any;
|
||||
const renderedYAxis = transformedProps.echartOptions.yAxis as any;
|
||||
|
||||
expect(renderedYAxis.type).toBe('category');
|
||||
expect(renderedYAxis.name).toBe('My X Axis');
|
||||
expect(renderedXAxis.name).toBe('My Y Axis');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
+337
@@ -23,6 +23,7 @@ import {
|
||||
AxisType,
|
||||
ChartProps,
|
||||
ComparisonType,
|
||||
ContributionType,
|
||||
DataRecord,
|
||||
EventAnnotationLayer,
|
||||
FormulaAnnotationLayer,
|
||||
@@ -618,6 +619,38 @@ describe('EchartsTimeseries transformProps', () => {
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
// Regression for #36401: query results containing integers beyond
|
||||
// Number.MAX_SAFE_INTEGER are parsed as native BigInt (see
|
||||
// packages/superset-ui-core/src/connection/callApi/parseResponse.ts).
|
||||
// In Stream mode, per-datum values are not routed through the Expand
|
||||
// normalization, so a raw BigInt reaching getBaselineSeriesForStream's
|
||||
// `0.5 * delta` weighting throws before the baseline series can render.
|
||||
test('does not throw computing a stream baseline series with a BigInt metric value', () => {
|
||||
const streamQueriesDataTyped: ChartDataResponseResult[] = [
|
||||
createTestQueryData([
|
||||
{
|
||||
__timestamp: BASE_TIMESTAMP,
|
||||
'San Francisco': BigInt('9007199254740993'),
|
||||
'New York': 220,
|
||||
},
|
||||
{
|
||||
__timestamp: BASE_TIMESTAMP + 1,
|
||||
'San Francisco': 150,
|
||||
'New York': 190,
|
||||
},
|
||||
]),
|
||||
];
|
||||
const streamFormData: Partial<EchartsTimeseriesFormData> = {
|
||||
...formData,
|
||||
stack: StackControlsValue.Stream,
|
||||
};
|
||||
const chartProps = createTestChartProps({
|
||||
formData: streamFormData,
|
||||
queriesData: streamQueriesDataTyped,
|
||||
});
|
||||
expect(() => transformProps(chartProps)).not.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
describe('Does transformProps transform series correctly', () => {
|
||||
@@ -1442,6 +1475,310 @@ test('should not apply axis bounds calculation when seriesType is not Bar for ho
|
||||
expect(xAxisRaw.max).toBeUndefined();
|
||||
});
|
||||
|
||||
test('should not clip small segments when row-contribution percentages float above 1 in horizontal stacked bar charts', () => {
|
||||
// These three shares are individually normalized (each column sums to 1),
|
||||
// but due to floating point rounding their sum can land fractionally
|
||||
// over 1. See https://github.com/apache/superset/issues/30914
|
||||
//
|
||||
// The margin above 1 is chosen large enough (~1e-7) that the sum stays
|
||||
// above 1 no matter which order the underlying series get summed in
|
||||
// (series are sorted by name for stacking, not in the order declared
|
||||
// here), unlike a single-ULP overflow which can round differently
|
||||
// depending on summation order and make this assertion order-dependent.
|
||||
const shareA = 0.42;
|
||||
const shareB = 0.38;
|
||||
const shareC = 0.2000001;
|
||||
expect(shareA + shareB + shareC).toBeGreaterThan(1);
|
||||
|
||||
const queriesData: ChartDataResponseResult[] = [
|
||||
createTestQueryData(
|
||||
createTestData(
|
||||
[{ 'Series A': shareA, 'Series B': shareB, 'Series C': shareC }],
|
||||
{ intervalMs: 300000000 },
|
||||
),
|
||||
),
|
||||
];
|
||||
|
||||
const chartProps = createTestChartProps({
|
||||
formData: {
|
||||
...baseFormDataHorizontalBar,
|
||||
contributionMode: ContributionType.Row,
|
||||
stack: StackControlsValue.Stack,
|
||||
},
|
||||
queriesData,
|
||||
});
|
||||
|
||||
const transformedProps = transformProps(chartProps);
|
||||
|
||||
// In horizontal orientation, axes are swapped, so yAxis becomes xAxis.
|
||||
// The axis max must not be hard-capped at exactly 1, otherwise echarts
|
||||
// clips the topmost stacked segment entirely instead of just rendering
|
||||
// a negligible sub-pixel overflow.
|
||||
const xAxisRaw = transformedProps.echartOptions.xAxis as any;
|
||||
expect(xAxisRaw.max).toBeGreaterThanOrEqual(shareA + shareB + shareC);
|
||||
});
|
||||
|
||||
test('keeps the 0-1 axis range for Expand (100% stacked) charts instead of padding to the raw row total', () => {
|
||||
// Unlike row-contribution mode, an Expand stack is not pre-normalized in
|
||||
// the query result -- these are raw values (summing to 100, not 1) that
|
||||
// get divided down to a 0-1 range internally. The un-normalized row total
|
||||
// must not be used to pad the axis max, or the chart would only occupy a
|
||||
// sliver of the plot.
|
||||
const queriesData: ChartDataResponseResult[] = [
|
||||
createTestQueryData(
|
||||
createTestData([{ 'Series A': 42, 'Series B': 38, 'Series C': 20 }], {
|
||||
intervalMs: 300000000,
|
||||
}),
|
||||
),
|
||||
];
|
||||
|
||||
const chartProps = createTestChartProps({
|
||||
formData: {
|
||||
...baseFormDataHorizontalBar,
|
||||
stack: StackControlsValue.Expand,
|
||||
},
|
||||
queriesData,
|
||||
});
|
||||
|
||||
const transformedProps = transformProps(chartProps);
|
||||
|
||||
const xAxisRaw = transformedProps.echartOptions.xAxis as any;
|
||||
expect(xAxisRaw.max).toBe(1);
|
||||
});
|
||||
|
||||
test('computes row-contribution axis padding per stack when time_compare splits a row into multiple normalized stacks', () => {
|
||||
// With time_compare, each comparison period is normalized and stacked
|
||||
// independently (see getTimeCompareStackId), so the current-period
|
||||
// columns sum to ~1 in their own stack and the comparison-period columns
|
||||
// (suffixed with the offset) sum to ~1 in a separate stack. The combined
|
||||
// row total across both stacks is therefore ~2, but the axis max must be
|
||||
// computed per stack, not from that combined total, or a 100% bar would
|
||||
// only occupy about half the plot.
|
||||
const queriesData: ChartDataResponseResult[] = [
|
||||
createTestQueryData(
|
||||
createTestData(
|
||||
[
|
||||
{
|
||||
'Series A': 0.6,
|
||||
'Series B': 0.4,
|
||||
'Series A__1 year ago': 0.55,
|
||||
'Series B__1 year ago': 0.45,
|
||||
},
|
||||
],
|
||||
{ intervalMs: 300000000 },
|
||||
),
|
||||
),
|
||||
];
|
||||
|
||||
const chartProps = createTestChartProps({
|
||||
formData: {
|
||||
...baseFormDataHorizontalBar,
|
||||
contributionMode: ContributionType.Row,
|
||||
stack: StackControlsValue.Stack,
|
||||
time_compare: ['1 year ago'],
|
||||
},
|
||||
queriesData,
|
||||
});
|
||||
|
||||
const transformedProps = transformProps(chartProps);
|
||||
|
||||
const xAxisRaw = transformedProps.echartOptions.xAxis as any;
|
||||
expect(xAxisRaw.max).toBeGreaterThanOrEqual(1);
|
||||
expect(xAxisRaw.max).toBeLessThan(1.5);
|
||||
});
|
||||
|
||||
test('clamps series values to the yAxis max instead of dropping out-of-range points (#27449)', () => {
|
||||
const queriesData: ChartDataResponseResult[] = [
|
||||
createTestQueryData(
|
||||
createTestData(
|
||||
[
|
||||
{ 'Series A': 1 },
|
||||
{ 'Series A': 2 },
|
||||
{ 'Series A': 3 },
|
||||
{ 'Series A': 4 },
|
||||
{ 'Series A': 1000 },
|
||||
{ 'Series A': 4 },
|
||||
{ 'Series A': 2 },
|
||||
],
|
||||
{ intervalMs: 300000000 },
|
||||
),
|
||||
),
|
||||
];
|
||||
|
||||
const chartProps = createTestChartProps({
|
||||
formData: {
|
||||
...formData,
|
||||
groupby: [],
|
||||
seriesType: EchartsTimeseriesSeriesType.Line,
|
||||
truncateYAxis: true,
|
||||
yAxisBounds: [0, 10],
|
||||
},
|
||||
queriesData,
|
||||
});
|
||||
|
||||
const transformedProps = transformProps(chartProps);
|
||||
const series = transformedProps.echartOptions.series as SeriesOption[];
|
||||
const seriesA = series.find(s => s.name === 'Series A');
|
||||
expect(seriesA).toBeDefined();
|
||||
const data = seriesA!.data as [number, number][];
|
||||
|
||||
// The point that was 1000 should be present (not dropped) and clamped to
|
||||
// the configured yAxis max of 10, rather than disappearing entirely.
|
||||
expect(data).toHaveLength(7);
|
||||
expect(data[4][1]).toBe(10);
|
||||
});
|
||||
|
||||
test('clamps series values to the yAxis min when a value falls below it', () => {
|
||||
const queriesData: ChartDataResponseResult[] = [
|
||||
createTestQueryData(
|
||||
createTestData(
|
||||
[{ 'Series A': -1000 }, { 'Series A': 2 }, { 'Series A': 3 }],
|
||||
{ intervalMs: 300000000 },
|
||||
),
|
||||
),
|
||||
];
|
||||
|
||||
const chartProps = createTestChartProps({
|
||||
formData: {
|
||||
...formData,
|
||||
groupby: [],
|
||||
seriesType: EchartsTimeseriesSeriesType.Line,
|
||||
truncateYAxis: true,
|
||||
yAxisBounds: [0, 10],
|
||||
},
|
||||
queriesData,
|
||||
});
|
||||
|
||||
const transformedProps = transformProps(chartProps);
|
||||
const series = transformedProps.echartOptions.series as SeriesOption[];
|
||||
const seriesA = series.find(s => s.name === 'Series A');
|
||||
expect(seriesA).toBeDefined();
|
||||
const data = seriesA!.data as [number, number][];
|
||||
|
||||
expect(data).toHaveLength(3);
|
||||
expect(data[0][1]).toBe(0);
|
||||
});
|
||||
|
||||
test('clamps series values to the yAxis bounds when colorByPrimaryAxis wraps points in objects (#27449)', () => {
|
||||
const queriesData: ChartDataResponseResult[] = [
|
||||
createTestQueryData(
|
||||
createTestData(
|
||||
[{ 'Series A': 1 }, { 'Series A': 1000 }, { 'Series A': 2 }],
|
||||
{ intervalMs: 300000000 },
|
||||
),
|
||||
),
|
||||
];
|
||||
|
||||
const chartProps = createTestChartProps({
|
||||
formData: {
|
||||
...formData,
|
||||
groupby: [],
|
||||
seriesType: EchartsTimeseriesSeriesType.Line,
|
||||
truncateYAxis: true,
|
||||
yAxisBounds: [0, 10],
|
||||
colorByPrimaryAxis: true,
|
||||
},
|
||||
queriesData,
|
||||
});
|
||||
|
||||
const transformedProps = transformProps(chartProps);
|
||||
const series = transformedProps.echartOptions.series as SeriesOption[];
|
||||
const seriesA = series.find(s => s.name === 'Series A');
|
||||
expect(seriesA).toBeDefined();
|
||||
const data = seriesA!.data as { value: [number, number] }[];
|
||||
|
||||
// colorByPrimaryAxis wraps each point as `{ value: [x, y], itemStyle }`
|
||||
// rather than a bare tuple; the wrapped value must still be clamped
|
||||
// instead of being skipped and left for ECharts to drop.
|
||||
expect(data).toHaveLength(3);
|
||||
expect(data[1].value[1]).toBe(10);
|
||||
});
|
||||
|
||||
test('does not clamp a timeseries annotation series to the Y axis bounds (#27449)', () => {
|
||||
const timeseries: TimeseriesAnnotationLayer = {
|
||||
annotationType: AnnotationType.Timeseries,
|
||||
name: 'My Timeseries',
|
||||
show: true,
|
||||
showLabel: true,
|
||||
sourceType: AnnotationSourceType.Line,
|
||||
style: AnnotationStyle.Solid,
|
||||
titleColumn: '',
|
||||
value: 3,
|
||||
};
|
||||
const annotationData = {
|
||||
'My Timeseries': {
|
||||
records: [
|
||||
{ x: 0, y: 11000 },
|
||||
{ x: 300000000, y: 21000 },
|
||||
],
|
||||
},
|
||||
};
|
||||
const queriesData: ChartDataResponseResult[] = [
|
||||
createTestQueryData(
|
||||
createTestData([{ 'Series A': 1 }, { 'Series A': 2 }], {
|
||||
intervalMs: 300000000,
|
||||
}),
|
||||
{ annotation_data: annotationData },
|
||||
),
|
||||
];
|
||||
|
||||
const chartProps = createTestChartProps({
|
||||
formData: {
|
||||
...formData,
|
||||
groupby: [],
|
||||
seriesType: EchartsTimeseriesSeriesType.Line,
|
||||
truncateYAxis: true,
|
||||
yAxisBounds: [0, 10],
|
||||
annotationLayers: [timeseries],
|
||||
},
|
||||
annotationData,
|
||||
queriesData,
|
||||
});
|
||||
|
||||
const transformedProps = transformProps(chartProps);
|
||||
const series = transformedProps.echartOptions.series as SeriesOption[];
|
||||
const annotationSeries = series.find(s => s.id === 'My Timeseries');
|
||||
expect(annotationSeries).toBeDefined();
|
||||
const data = annotationSeries!.data as [number, number][];
|
||||
|
||||
// The annotation carries its own configured values (11000, 21000), which
|
||||
// are unrelated to the chart's own out-of-range-data problem this PR
|
||||
// fixes. They must be left untouched by the Y axis clamp rather than
|
||||
// rewritten to the yAxisBounds max of 10.
|
||||
expect(data[0][1]).toBe(11000);
|
||||
expect(data[1][1]).toBe(21000);
|
||||
});
|
||||
|
||||
test('clamps series values at the correct tuple index for horizontal bar charts (#27449)', () => {
|
||||
const queriesData: ChartDataResponseResult[] = [
|
||||
createTestQueryData(
|
||||
createTestData(
|
||||
[{ 'Series A': 15000 }, { 'Series A': 20000 }, { 'Series A': 18000 }],
|
||||
{ intervalMs: 300000000 },
|
||||
),
|
||||
),
|
||||
];
|
||||
|
||||
const chartProps = createTestChartProps({
|
||||
formData: {
|
||||
...baseFormDataHorizontalBar,
|
||||
yAxisBounds: [0, 16000],
|
||||
},
|
||||
queriesData,
|
||||
});
|
||||
|
||||
const transformedProps = transformProps(chartProps);
|
||||
const series = transformedProps.echartOptions.series as SeriesOption[];
|
||||
const seriesA = series.find(s => s.name === 'Series A');
|
||||
expect(seriesA).toBeDefined();
|
||||
const data = seriesA!.data as [number, number][];
|
||||
|
||||
// In horizontal orientation the value sits at tuple index 0 (the axes are
|
||||
// swapped), so the clamp must target that index rather than index 1.
|
||||
expect(data).toHaveLength(3);
|
||||
expect(data[1][0]).toBe(16000);
|
||||
});
|
||||
|
||||
test('legend is visible on tall charts when enabled by the user', () => {
|
||||
const chartProps = createTestChartProps({
|
||||
height: 400,
|
||||
|
||||
@@ -51,7 +51,7 @@ import {
|
||||
LegendType,
|
||||
} from '../../src/types';
|
||||
import { defaultLegendPadding } from '../../src/defaults';
|
||||
import { NULL_STRING } from '../../src/constants';
|
||||
import { NULL_STRING, StackControlsValue } from '../../src/constants';
|
||||
|
||||
const {
|
||||
getHorizontalLegendAvailableWidth,
|
||||
@@ -548,6 +548,76 @@ describe('extractSeries', () => {
|
||||
]);
|
||||
});
|
||||
|
||||
// Regression for #36401: query results containing integers beyond
|
||||
// Number.MAX_SAFE_INTEGER are parsed as native BigInt (see
|
||||
// packages/superset-ui-core/src/connection/callApi/parseResponse.ts).
|
||||
// In "Expand" (100%/contribution) stacking mode, the raw datum value is
|
||||
// divided by the row's total, which throws if the datum is still a
|
||||
// BigInt at that point even though the total itself is a Number.
|
||||
test('normalizes a BigInt datum value before dividing in Expand stack mode', () => {
|
||||
const data = [
|
||||
{
|
||||
__timestamp: '2000-01-01',
|
||||
metric_a: BigInt('9007199254740993'),
|
||||
metric_b: 10,
|
||||
},
|
||||
];
|
||||
const totalStackedValues = [9007199254740993 + 10];
|
||||
|
||||
expect(() =>
|
||||
extractSeries(data, {
|
||||
totalStackedValues,
|
||||
stack: StackControlsValue.Expand,
|
||||
}),
|
||||
).not.toThrow();
|
||||
|
||||
const [series] = extractSeries(data, {
|
||||
totalStackedValues,
|
||||
stack: StackControlsValue.Expand,
|
||||
});
|
||||
const metricA = series.find(s => s.id === 'metric_a');
|
||||
const expandedValue = (
|
||||
metricA?.data as [string, number][] | undefined
|
||||
)?.[0]?.[1];
|
||||
expect(expandedValue).toBeCloseTo(9007199254740993 / totalStackedValues[0]);
|
||||
});
|
||||
|
||||
// Regression for #36401: the default series sort (SortSeriesType.Sum)
|
||||
// calls lodash's sumBy across all rows for a given series name. If one
|
||||
// row's metric value was parsed as BigInt and another row's value for
|
||||
// the same series is a Number, summing them throws before extractSeries
|
||||
// ever reaches the Expand-mode conversion.
|
||||
test('sorts series by sum without throwing when rows mix BigInt and Number values for the same series', () => {
|
||||
const data = [
|
||||
{
|
||||
__timestamp: '2000-01-01',
|
||||
a: BigInt('9007199254740993'),
|
||||
},
|
||||
{
|
||||
__timestamp: '2000-02-01',
|
||||
a: 5,
|
||||
},
|
||||
];
|
||||
|
||||
expect(() =>
|
||||
extractSeries(data, { sortSeriesType: SortSeriesType.Sum }),
|
||||
).not.toThrow();
|
||||
|
||||
const [series] = extractSeries(data, {
|
||||
sortSeriesType: SortSeriesType.Sum,
|
||||
});
|
||||
expect(series).toEqual([
|
||||
{
|
||||
id: 'a',
|
||||
name: 'a',
|
||||
data: [
|
||||
['2000-01-01', 9007199254740992],
|
||||
['2000-02-01', 5],
|
||||
],
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
test('should remove rows that have a null x-value', () => {
|
||||
const data = [
|
||||
{
|
||||
@@ -738,6 +808,46 @@ describe('extractGroupbyLabel', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('extractDataTotalValues', () => {
|
||||
test('sums numeric metric values across a stacked datum', () => {
|
||||
const { totalStackedValues, thresholdValues } = extractDataTotalValues(
|
||||
[{ __timestamp: '2000-01-01', metric_a: 10, metric_b: 20 }],
|
||||
{ stack: true, percentageThreshold: 50, xAxisCol: '__timestamp' },
|
||||
);
|
||||
expect(totalStackedValues).toEqual([30]);
|
||||
expect(thresholdValues).toEqual([15]);
|
||||
});
|
||||
|
||||
// Regression for #36401: query results containing integers beyond
|
||||
// Number.MAX_SAFE_INTEGER are parsed as native BigInt (see
|
||||
// packages/superset-ui-core/src/connection/callApi/parseResponse.ts).
|
||||
// Summing a BigInt datum value against the Number accumulator here
|
||||
// throws instead of producing a stacked total.
|
||||
test('sums a stacked datum containing a BigInt metric value without throwing', () => {
|
||||
const data: DataRecord[] = [
|
||||
{
|
||||
__timestamp: '2000-01-01',
|
||||
metric_a: 10,
|
||||
metric_b: BigInt('9007199254740993'),
|
||||
},
|
||||
];
|
||||
const { totalStackedValues, thresholdValues } = extractDataTotalValues(
|
||||
data,
|
||||
{
|
||||
stack: true,
|
||||
percentageThreshold: 50,
|
||||
xAxisCol: '__timestamp',
|
||||
},
|
||||
);
|
||||
// BigInt('9007199254740993') exceeds Number.MAX_SAFE_INTEGER, so
|
||||
// converting it to a Number loses precision (rounds to
|
||||
// 9007199254740992). The assertions reflect that expected,
|
||||
// best-effort numeric representation rather than exact BigInt math.
|
||||
expect(totalStackedValues).toEqual([9007199254741002]);
|
||||
expect(thresholdValues).toEqual([4503599627370501]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('extractShowValueIndexes', () => {
|
||||
test('should return the latest index for stack', () => {
|
||||
expect(
|
||||
|
||||
@@ -646,4 +646,76 @@ describe('test treeBuilder', () => {
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
// Regression: a plain-object grouping accumulator coerces every key to a
|
||||
// string, so a SQL NULL and the literal string "null" both land under the
|
||||
// "null" property and merge into one group. Keep them as separate nodes.
|
||||
test('keeps a SQL null and the literal string "null" as distinct groups', () => {
|
||||
const tree = treeBuilder(
|
||||
[
|
||||
{ foo: null, count: 2, count2: 3 },
|
||||
{ foo: 'null', count: 5, count2: 7 },
|
||||
{ foo: 'a', count: 1, count2: 1 },
|
||||
],
|
||||
['foo'],
|
||||
'count',
|
||||
);
|
||||
expect(tree).toEqual([
|
||||
{ groupBy: 'foo', name: null, secondaryValue: 2, value: 2 },
|
||||
{ groupBy: 'foo', name: 'null', secondaryValue: 5, value: 5 },
|
||||
{ groupBy: 'foo', name: 'a', secondaryValue: 1, value: 1 },
|
||||
]);
|
||||
});
|
||||
|
||||
// Regression: distinct `Date` instances representing the same timestamp
|
||||
// must not fragment into separate groups. A `Map` keyed on the raw object
|
||||
// would otherwise compare `Date`s by identity rather than value.
|
||||
test('groups distinct Date instances with the same timestamp together', () => {
|
||||
const tree = treeBuilder(
|
||||
[
|
||||
{ foo: new Date('2020-01-01T00:00:00Z'), bar: 'a', count: 2 },
|
||||
{ foo: new Date('2020-01-01T00:00:00Z'), bar: 'b', count: 3 },
|
||||
{ foo: new Date('2020-01-02T00:00:00Z'), bar: 'c', count: 5 },
|
||||
],
|
||||
['foo', 'bar'],
|
||||
'count',
|
||||
);
|
||||
expect(tree).toEqual([
|
||||
{
|
||||
children: [
|
||||
{ groupBy: 'bar', name: 'a', secondaryValue: 2, value: 2 },
|
||||
{ groupBy: 'bar', name: 'b', secondaryValue: 3, value: 3 },
|
||||
],
|
||||
groupBy: 'foo',
|
||||
name: new Date('2020-01-01T00:00:00Z'),
|
||||
secondaryValue: 5,
|
||||
value: 5,
|
||||
},
|
||||
{
|
||||
children: [{ groupBy: 'bar', name: 'c', secondaryValue: 5, value: 5 }],
|
||||
groupBy: 'foo',
|
||||
name: new Date('2020-01-02T00:00:00Z'),
|
||||
secondaryValue: 5,
|
||||
value: 5,
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
test('filters only the SQL null, not the literal string "null"', () => {
|
||||
const tree = treeBuilder(
|
||||
[
|
||||
{ foo: null, count: 2, count2: 3 },
|
||||
{ foo: 'null', count: 5, count2: 7 },
|
||||
{ foo: 'a', count: 1, count2: 1 },
|
||||
],
|
||||
['foo'],
|
||||
'count',
|
||||
undefined,
|
||||
true,
|
||||
);
|
||||
expect(tree).toEqual([
|
||||
{ groupBy: 'foo', name: 'null', secondaryValue: 5, value: 5 },
|
||||
{ groupBy: 'foo', name: 'a', secondaryValue: 1, value: 1 },
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -0,0 +1,238 @@
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import { TimeGranularity } from '@superset-ui/core';
|
||||
import {
|
||||
formatNaiveDateTime,
|
||||
getTemporalXAxisDrillByFilter,
|
||||
getTimeBucketRange,
|
||||
} from '../../src/utils/xAxisDrillByFilter';
|
||||
|
||||
const utc = (dateString: string) => new Date(`${dateString}Z`);
|
||||
|
||||
const expectRange = (
|
||||
bucketLabel: string,
|
||||
grain: TimeGranularity,
|
||||
since: string,
|
||||
until: string,
|
||||
) => {
|
||||
const range = getTimeBucketRange(utc(bucketLabel), grain);
|
||||
expect(range).toBeDefined();
|
||||
expect(formatNaiveDateTime(range!.since)).toEqual(since);
|
||||
expect(formatNaiveDateTime(range!.until)).toEqual(until);
|
||||
};
|
||||
|
||||
/* eslint jest/expect-expect: ["warn", { "assertFunctionNames": ["expect*"] }] */
|
||||
|
||||
test('getTimeBucketRange computes sub-daily buckets', () => {
|
||||
expectRange(
|
||||
'2021-03-14T01:59:00',
|
||||
TimeGranularity.MINUTE,
|
||||
'2021-03-14T01:59:00',
|
||||
'2021-03-14T02:00:00',
|
||||
);
|
||||
expectRange(
|
||||
'2021-03-14T01:30:00',
|
||||
TimeGranularity.THIRTY_MINUTES,
|
||||
'2021-03-14T01:30:00',
|
||||
'2021-03-14T02:00:00',
|
||||
);
|
||||
expectRange(
|
||||
'2021-03-14T23:00:00',
|
||||
TimeGranularity.HOUR,
|
||||
'2021-03-14T23:00:00',
|
||||
'2021-03-15T00:00:00',
|
||||
);
|
||||
});
|
||||
|
||||
test('getTimeBucketRange computes daily and weekly buckets', () => {
|
||||
expectRange(
|
||||
'2021-12-31T00:00:00',
|
||||
TimeGranularity.DAY,
|
||||
'2021-12-31T00:00:00',
|
||||
'2022-01-01T00:00:00',
|
||||
);
|
||||
expectRange(
|
||||
'2021-04-26T00:00:00',
|
||||
TimeGranularity.WEEK,
|
||||
'2021-04-26T00:00:00',
|
||||
'2021-05-03T00:00:00',
|
||||
);
|
||||
expectRange(
|
||||
'2021-04-25T00:00:00',
|
||||
TimeGranularity.WEEK_STARTING_SUNDAY,
|
||||
'2021-04-25T00:00:00',
|
||||
'2021-05-02T00:00:00',
|
||||
);
|
||||
});
|
||||
|
||||
test('getTimeBucketRange extends week-ending buckets backwards from their label', () => {
|
||||
expectRange(
|
||||
'2021-05-01T00:00:00',
|
||||
TimeGranularity.WEEK_ENDING_SATURDAY,
|
||||
'2021-04-25T00:00:00',
|
||||
'2021-05-02T00:00:00',
|
||||
);
|
||||
expectRange(
|
||||
'2021-05-02T00:00:00',
|
||||
TimeGranularity.WEEK_ENDING_SUNDAY,
|
||||
'2021-04-26T00:00:00',
|
||||
'2021-05-03T00:00:00',
|
||||
);
|
||||
});
|
||||
|
||||
test('getTimeBucketRange respects calendar month lengths', () => {
|
||||
expectRange(
|
||||
'2021-01-01T00:00:00',
|
||||
TimeGranularity.MONTH,
|
||||
'2021-01-01T00:00:00',
|
||||
'2021-02-01T00:00:00',
|
||||
);
|
||||
expectRange(
|
||||
'2021-02-01T00:00:00',
|
||||
TimeGranularity.MONTH,
|
||||
'2021-02-01T00:00:00',
|
||||
'2021-03-01T00:00:00',
|
||||
);
|
||||
expectRange(
|
||||
'2024-02-01T00:00:00',
|
||||
TimeGranularity.MONTH,
|
||||
'2024-02-01T00:00:00',
|
||||
'2024-03-01T00:00:00',
|
||||
);
|
||||
expectRange(
|
||||
'2021-12-01T00:00:00',
|
||||
TimeGranularity.MONTH,
|
||||
'2021-12-01T00:00:00',
|
||||
'2022-01-01T00:00:00',
|
||||
);
|
||||
});
|
||||
|
||||
test('getTimeBucketRange computes quarter and year buckets', () => {
|
||||
expectRange(
|
||||
'2021-10-01T00:00:00',
|
||||
TimeGranularity.QUARTER,
|
||||
'2021-10-01T00:00:00',
|
||||
'2022-01-01T00:00:00',
|
||||
);
|
||||
expectRange(
|
||||
'2024-01-01T00:00:00',
|
||||
TimeGranularity.YEAR,
|
||||
'2024-01-01T00:00:00',
|
||||
'2025-01-01T00:00:00',
|
||||
);
|
||||
});
|
||||
|
||||
test('getTimeBucketRange returns undefined for unknown grains', () => {
|
||||
expect(
|
||||
getTimeBucketRange(utc('2021-01-01T00:00:00'), 'P1D2H' as TimeGranularity),
|
||||
).toBeUndefined();
|
||||
});
|
||||
|
||||
test('getTemporalXAxisDrillByFilter builds a temporal range for known grains', () => {
|
||||
expect(
|
||||
getTemporalXAxisDrillByFilter(
|
||||
'ds',
|
||||
utc('2021-01-01T00:00:00').getTime(),
|
||||
TimeGranularity.MONTH,
|
||||
'Jan 2021',
|
||||
),
|
||||
).toEqual({
|
||||
col: 'ds',
|
||||
op: 'TEMPORAL_RANGE',
|
||||
val: '2021-01-01T00:00:00 : 2021-02-01T00:00:00',
|
||||
formattedVal: 'Jan 2021',
|
||||
});
|
||||
});
|
||||
|
||||
test('getTemporalXAxisDrillByFilter falls back to exact match without a grain', () => {
|
||||
expect(
|
||||
getTemporalXAxisDrillByFilter(
|
||||
'ds',
|
||||
utc('2021-01-01T12:34:56').getTime(),
|
||||
undefined,
|
||||
'2021-01-01 12:34:56',
|
||||
),
|
||||
).toEqual({
|
||||
col: 'ds',
|
||||
op: '==',
|
||||
val: '2021-01-01T12:34:56',
|
||||
formattedVal: '2021-01-01 12:34:56',
|
||||
});
|
||||
});
|
||||
|
||||
test('getTemporalXAxisDrillByFilter preserves sub-second precision in the exact-match fallback', () => {
|
||||
expect(
|
||||
getTemporalXAxisDrillByFilter(
|
||||
'ds',
|
||||
new Date('2021-01-01T12:34:56.123Z').getTime(),
|
||||
undefined,
|
||||
'2021-01-01 12:34:56.123',
|
||||
),
|
||||
).toEqual({
|
||||
col: 'ds',
|
||||
op: '==',
|
||||
val: '2021-01-01T12:34:56.123',
|
||||
formattedVal: '2021-01-01 12:34:56.123',
|
||||
});
|
||||
});
|
||||
|
||||
test('getTemporalXAxisDrillByFilter falls back to exact match for unknown grains', () => {
|
||||
expect(
|
||||
getTemporalXAxisDrillByFilter(
|
||||
'ds',
|
||||
utc('2021-01-01T00:00:00').getTime(),
|
||||
'P1D2H' as TimeGranularity,
|
||||
),
|
||||
).toMatchObject({ op: '==', val: '2021-01-01T00:00:00' });
|
||||
});
|
||||
|
||||
test('getTemporalXAxisDrillByFilter accepts parseable date strings and Dates', () => {
|
||||
expect(
|
||||
getTemporalXAxisDrillByFilter(
|
||||
'ds',
|
||||
'2021-01-01T00:00:00Z',
|
||||
TimeGranularity.DAY,
|
||||
),
|
||||
).toMatchObject({
|
||||
op: 'TEMPORAL_RANGE',
|
||||
val: '2021-01-01T00:00:00 : 2021-01-02T00:00:00',
|
||||
});
|
||||
expect(
|
||||
getTemporalXAxisDrillByFilter(
|
||||
'ds',
|
||||
utc('2021-01-01T00:00:00'),
|
||||
TimeGranularity.DAY,
|
||||
),
|
||||
).toMatchObject({
|
||||
op: 'TEMPORAL_RANGE',
|
||||
val: '2021-01-01T00:00:00 : 2021-01-02T00:00:00',
|
||||
});
|
||||
});
|
||||
|
||||
test('getTemporalXAxisDrillByFilter returns undefined for unusable input', () => {
|
||||
expect(
|
||||
getTemporalXAxisDrillByFilter('ds', 'not a date', TimeGranularity.DAY),
|
||||
).toBeUndefined();
|
||||
expect(
|
||||
getTemporalXAxisDrillByFilter('ds', null, TimeGranularity.DAY),
|
||||
).toBeUndefined();
|
||||
expect(
|
||||
getTemporalXAxisDrillByFilter('', 1609459200000, TimeGranularity.DAY),
|
||||
).toBeUndefined();
|
||||
});
|
||||
@@ -30,7 +30,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@math.gl/web-mercator": "^4.1.0",
|
||||
"mapbox-gl": "^3.27.0",
|
||||
"mapbox-gl": "^3.28.1",
|
||||
"maplibre-gl": "^5.24.0",
|
||||
"react-map-gl": "^8.1.2",
|
||||
"supercluster": "^8.0.1"
|
||||
|
||||
@@ -31,8 +31,10 @@ import {
|
||||
} from '@superset-ui/core';
|
||||
|
||||
import {
|
||||
getTotalsMetrics,
|
||||
isTimeComparison,
|
||||
timeCompareOperator,
|
||||
TotalsAggregate,
|
||||
} from '@superset-ui/chart-controls';
|
||||
import { isEmpty } from 'lodash-es';
|
||||
import { TableChartFormData } from './types';
|
||||
@@ -347,9 +349,12 @@ export const buildQuery: BuildQuery<TableChartFormData> = (
|
||||
formData.show_totals &&
|
||||
queryMode === QueryMode.Aggregate
|
||||
) {
|
||||
const totalsAggregate: TotalsAggregate =
|
||||
formData.totals_aggregate === 'AVG' ? 'AVG' : 'SUM';
|
||||
extraQueries.push({
|
||||
...queryObject,
|
||||
columns: [],
|
||||
metrics: getTotalsMetrics(metrics, totalsAggregate),
|
||||
row_limit: 0,
|
||||
row_offset: 0,
|
||||
// Reapply only the percent-metric contribution rule so the totals row
|
||||
|
||||
@@ -468,6 +468,31 @@ const config: ControlPanelConfig = {
|
||||
},
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
name: 'totals_aggregate',
|
||||
config: {
|
||||
type: 'SelectControl',
|
||||
label: t('Summary aggregation'),
|
||||
description: t(
|
||||
'Aggregation used for the summary row, independent of each ' +
|
||||
"metric's own aggregation. Only applies to simple metrics " +
|
||||
'(a metric built from custom SQL keeps its own aggregation ' +
|
||||
'in the summary row).',
|
||||
),
|
||||
default: 'SUM',
|
||||
clearable: false,
|
||||
choices: [
|
||||
['SUM', t('Sum')],
|
||||
['AVG', t('Average')],
|
||||
],
|
||||
visibility: ({ controls }) =>
|
||||
isAggMode({ controls }) &&
|
||||
Boolean(controls?.show_totals?.value),
|
||||
resetOnHide: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user