You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by mi...@apache.org on 2025/03/25 18:46:20 UTC
(superset) branch 5.0 updated (5d333ac6dc -> f049049f71)
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a change to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git
from 5d333ac6dc fix: do not add calculated columns when syncing (#32761)
new 49398ce93e feat: DB migration for dataset folders (#32680)
new 770b3e17bb fix(migrations): fix foreign keys to match FAB 4.6.0 tables (#32759)
new 95c09aa38b fix(chart control): Change default of "Y Axis Title Margin" (#32720)
new db2b4cc297 fix(sqllab): Pass query_id as kwarg so backoff can see it (#32774)
new 1306b36823 fix(import): Missing catalog field in saved query schema (#32775)
new 4f6b7d02f4 fix(css): typos in styles (#28350)
new e49ebce03c fix(config): correct slack image url in talisman (#32778)
new 171574b1ca fix(excel export): big number truncation handling (#32739)
new 5f9fdfe019 fix(model/helper): represent RLS filter clause in proper textual SQL string (#32406)
new ca7c65456a fix(sec): resolve CVE-2025-29907 and CVE-2025-25977 by pinning `jspdf` to v3 (#32802)
new 10ff151971 fix: CSV/Excel upload form change column dates description (#32797)
new 76070218ca fix: key error in frontend on disallowed GSheets (#32792)
new 9f719d2ed2 fix: Time Comparison Feature Reverts Metric Labels to Metric Keys in Table Charts (#32665)
new fd44f70528 fix(log): store navigation path to get correct logging path (#32795)
new f049049f71 fix: Bump FAB to 4.6.1 (#32848)
The 15 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
docs/docs/security/security.mdx | 43 +++++++
pyproject.toml | 2 +-
requirements/base.txt | 2 +-
requirements/development.txt | 2 +-
.../cypress/e2e/dashboard/drillby.test.ts | 36 +++---
.../cypress/e2e/dashboard/drilltodetail.test.ts | 16 +--
superset-frontend/package-lock.json | 36 +++---
superset-frontend/package.json | 1 +
.../src/sections/chartTitle.tsx | 2 +-
.../src/Bubble/transformProps.ts | 4 +-
.../src/Timeseries/Regular/Bar/controlPanel.tsx | 2 +-
.../plugins/plugin-chart-table/src/TableChart.tsx | 8 +-
.../plugin-chart-table/src/transformProps.ts | 5 +
.../plugins/plugin-chart-table/src/types.ts | 2 +
.../plugin-chart-table/test/TableChart.test.tsx | 80 ++++++++++++
.../features/databases/UploadDataModel/index.tsx | 2 +-
superset-frontend/src/middleware/logger.test.js | 22 +++-
.../src/middleware/loggerMiddleware.js | 140 +++++++++++----------
superset/config.py | 7 +-
superset/migrations/shared/utils.py | 81 ++++++++++--
..._94e7a3499973_add_folders_column_to_dataset.py} | 19 +--
...46_32bf93dfe2a4_add_on_cascade_in_fab_tables.py | 111 ++++++++++++++++
superset/models/helpers.py | 2 +-
superset/queries/saved_queries/schemas.py | 1 +
superset/sql_lab.py | 4 +-
superset/translations/ar/LC_MESSAGES/messages.po | 4 +-
superset/translations/de/LC_MESSAGES/messages.po | 6 +-
superset/translations/en/LC_MESSAGES/messages.po | 2 +-
superset/translations/es/LC_MESSAGES/messages.po | 4 +-
superset/translations/fr/LC_MESSAGES/messages.po | 6 +-
superset/translations/it/LC_MESSAGES/messages.po | 4 +-
superset/translations/ja/LC_MESSAGES/messages.po | 4 +-
superset/translations/ko/LC_MESSAGES/messages.po | 4 +-
superset/translations/messages.pot | 2 +-
superset/translations/nl/LC_MESSAGES/messages.po | 6 +-
superset/translations/pt/LC_MESSAGES/messages.po | 4 +-
.../translations/pt_BR/LC_MESSAGES/messages.po | 6 +-
superset/translations/ru/LC_MESSAGES/messages.po | 6 +-
superset/translations/sk/LC_MESSAGES/messages.po | 2 +-
superset/translations/sl/LC_MESSAGES/messages.po | 4 +-
superset/translations/tr/LC_MESSAGES/messages.po | 4 +-
superset/translations/uk/LC_MESSAGES/messages.po | 4 +-
superset/translations/zh/LC_MESSAGES/messages.po | 4 +-
.../translations/zh_TW/LC_MESSAGES/messages.po | 4 +-
superset/utils/excel.py | 14 +++
superset/views/base.py | 5 +-
tests/integration_tests/fixtures/importexport.py | 1 +
tests/unit_tests/models/helpers_test.py | 16 +--
tests/unit_tests/utils/excel_tests.py | 24 ++++
49 files changed, 577 insertions(+), 193 deletions(-)
copy superset/migrations/versions/{2024-05-10_11-09_9621c6d56ffb_add_subject_column_to_report_schedule.py => 2025-03-03_20-52_94e7a3499973_add_folders_column_to_dataset.py} (73%)
create mode 100644 superset/migrations/versions/2025-03-19_17-46_32bf93dfe2a4_add_on_cascade_in_fab_tables.py
(superset) 13/15: fix: Time Comparison Feature Reverts Metric Labels to Metric Keys in Table Charts (#32665)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 9f719d2ed25fc877ecce3018eebbdf9cec1fcdee
Author: Fardin Mustaque <10...@users.noreply.github.com>
AuthorDate: Tue Mar 25 17:52:15 2025 +0530
fix: Time Comparison Feature Reverts Metric Labels to Metric Keys in Table Charts (#32665)
Co-authored-by: Fardin Mustaque <fa...@Fardins-Mac-mini.local>
(cherry picked from commit 7d77dc4fd2001bfa1a752fb9a2da0cdc7349f886)
---
.../plugins/plugin-chart-table/src/TableChart.tsx | 8 ++-
.../plugin-chart-table/src/transformProps.ts | 5 ++
.../plugins/plugin-chart-table/src/types.ts | 2 +
.../plugin-chart-table/test/TableChart.test.tsx | 80 ++++++++++++++++++++++
4 files changed, 92 insertions(+), 3 deletions(-)
diff --git a/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx b/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx
index 77905ea562..95121a317d 100644
--- a/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx
+++ b/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx
@@ -605,6 +605,8 @@ export default function TableChart<D extends DataRecord = DataRecord>(
// Calculate the number of placeholder columns needed before the current header
const startPosition = value[0];
const colSpan = value.length;
+ // Retrieve the originalLabel from the first column in this group
+ const originalLabel = columnsMeta[value[0]]?.originalLabel || key;
// Add placeholder <th> for columns before this header
for (let i = currentColumnIndex; i < startPosition; i += 1) {
@@ -620,7 +622,7 @@ export default function TableChart<D extends DataRecord = DataRecord>(
// Add the current header <th>
headers.push(
<th key={`header-${key}`} colSpan={colSpan} style={{ borderBottom: 0 }}>
- {key}
+ {originalLabel}
<span
css={css`
float: right;
@@ -975,7 +977,7 @@ export default function TableChart<D extends DataRecord = DataRecord>(
),
Footer: totals ? (
i === 0 ? (
- <th>
+ <th key={`footer-summary-${i}`}>
<div
css={css`
display: flex;
@@ -997,7 +999,7 @@ export default function TableChart<D extends DataRecord = DataRecord>(
</div>
</th>
) : (
- <td style={sharedStyle}>
+ <td key={`footer-total-${i}`} style={sharedStyle}>
<strong>{formatColumnValue(column, totals[key])[1]}</strong>
</td>
)
diff --git a/superset-frontend/plugins/plugin-chart-table/src/transformProps.ts b/superset-frontend/plugins/plugin-chart-table/src/transformProps.ts
index 48871e4ea4..d62d9cb92c 100644
--- a/superset-frontend/plugins/plugin-chart-table/src/transformProps.ts
+++ b/superset-frontend/plugins/plugin-chart-table/src/transformProps.ts
@@ -347,6 +347,7 @@ const processComparisonColumns = (
} = props;
const savedFormat = columnFormats?.[col.key];
const savedCurrency = currencyFormats?.[col.key];
+ const originalLabel = col.label;
if (
(col.isMetric || col.isPercentMetric) &&
!col.key.includes(comparisonSuffix) &&
@@ -355,6 +356,7 @@ const processComparisonColumns = (
return [
{
...col,
+ originalLabel,
label: t('Main'),
key: `${t('Main')} ${col.key}`,
config: getComparisonColConfig(t('Main'), col.key, columnConfig),
@@ -368,6 +370,7 @@ const processComparisonColumns = (
},
{
...col,
+ originalLabel,
label: `#`,
key: `# ${col.key}`,
config: getComparisonColConfig(`#`, col.key, columnConfig),
@@ -381,6 +384,7 @@ const processComparisonColumns = (
},
{
...col,
+ originalLabel,
label: `△`,
key: `△ ${col.key}`,
config: getComparisonColConfig(`△`, col.key, columnConfig),
@@ -394,6 +398,7 @@ const processComparisonColumns = (
},
{
...col,
+ originalLabel,
label: `%`,
key: `% ${col.key}`,
config: getComparisonColConfig(`%`, col.key, columnConfig),
diff --git a/superset-frontend/plugins/plugin-chart-table/src/types.ts b/superset-frontend/plugins/plugin-chart-table/src/types.ts
index 1ec3cbe29d..62a666a88e 100644
--- a/superset-frontend/plugins/plugin-chart-table/src/types.ts
+++ b/superset-frontend/plugins/plugin-chart-table/src/types.ts
@@ -56,6 +56,8 @@ export interface DataColumnMeta {
key: string;
// `label` is verbose column name used for rendering
label: string;
+ // `originalLabel` preserves the original label when time comparison transforms the labels
+ originalLabel?: string;
dataType: GenericDataType;
formatter?:
| TimeFormatter
diff --git a/superset-frontend/plugins/plugin-chart-table/test/TableChart.test.tsx b/superset-frontend/plugins/plugin-chart-table/test/TableChart.test.tsx
index b21a657b81..b74e1ffccf 100644
--- a/superset-frontend/plugins/plugin-chart-table/test/TableChart.test.tsx
+++ b/superset-frontend/plugins/plugin-chart-table/test/TableChart.test.tsx
@@ -175,6 +175,75 @@ describe('plugin-chart-table', () => {
?.formatter?.(0.123456);
expect(formattedPercentMetric).toBe('0.123');
});
+
+ it('should set originalLabel for comparison columns when time_compare and comparison_type are set', () => {
+ const transformedProps = transformProps(testData.comparison);
+
+ // Check if comparison columns are processed
+ const comparisonColumns = transformedProps.columns.filter(
+ col =>
+ col.label === 'Main' ||
+ col.label === '#' ||
+ col.label === '△' ||
+ col.label === '%',
+ );
+
+ expect(comparisonColumns.length).toBeGreaterThan(0);
+ expect(comparisonColumns.some(col => col.label === 'Main')).toBe(true);
+ expect(comparisonColumns.some(col => col.label === '#')).toBe(true);
+ expect(comparisonColumns.some(col => col.label === '△')).toBe(true);
+ expect(comparisonColumns.some(col => col.label === '%')).toBe(true);
+
+ // Verify originalLabel for metric_1 comparison columns
+ const mainMetric1 = transformedProps.columns.find(
+ col => col.key === 'Main metric_1',
+ );
+ expect(mainMetric1).toBeDefined();
+ expect(mainMetric1?.originalLabel).toBe('metric_1');
+
+ const hashMetric1 = transformedProps.columns.find(
+ col => col.key === '# metric_1',
+ );
+ expect(hashMetric1).toBeDefined();
+ expect(hashMetric1?.originalLabel).toBe('metric_1');
+
+ const deltaMetric1 = transformedProps.columns.find(
+ col => col.key === '△ metric_1',
+ );
+ expect(deltaMetric1).toBeDefined();
+ expect(deltaMetric1?.originalLabel).toBe('metric_1');
+
+ const percentMetric1 = transformedProps.columns.find(
+ col => col.key === '% metric_1',
+ );
+ expect(percentMetric1).toBeDefined();
+ expect(percentMetric1?.originalLabel).toBe('metric_1');
+
+ // Verify originalLabel for metric_2 comparison columns
+ const mainMetric2 = transformedProps.columns.find(
+ col => col.key === 'Main metric_2',
+ );
+ expect(mainMetric2).toBeDefined();
+ expect(mainMetric2?.originalLabel).toBe('metric_2');
+
+ const hashMetric2 = transformedProps.columns.find(
+ col => col.key === '# metric_2',
+ );
+ expect(hashMetric2).toBeDefined();
+ expect(hashMetric2?.originalLabel).toBe('metric_2');
+
+ const deltaMetric2 = transformedProps.columns.find(
+ col => col.key === '△ metric_2',
+ );
+ expect(deltaMetric2).toBeDefined();
+ expect(deltaMetric2?.originalLabel).toBe('metric_2');
+
+ const percentMetric2 = transformedProps.columns.find(
+ col => col.key === '% metric_2',
+ );
+ expect(percentMetric2).toBeDefined();
+ expect(percentMetric2?.originalLabel).toBe('metric_2');
+ });
});
describe('TableChart', () => {
@@ -400,6 +469,17 @@ describe('plugin-chart-table', () => {
);
expect(getComputedStyle(screen.getByText('N/A')).background).toBe('');
});
+ it('should display originalLabel in grouped headers', () => {
+ render(
+ <ThemeProvider theme={supersetTheme}>
+ <TableChart {...transformProps(testData.comparison)} sticky={false} />
+ </ThemeProvider>,
+ );
+
+ const groupHeaders = screen.getAllByRole('columnheader');
+ expect(groupHeaders[0]).toHaveTextContent('metric_1');
+ expect(groupHeaders[1]).toHaveTextContent('metric_2');
+ });
});
it('render cell bars properly, and only when it is toggled on in both regular and percent metrics', () => {
(superset) 11/15: fix: CSV/Excel upload form change column dates description (#32797)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 10ff1519716f775748f245817025e5147e0f2ed7
Author: SBIN2010 <13...@users.noreply.github.com>
AuthorDate: Mon Mar 24 19:48:39 2025 +0300
fix: CSV/Excel upload form change column dates description (#32797)
---
superset-frontend/src/features/databases/UploadDataModel/index.tsx | 2 +-
superset/translations/ar/LC_MESSAGES/messages.po | 4 ++--
superset/translations/de/LC_MESSAGES/messages.po | 6 +++---
superset/translations/en/LC_MESSAGES/messages.po | 2 +-
superset/translations/es/LC_MESSAGES/messages.po | 4 ++--
superset/translations/fr/LC_MESSAGES/messages.po | 6 +++---
superset/translations/it/LC_MESSAGES/messages.po | 4 ++--
superset/translations/ja/LC_MESSAGES/messages.po | 4 ++--
superset/translations/ko/LC_MESSAGES/messages.po | 4 ++--
superset/translations/messages.pot | 2 +-
superset/translations/nl/LC_MESSAGES/messages.po | 6 +++---
superset/translations/pt/LC_MESSAGES/messages.po | 4 ++--
superset/translations/pt_BR/LC_MESSAGES/messages.po | 6 +++---
superset/translations/ru/LC_MESSAGES/messages.po | 6 +++---
superset/translations/sk/LC_MESSAGES/messages.po | 2 +-
superset/translations/sl/LC_MESSAGES/messages.po | 4 ++--
superset/translations/tr/LC_MESSAGES/messages.po | 4 ++--
superset/translations/uk/LC_MESSAGES/messages.po | 4 ++--
superset/translations/zh/LC_MESSAGES/messages.po | 4 ++--
superset/translations/zh_TW/LC_MESSAGES/messages.po | 4 ++--
20 files changed, 41 insertions(+), 41 deletions(-)
diff --git a/superset-frontend/src/features/databases/UploadDataModel/index.tsx b/superset-frontend/src/features/databases/UploadDataModel/index.tsx
index 9a7626505d..1a6ce411a7 100644
--- a/superset-frontend/src/features/databases/UploadDataModel/index.tsx
+++ b/superset-frontend/src/features/databases/UploadDataModel/index.tsx
@@ -792,7 +792,7 @@ const UploadDataModal: FunctionComponent<UploadDataModalProps> = ({
allowClear
allowNewOptions
placeholder={t(
- 'A comma separated list of columns that should be parsed as dates',
+ 'Select column names from a dropdown list that should be parsed as dates.',
)}
/>
</StyledFormItem>
diff --git a/superset/translations/ar/LC_MESSAGES/messages.po b/superset/translations/ar/LC_MESSAGES/messages.po
index 8fd18603d4..38e6732d0e 100644
--- a/superset/translations/ar/LC_MESSAGES/messages.po
+++ b/superset/translations/ar/LC_MESSAGES/messages.po
@@ -630,8 +630,8 @@ msgstr ">= (أكبر أو يساوي)"
msgid "A Big Number"
msgstr "عدد كبير"
-msgid "A comma separated list of columns that should be parsed as dates"
-msgstr "قائمة مفصولة بفواصل من الأعمدة التي يجب تحليلها كتواريخ"
+msgid "Select column names from a dropdown list that should be parsed as dates."
+msgstr "حدد أسماء الأعمدة من القائمة المنسدلة التي يجب معاملتها كتواريخ."
msgid "A comma-separated list of schemas that files are allowed to upload to."
msgstr "قائمة مفصولة بفواصل من المخططات التي يسمح للملفات بالتحميل إليها."
diff --git a/superset/translations/de/LC_MESSAGES/messages.po b/superset/translations/de/LC_MESSAGES/messages.po
index a6b8ba611d..81c65007d6 100644
--- a/superset/translations/de/LC_MESSAGES/messages.po
+++ b/superset/translations/de/LC_MESSAGES/messages.po
@@ -664,10 +664,10 @@ msgstr ">= (Größer oder gleich)"
msgid "A Big Number"
msgstr "Eine Große Zahl"
-msgid "A comma separated list of columns that should be parsed as dates"
+msgid "Select column names from a dropdown list that should be parsed as dates."
msgstr ""
-"Eine durch Kommas getrennte Liste von Spalten, die als Datumsangaben "
-"interpretiert werden sollen"
+"Wählen Sie aus der Dropdown-Liste die Namen der Spalten aus, die als Datum "
+"interpretiert werden sollen."
msgid "A comma-separated list of schemas that files are allowed to upload to."
msgstr ""
diff --git a/superset/translations/en/LC_MESSAGES/messages.po b/superset/translations/en/LC_MESSAGES/messages.po
index e9802f1b7e..8b060e4a20 100644
--- a/superset/translations/en/LC_MESSAGES/messages.po
+++ b/superset/translations/en/LC_MESSAGES/messages.po
@@ -579,7 +579,7 @@ msgstr ""
msgid "A Big Number"
msgstr ""
-msgid "A comma separated list of columns that should be parsed as dates"
+msgid "Select column names from a dropdown list that should be parsed as dates."
msgstr ""
msgid "A comma-separated list of schemas that files are allowed to upload to."
diff --git a/superset/translations/es/LC_MESSAGES/messages.po b/superset/translations/es/LC_MESSAGES/messages.po
index 88b49fb282..748d1fa7dd 100644
--- a/superset/translations/es/LC_MESSAGES/messages.po
+++ b/superset/translations/es/LC_MESSAGES/messages.po
@@ -618,9 +618,9 @@ msgid "A Big Number"
msgstr "Número Grande"
#, fuzzy
-msgid "A comma separated list of columns that should be parsed as dates"
+msgid "Select column names from a dropdown list that should be parsed as dates."
msgstr ""
-"Una lista separada por comas de columnas que deben ser parseadas como "
+"Seleccione en la lista desplegable los nombres de las columnas que deben analizarse como "
"fechas."
#, fuzzy
diff --git a/superset/translations/fr/LC_MESSAGES/messages.po b/superset/translations/fr/LC_MESSAGES/messages.po
index d2f70f2568..b48cd8c3a5 100644
--- a/superset/translations/fr/LC_MESSAGES/messages.po
+++ b/superset/translations/fr/LC_MESSAGES/messages.po
@@ -636,10 +636,10 @@ msgid "A Big Number"
msgstr "Gros nombre"
#, fuzzy
-msgid "A comma separated list of columns that should be parsed as dates"
+msgid "Select column names from a dropdown list that should be parsed as dates."
msgstr ""
-"Une liste de colonnes séparées par des virgules qui doivent être "
-"analysées comme des dates."
+"Sélectionnez dans la liste déroulante les noms des colonnes à analyser en tant "
+"que dates"
#, fuzzy
msgid "A comma-separated list of schemas that files are allowed to upload to."
diff --git a/superset/translations/it/LC_MESSAGES/messages.po b/superset/translations/it/LC_MESSAGES/messages.po
index 8458fd9554..001dc63c11 100644
--- a/superset/translations/it/LC_MESSAGES/messages.po
+++ b/superset/translations/it/LC_MESSAGES/messages.po
@@ -601,8 +601,8 @@ msgstr ""
msgid "A Big Number"
msgstr "Numero Grande"
-msgid "A comma separated list of columns that should be parsed as dates"
-msgstr ""
+msgid "Select column names from a dropdown list that should be parsed as dates."
+msgstr "Selezionare i nomi delle colonne da elaborare come date dall'elenco a discesa."
msgid "A comma-separated list of schemas that files are allowed to upload to."
msgstr ""
diff --git a/superset/translations/ja/LC_MESSAGES/messages.po b/superset/translations/ja/LC_MESSAGES/messages.po
index f897083118..fd9ee19b8e 100644
--- a/superset/translations/ja/LC_MESSAGES/messages.po
+++ b/superset/translations/ja/LC_MESSAGES/messages.po
@@ -616,8 +616,8 @@ msgstr ">= (大きいか等しい)"
msgid "A Big Number"
msgstr "大きな数字"
-msgid "A comma separated list of columns that should be parsed as dates"
-msgstr "日付として解析する必要がある列のカンマ区切りのリスト"
+msgid "Select column names from a dropdown list that should be parsed as dates."
+msgstr "日付として解析する列の名前をドロップダウン・リストから選択する。"
msgid "A comma-separated list of schemas that files are allowed to upload to."
msgstr "ファイルのアップロードを許可するスキーマのカンマ区切りのリスト"
diff --git a/superset/translations/ko/LC_MESSAGES/messages.po b/superset/translations/ko/LC_MESSAGES/messages.po
index 2c8f1a8f7d..bd245cfa07 100644
--- a/superset/translations/ko/LC_MESSAGES/messages.po
+++ b/superset/translations/ko/LC_MESSAGES/messages.po
@@ -599,8 +599,8 @@ msgstr ""
msgid "A Big Number"
msgstr "테이블 명"
-msgid "A comma separated list of columns that should be parsed as dates"
-msgstr ""
+msgid "Select column names from a dropdown list that should be parsed as dates."
+msgstr "드롭다운 목록에서 날짜로 처리할 열 이름을 선택합니다."
msgid "A comma-separated list of schemas that files are allowed to upload to."
msgstr ""
diff --git a/superset/translations/messages.pot b/superset/translations/messages.pot
index fc9f1c937d..e32e2b6597 100644
--- a/superset/translations/messages.pot
+++ b/superset/translations/messages.pot
@@ -585,7 +585,7 @@ msgstr ""
msgid "A Big Number"
msgstr ""
-msgid "A comma separated list of columns that should be parsed as dates"
+msgid "Select column names from a dropdown list that should be parsed as dates."
msgstr ""
msgid "A comma-separated list of schemas that files are allowed to upload to."
diff --git a/superset/translations/nl/LC_MESSAGES/messages.po b/superset/translations/nl/LC_MESSAGES/messages.po
index b7717a7094..e652b9b74f 100644
--- a/superset/translations/nl/LC_MESSAGES/messages.po
+++ b/superset/translations/nl/LC_MESSAGES/messages.po
@@ -629,10 +629,10 @@ msgstr ">= (Groter of gelijk)"
msgid "A Big Number"
msgstr "Een groot getal"
-msgid "A comma separated list of columns that should be parsed as dates"
+msgid "Select column names from a dropdown list that should be parsed as dates."
msgstr ""
-"Een door komma's gescheiden lijst van kolommen die als datums moeten "
-"worden geïnterpreteerd"
+"Selecteer de kolomnamen die moeten worden behandeld als datums "
+"in de vervolgkeuzelijst"
msgid "A comma-separated list of schemas that files are allowed to upload to."
msgstr ""
diff --git a/superset/translations/pt/LC_MESSAGES/messages.po b/superset/translations/pt/LC_MESSAGES/messages.po
index ecd7db908f..32e5bc7a54 100644
--- a/superset/translations/pt/LC_MESSAGES/messages.po
+++ b/superset/translations/pt/LC_MESSAGES/messages.po
@@ -606,8 +606,8 @@ msgstr ""
msgid "A Big Number"
msgstr "Número grande"
-msgid "A comma separated list of columns that should be parsed as dates"
-msgstr ""
+msgid "Select column names from a dropdown list that should be parsed as dates."
+msgstr "Selecione os nomes das colunas a serem tratadas como datas na lista pendente."
msgid "A comma-separated list of schemas that files are allowed to upload to."
msgstr ""
diff --git a/superset/translations/pt_BR/LC_MESSAGES/messages.po b/superset/translations/pt_BR/LC_MESSAGES/messages.po
index ab06eb013a..6aec74f751 100644
--- a/superset/translations/pt_BR/LC_MESSAGES/messages.po
+++ b/superset/translations/pt_BR/LC_MESSAGES/messages.po
@@ -642,10 +642,10 @@ msgstr ">= (Maior ou equal)"
msgid "A Big Number"
msgstr "Um grande número"
-msgid "A comma separated list of columns that should be parsed as dates"
+msgid "Select column names from a dropdown list that should be parsed as dates."
msgstr ""
-"Uma lista separada por vírgulas de colunas que devem ser analisadas como "
-"datas"
+"Selecione os nomes das colunas a serem analisadas como datas na lista "
+"pendente"
msgid "A comma-separated list of schemas that files are allowed to upload to."
msgstr ""
diff --git a/superset/translations/ru/LC_MESSAGES/messages.po b/superset/translations/ru/LC_MESSAGES/messages.po
index e37055b24e..a4e5996d0a 100644
--- a/superset/translations/ru/LC_MESSAGES/messages.po
+++ b/superset/translations/ru/LC_MESSAGES/messages.po
@@ -645,10 +645,10 @@ msgstr ">= (больше или равно)"
msgid "A Big Number"
msgstr "Карточка"
-msgid "A comma separated list of columns that should be parsed as dates"
+msgid "Select column names from a dropdown list that should be parsed as dates."
msgstr ""
-"Разделенный запятыми список столбцов, которые должны быть "
-"интерпретированы как даты."
+"Выберите из выпадающего списка имена столбцов, которые должны быть "
+"обработаны как даты"
msgid "A comma-separated list of schemas that files are allowed to upload to."
msgstr "Разделенный запятыми список схем, в которые можно загружать файлы."
diff --git a/superset/translations/sk/LC_MESSAGES/messages.po b/superset/translations/sk/LC_MESSAGES/messages.po
index c92d3083d1..d1ce35080b 100644
--- a/superset/translations/sk/LC_MESSAGES/messages.po
+++ b/superset/translations/sk/LC_MESSAGES/messages.po
@@ -583,7 +583,7 @@ msgstr ""
msgid "A Big Number"
msgstr ""
-msgid "A comma separated list of columns that should be parsed as dates"
+msgid "Select column names from a dropdown list that should be parsed as dates."
msgstr ""
msgid "A comma-separated list of schemas that files are allowed to upload to."
diff --git a/superset/translations/sl/LC_MESSAGES/messages.po b/superset/translations/sl/LC_MESSAGES/messages.po
index 55cc6c0a08..d0ee104544 100644
--- a/superset/translations/sl/LC_MESSAGES/messages.po
+++ b/superset/translations/sl/LC_MESSAGES/messages.po
@@ -681,8 +681,8 @@ msgstr ">= (večje ali enako)"
msgid "A Big Number"
msgstr "Velika številka"
-msgid "A comma separated list of columns that should be parsed as dates"
-msgstr "Z vejico ločen seznam stolpcev, v katerih bodo prepoznani datumi"
+msgid "Select column names from a dropdown list that should be parsed as dates."
+msgstr "S spustnega seznama izberite imena stolpcev, ki bodo obravnavani kot datumi."
msgid "A comma-separated list of schemas that files are allowed to upload to."
msgstr "Z vejicami ločen seznam shem, kjer je dovoljeno nalaganje datotek."
diff --git a/superset/translations/tr/LC_MESSAGES/messages.po b/superset/translations/tr/LC_MESSAGES/messages.po
index 0fadea94f0..c51c4b1e91 100644
--- a/superset/translations/tr/LC_MESSAGES/messages.po
+++ b/superset/translations/tr/LC_MESSAGES/messages.po
@@ -581,8 +581,8 @@ msgstr ""
msgid "A Big Number"
msgstr ""
-msgid "A comma separated list of columns that should be parsed as dates"
-msgstr ""
+msgid "Select column names from a dropdown list that should be parsed as dates."
+msgstr "Açılır listeden tarih olarak değerlendirilecek sütun adlarını seçin."
msgid "A comma-separated list of schemas that files are allowed to upload to."
msgstr ""
diff --git a/superset/translations/uk/LC_MESSAGES/messages.po b/superset/translations/uk/LC_MESSAGES/messages.po
index e62117c9a5..235335e2f8 100644
--- a/superset/translations/uk/LC_MESSAGES/messages.po
+++ b/superset/translations/uk/LC_MESSAGES/messages.po
@@ -634,8 +634,8 @@ msgstr "> = (Більший або рівний)"
msgid "A Big Number"
msgstr "Велика кількість"
-msgid "A comma separated list of columns that should be parsed as dates"
-msgstr "Кома -розділений список стовпців, які слід проаналізувати як дати"
+msgid "Select column names from a dropdown list that should be parsed as dates."
+msgstr "Виберіть імена стовпців зі списку, що випадає, які слід розібрати як дати."
msgid "A comma-separated list of schemas that files are allowed to upload to."
msgstr "Список схем, відокремлений комами, до яких файли дозволяють завантажувати."
diff --git a/superset/translations/zh/LC_MESSAGES/messages.po b/superset/translations/zh/LC_MESSAGES/messages.po
index 9b96fb8236..4128f99c90 100644
--- a/superset/translations/zh/LC_MESSAGES/messages.po
+++ b/superset/translations/zh/LC_MESSAGES/messages.po
@@ -621,8 +621,8 @@ msgid "A Big Number"
msgstr "大数字"
#, fuzzy
-msgid "A comma separated list of columns that should be parsed as dates"
-msgstr "应作为日期解析的列的逗号分隔列表。"
+msgid "Select column names from a dropdown list that should be parsed as dates."
+msgstr "从下拉列表中选择要作为日期处理的列名称。"
#, fuzzy
msgid "A comma-separated list of schemas that files are allowed to upload to."
diff --git a/superset/translations/zh_TW/LC_MESSAGES/messages.po b/superset/translations/zh_TW/LC_MESSAGES/messages.po
index a76e95acd1..1fe130e01f 100644
--- a/superset/translations/zh_TW/LC_MESSAGES/messages.po
+++ b/superset/translations/zh_TW/LC_MESSAGES/messages.po
@@ -620,8 +620,8 @@ msgid "A Big Number"
msgstr "大數字"
#, fuzzy
-msgid "A comma separated list of columns that should be parsed as dates"
-msgstr "應作為日期解析的列的逗號分隔列表。"
+msgid "Select column names from a dropdown list that should be parsed as dates."
+msgstr "从下拉列表中选择要分析的日期列名称。"
#, fuzzy
msgid "A comma-separated list of schemas that files are allowed to upload to."
(superset) 02/15: fix(migrations): fix foreign keys to match FAB 4.6.0 tables (#32759)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 770b3e17bb917c713d594e7b24119e2079f6cf10
Author: Antonio Rivero <38...@users.noreply.github.com>
AuthorDate: Wed Mar 19 22:47:26 2025 +0100
fix(migrations): fix foreign keys to match FAB 4.6.0 tables (#32759)
(cherry picked from commit 376a1f49d339c393af678b12ad74ae91a72c94fc)
---
superset/migrations/shared/utils.py | 81 +++++++++++++--
...46_32bf93dfe2a4_add_on_cascade_in_fab_tables.py | 111 +++++++++++++++++++++
2 files changed, 184 insertions(+), 8 deletions(-)
diff --git a/superset/migrations/shared/utils.py b/superset/migrations/shared/utils.py
index b0a460f588..18166b047d 100644
--- a/superset/migrations/shared/utils.py
+++ b/superset/migrations/shared/utils.py
@@ -193,12 +193,16 @@ def has_table(table_name: str) -> bool:
return table_exists
-def drop_fks_for_table(table_name: str) -> None:
+def drop_fks_for_table(
+ table_name: str, foreign_key_names: list[str] | None = None
+) -> None:
"""
- Drop all foreign key constraints for a table if it exist and the database
- is not sqlite.
+ Drop specific or all foreign key constraints for a table
+ if they exist and the database is not sqlite.
- :param table_name: The table name to drop foreign key constraints for
+ :param table_name: The table name to drop foreign key constraints from
+ :param foreign_key_names: Optional list of specific foreign key names to drop.
+ If None is provided, all will be dropped.
"""
connection = op.get_bind()
inspector = Inspector.from_engine(connection)
@@ -207,12 +211,19 @@ def drop_fks_for_table(table_name: str) -> None:
return # sqlite doesn't like constraints
if has_table(table_name):
- foreign_keys = inspector.get_foreign_keys(table_name)
- for fk in foreign_keys:
+ existing_fks = {fk["name"] for fk in inspector.get_foreign_keys(table_name)}
+
+ # What to delete based on whether the list was passed
+ if foreign_key_names is not None:
+ foreign_key_names = list(set(foreign_key_names) & existing_fks)
+ else:
+ foreign_key_names = list(existing_fks)
+
+ for fk_name in foreign_key_names:
logger.info(
- f"Dropping foreign key {GREEN}{fk['name']}{RESET} from table {GREEN}{table_name}{RESET}..." # noqa: E501
+ f"Dropping foreign key {GREEN}{fk_name}{RESET} from table {GREEN}{table_name}{RESET}..." # noqa: E501
)
- op.drop_constraint(fk["name"], table_name, type_="foreignkey")
+ op.drop_constraint(fk_name, table_name, type_="foreignkey")
def create_table(table_name: str, *columns: SchemaItem) -> None:
@@ -398,3 +409,57 @@ def drop_index(table_name: str, index_name: str) -> None:
)
op.drop_index(table_name=table_name, index_name=index_name)
+
+
+def create_fks_for_table(
+ foreign_key_name: str,
+ table_name: str,
+ referenced_table: str,
+ local_cols: list[str],
+ remote_cols: list[str],
+ ondelete: Optional[str] = None,
+) -> None:
+ """
+ Create a foreign key constraint for a table, ensuring compatibility with sqlite.
+
+ :param foreign_key_name: Foreign key constraint name.
+ :param table_name: The name of the table where the foreign key will be created.
+ :param referenced_table: The table the FK references.
+ :param local_cols: Column names in the current table.
+ :param remote_cols: Column names in the referenced table.
+ :param ondelete: (Optional) The ON DELETE action (e.g., "CASCADE", "SET NULL").
+ """
+ connection = op.get_bind()
+
+ if not has_table(table_name):
+ logger.warning(
+ f"Table {LRED}{table_name}{RESET} does not exist. Skipping foreign key creation." # noqa: E501
+ )
+ return
+
+ if isinstance(connection.dialect, SQLiteDialect):
+ # SQLite requires batch mode since ALTER TABLE is limited
+ with op.batch_alter_table(table_name) as batch_op:
+ logger.info(
+ f"Creating foreign key {GREEN}{foreign_key_name}{RESET} on table {GREEN}{table_name}{RESET} (SQLite mode)..." # noqa: E501
+ )
+ batch_op.create_foreign_key(
+ foreign_key_name,
+ referenced_table,
+ local_cols,
+ remote_cols,
+ ondelete=ondelete,
+ )
+ else:
+ # Standard FK creation for other databases
+ logger.info(
+ f"Creating foreign key {GREEN}{foreign_key_name}{RESET} on table {GREEN}{table_name}{RESET}..." # noqa: E501
+ )
+ op.create_foreign_key(
+ foreign_key_name,
+ table_name,
+ referenced_table,
+ local_cols,
+ remote_cols,
+ ondelete=ondelete,
+ )
diff --git a/superset/migrations/versions/2025-03-19_17-46_32bf93dfe2a4_add_on_cascade_in_fab_tables.py b/superset/migrations/versions/2025-03-19_17-46_32bf93dfe2a4_add_on_cascade_in_fab_tables.py
new file mode 100644
index 0000000000..e7a9a3d75c
--- /dev/null
+++ b/superset/migrations/versions/2025-03-19_17-46_32bf93dfe2a4_add_on_cascade_in_fab_tables.py
@@ -0,0 +1,111 @@
+# 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.
+"""Add on cascade to foreign keys in ab_permission_view_role and ab_user_role
+
+Revision ID: 32bf93dfe2a4
+Revises: 94e7a3499973
+Create Date: 2025-03-19 17:46:25.702610
+
+"""
+
+from superset.migrations.shared.utils import create_fks_for_table, drop_fks_for_table
+
+# revision identifiers, used by Alembic.
+revision = "32bf93dfe2a4"
+down_revision = "94e7a3499973"
+
+
+def upgrade():
+ drop_fks_for_table(
+ "ab_permission_view_role",
+ [
+ "ab_permission_view_role_permission_view_id_fkey",
+ "ab_permission_view_role_role_id_fkey",
+ ],
+ )
+ create_fks_for_table(
+ "ab_permission_view_role_role_id_fkey",
+ "ab_permission_view_role",
+ "ab_role",
+ ["role_id"],
+ ["id"],
+ ondelete="CASCADE",
+ )
+ create_fks_for_table(
+ "ab_permission_view_role_permission_view_id_fkey",
+ "ab_permission_view_role",
+ "ab_permission_view",
+ ["permission_view_id"],
+ ["id"],
+ ondelete="CASCADE",
+ )
+
+ drop_fks_for_table(
+ "ab_user_role",
+ ["ab_user_role_user_id_fkey", "ab_user_role_role_id_fkey"],
+ )
+ create_fks_for_table(
+ "ab_user_role_user_id_fkey",
+ "ab_user_role",
+ "ab_user",
+ ["user_id"],
+ ["id"],
+ ondelete="CASCADE",
+ )
+ create_fks_for_table(
+ "ab_user_role_role_id_fkey",
+ "ab_user_role",
+ "ab_role",
+ ["role_id"],
+ ["id"],
+ ondelete="CASCADE",
+ )
+
+
+def downgrade():
+ drop_fks_for_table(
+ "ab_permission_view_role",
+ [
+ "ab_permission_view_role_permission_view_id_fkey",
+ "ab_permission_view_role_role_id_fkey",
+ ],
+ )
+ create_fks_for_table(
+ "ab_permission_view_role_permission_view_id_fkey",
+ "ab_permission_view_role",
+ "ab_permission_view",
+ ["permission_view_id"],
+ ["id"],
+ )
+ create_fks_for_table(
+ "ab_permission_view_role_role_id_fkey",
+ "ab_permission_view_role",
+ "ab_role",
+ ["role_id"],
+ ["id"],
+ )
+
+ drop_fks_for_table(
+ "ab_user_role",
+ ["ab_user_role_user_id_fkey", "ab_user_role_role_id_fkey"],
+ )
+ create_fks_for_table(
+ "ab_user_role_user_id_fkey", "ab_user_role", "ab_user", ["user_id"], ["id"]
+ )
+ create_fks_for_table(
+ "ab_user_role_role_id_fkey", "ab_user_role", "ab_role", ["role_id"], ["id"]
+ )
(superset) 01/15: feat: DB migration for dataset folders (#32680)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 49398ce93ec4eef25c462abc63b8681c031b5367
Author: Beto Dealmeida <ro...@dealmeida.net>
AuthorDate: Fri Mar 14 17:16:02 2025 -0400
feat: DB migration for dataset folders (#32680)
(cherry picked from commit b64e3254fcd0cbcafdab0e75762dd707991e4f20)
---
...2_94e7a3499973_add_folders_column_to_dataset.py | 42 ++++++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/superset/migrations/versions/2025-03-03_20-52_94e7a3499973_add_folders_column_to_dataset.py b/superset/migrations/versions/2025-03-03_20-52_94e7a3499973_add_folders_column_to_dataset.py
new file mode 100644
index 0000000000..3e767f36a6
--- /dev/null
+++ b/superset/migrations/versions/2025-03-03_20-52_94e7a3499973_add_folders_column_to_dataset.py
@@ -0,0 +1,42 @@
+# 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.
+"""Add folders column to datasets
+
+Revision ID: 94e7a3499973
+Revises: 74ad1125881c
+Create Date: 2025-03-03 20:52:24.585143
+
+"""
+
+import sqlalchemy as sa
+from alembic import op
+from sqlalchemy.types import JSON
+
+# revision identifiers, used by Alembic.
+revision = "94e7a3499973"
+down_revision = "74ad1125881c"
+
+
+def upgrade():
+ op.add_column(
+ "tables",
+ sa.Column("folders", JSON, nullable=True),
+ )
+
+
+def downgrade():
+ op.drop_column("tables", "folders")
(superset) 12/15: fix: key error in frontend on disallowed GSheets (#32792)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 76070218caf2b40dbbb48387a53f548d10235ed1
Author: Chris <14...@users.noreply.github.com>
AuthorDate: Mon Mar 24 23:19:59 2025 +0100
fix: key error in frontend on disallowed GSheets (#32792)
(cherry picked from commit 6f69c84d10c3bf9f4bfa20ae876d1dfb7cc695e3)
---
superset/views/base.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/superset/views/base.py b/superset/views/base.py
index bc1b572089..a00c91338f 100644
--- a/superset/views/base.py
+++ b/superset/views/base.py
@@ -318,7 +318,10 @@ def cached_common_bootstrap_data( # pylint: disable=unused-argument
# verify client has google sheets installed
available_specs = get_available_engine_specs()
- frontend_config["HAS_GSHEETS_INSTALLED"] = bool(available_specs[GSheetsEngineSpec])
+ frontend_config["HAS_GSHEETS_INSTALLED"] = (
+ GSheetsEngineSpec in available_specs
+ and bool(available_specs[GSheetsEngineSpec])
+ )
language = locale.language if locale else "en"
(superset) 14/15: fix(log): store navigation path to get correct logging path (#32795)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit fd44f705283e0f8de86ea2fc481066ccd45a2362
Author: JUST.in DO IT <ju...@airbnb.com>
AuthorDate: Tue Mar 25 10:18:55 2025 -0700
fix(log): store navigation path to get correct logging path (#32795)
(cherry picked from commit 4a70065e5f6840fbcd657f50045c825a7b1d58d6)
---
superset-frontend/src/middleware/logger.test.js | 22 +++-
.../src/middleware/loggerMiddleware.js | 140 +++++++++++----------
2 files changed, 92 insertions(+), 70 deletions(-)
diff --git a/superset-frontend/src/middleware/logger.test.js b/superset-frontend/src/middleware/logger.test.js
index 629940b969..0a28d42fde 100644
--- a/superset-frontend/src/middleware/logger.test.js
+++ b/superset-frontend/src/middleware/logger.test.js
@@ -20,7 +20,10 @@ import sinon from 'sinon';
import { SupersetClient } from '@superset-ui/core';
import logger from 'src/middleware/loggerMiddleware';
import { LOG_EVENT } from 'src/logger/actions';
-import { LOG_ACTIONS_LOAD_CHART } from 'src/logger/LogUtils';
+import {
+ LOG_ACTIONS_LOAD_CHART,
+ LOG_ACTIONS_SPA_NAVIGATION,
+} from 'src/logger/LogUtils';
describe('logger middleware', () => {
const dashboardId = 123;
@@ -40,7 +43,6 @@ describe('logger middleware', () => {
eventData: {
key: 'value',
start_offset: 100,
- path: `/dashboard/${dashboardId}/`,
},
},
};
@@ -82,11 +84,19 @@ describe('logger middleware', () => {
});
it('should include ts, start_offset, event_name, impression_id, source, and source_id in every event', () => {
- logger(mockStore)(next)(action);
+ const fetchLog = logger(mockStore)(next);
+ fetchLog({
+ type: LOG_EVENT,
+ payload: {
+ eventName: LOG_ACTIONS_SPA_NAVIGATION,
+ eventData: { path: `/dashboard/${dashboardId}/` },
+ },
+ });
timeSandbox.clock.tick(2000);
-
- expect(SupersetClient.post.callCount).toBe(1);
- const { events } = SupersetClient.post.getCall(0).args[0].postPayload;
+ fetchLog(action);
+ timeSandbox.clock.tick(2000);
+ expect(SupersetClient.post.callCount).toBe(2);
+ const { events } = SupersetClient.post.getCall(1).args[0].postPayload;
const mockEventdata = action.payload.eventData;
const mockEventname = action.payload.eventName;
expect(events[0]).toMatchObject({
diff --git a/superset-frontend/src/middleware/loggerMiddleware.js b/superset-frontend/src/middleware/loggerMiddleware.js
index a3eb629571..c008d027b3 100644
--- a/superset-frontend/src/middleware/loggerMiddleware.js
+++ b/superset-frontend/src/middleware/loggerMiddleware.js
@@ -23,7 +23,10 @@ import { SupersetClient } from '@superset-ui/core';
import { safeStringify } from '../utils/safeStringify';
import { LOG_EVENT } from '../logger/actions';
-import { LOG_EVENT_TYPE_TIMING } from '../logger/LogUtils';
+import {
+ LOG_EVENT_TYPE_TIMING,
+ LOG_ACTIONS_SPA_NAVIGATION,
+} from '../logger/LogUtils';
import DebouncedMessageQueue from '../utils/DebouncedMessageQueue';
const LOG_ENDPOINT = '/superset/log/?explode=events';
@@ -67,78 +70,87 @@ const logMessageQueue = new DebouncedMessageQueue({
delayThreshold: 1000,
});
let lastEventId = 0;
-const loggerMiddleware = store => next => action => {
- if (action.type !== LOG_EVENT) {
- return next(action);
- }
+const loggerMiddleware = store => next => {
+ let navPath;
+ return action => {
+ if (action.type !== LOG_EVENT) {
+ return next(action);
+ }
- const { dashboardInfo, explore, impressionId, dashboardLayout, sqlLab } =
- store.getState();
- let logMetadata = {
- impression_id: impressionId,
- version: 'v2',
- };
- const { eventName } = action.payload;
- let { eventData = {} } = action.payload;
+ const { dashboardInfo, explore, impressionId, dashboardLayout, sqlLab } =
+ store.getState();
+ let logMetadata = {
+ impression_id: impressionId,
+ version: 'v2',
+ };
+ const { eventName } = action.payload;
+ let { eventData = {} } = action.payload;
- const path = eventData.path || window?.location?.href;
+ if (eventName === LOG_ACTIONS_SPA_NAVIGATION) {
+ navPath = eventData.path;
+ }
+ const path = navPath || window?.location?.href;
- if (dashboardInfo?.id && path?.includes('/dashboard/')) {
- logMetadata = {
- source: 'dashboard',
- source_id: dashboardInfo.id,
- dashboard_id: dashboardInfo.id,
- ...logMetadata,
- };
- } else if (explore?.slice) {
- logMetadata = {
- source: 'explore',
- source_id: explore.slice ? explore.slice.slice_id : 0,
- ...(explore.slice.slice_id && { slice_id: explore.slice.slice_id }),
- ...logMetadata,
- };
- } else if (path?.includes('/sqllab/')) {
- const editor = sqlLab.queryEditors.find(
- ({ id }) => id === sqlLab.tabHistory.slice(-1)[0],
- );
- logMetadata = {
- source: 'sqlLab',
- source_id: editor?.id,
- db_id: editor?.dbId,
- schema: editor?.schema,
- };
- }
+ if (dashboardInfo?.id && path?.includes('/dashboard/')) {
+ logMetadata = {
+ source: 'dashboard',
+ source_id: dashboardInfo.id,
+ dashboard_id: dashboardInfo.id,
+ ...logMetadata,
+ };
+ } else if (explore?.slice) {
+ logMetadata = {
+ source: 'explore',
+ source_id: explore.slice ? explore.slice.slice_id : 0,
+ ...(explore.slice.slice_id && { slice_id: explore.slice.slice_id }),
+ ...logMetadata,
+ };
+ } else if (path?.includes('/sqllab/')) {
+ const editor = sqlLab.queryEditors.find(
+ ({ id }) => id === sqlLab.tabHistory.slice(-1)[0],
+ );
+ logMetadata = {
+ source: 'sqlLab',
+ source_id: editor?.id,
+ db_id: editor?.dbId,
+ schema: editor?.schema,
+ };
+ }
- eventData = {
- ...logMetadata,
- ts: new Date().getTime(),
- event_name: eventName,
- ...eventData,
- };
- if (LOG_EVENT_TYPE_TIMING.has(eventName)) {
- eventData = {
- ...eventData,
- event_type: 'timing',
- trigger_event: lastEventId,
- };
- } else {
- lastEventId = nanoid();
eventData = {
+ ...logMetadata,
+ ts: new Date().getTime(),
+ event_name: eventName,
...eventData,
- event_type: 'user',
- event_id: lastEventId,
- visibility: document.visibilityState,
};
- }
+ if (LOG_EVENT_TYPE_TIMING.has(eventName)) {
+ eventData = {
+ ...eventData,
+ event_type: 'timing',
+ trigger_event: lastEventId,
+ };
+ } else {
+ lastEventId = nanoid();
+ eventData = {
+ ...eventData,
+ event_type: 'user',
+ event_id: lastEventId,
+ visibility: document.visibilityState,
+ };
+ }
- if (eventData.target_id && dashboardLayout?.present?.[eventData.target_id]) {
- const { meta } = dashboardLayout.present[eventData.target_id];
- // chart name or tab/header text
- eventData.target_name = meta.chartId ? meta.sliceName : meta.text;
- }
+ if (
+ eventData.target_id &&
+ dashboardLayout?.present?.[eventData.target_id]
+ ) {
+ const { meta } = dashboardLayout.present[eventData.target_id];
+ // chart name or tab/header text
+ eventData.target_name = meta.chartId ? meta.sliceName : meta.text;
+ }
- logMessageQueue.append(eventData);
- return eventData;
+ logMessageQueue.append(eventData);
+ return eventData;
+ };
};
export default loggerMiddleware;
(superset) 03/15: fix(chart control): Change default of "Y Axis Title Margin" (#32720)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 95c09aa38b8dac5d0b241888ba85d6a8c2f53f21
Author: Vladislav Korenkov <73...@users.noreply.github.com>
AuthorDate: Thu Mar 20 23:14:09 2025 +1000
fix(chart control): Change default of "Y Axis Title Margin" (#32720)
(cherry picked from commit d319543377f69ec6f0848e0393033283b39b5733)
---
.../cypress/e2e/dashboard/drillby.test.ts | 36 +++++++++++-----------
.../cypress/e2e/dashboard/drilltodetail.test.ts | 16 +++++-----
.../src/sections/chartTitle.tsx | 2 +-
.../src/Timeseries/Regular/Bar/controlPanel.tsx | 2 +-
4 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/superset-frontend/cypress-base/cypress/e2e/dashboard/drillby.test.ts b/superset-frontend/cypress-base/cypress/e2e/dashboard/drillby.test.ts
index e471d1da8c..44d994b4f4 100644
--- a/superset-frontend/cypress-base/cypress/e2e/dashboard/drillby.test.ts
+++ b/superset-frontend/cypress-base/cypress/e2e/dashboard/drillby.test.ts
@@ -511,29 +511,29 @@ describe('Drill by modal', () => {
it('Line chart', () => {
testEchart('echarts_timeseries_line', 'Line Chart', [
- [70, 93],
- [70, 93],
+ [85, 93],
+ [85, 93],
]);
});
it('Area Chart', () => {
testEchart('echarts_area', 'Area Chart', [
- [70, 93],
- [70, 93],
+ [85, 93],
+ [85, 93],
]);
});
it('Scatter Chart', () => {
testEchart('echarts_timeseries_scatter', 'Scatter Chart', [
- [70, 93],
- [70, 93],
+ [85, 93],
+ [85, 93],
]);
});
it('Bar Chart', () => {
testEchart('echarts_timeseries_bar', 'Bar Chart', [
- [70, 94],
- [362, 68],
+ [85, 94],
+ [490, 68],
]);
});
@@ -566,22 +566,22 @@ describe('Drill by modal', () => {
it('Generic Chart', () => {
testEchart('echarts_timeseries', 'Generic Chart', [
- [70, 93],
- [70, 93],
+ [85, 93],
+ [85, 93],
]);
});
it('Smooth Line Chart', () => {
testEchart('echarts_timeseries_smooth', 'Smooth Line Chart', [
- [70, 93],
- [70, 93],
+ [85, 93],
+ [85, 93],
]);
});
it('Step Line Chart', () => {
testEchart('echarts_timeseries_step', 'Step Line Chart', [
- [70, 93],
- [70, 93],
+ [85, 93],
+ [85, 93],
]);
});
@@ -617,8 +617,8 @@ describe('Drill by modal', () => {
cy.get('[data-test-viz-type="mixed_timeseries"] canvas').then($canvas => {
// click 'boy'
cy.wrap($canvas).scrollIntoView();
- cy.wrap($canvas).trigger('mouseover', 70, 93);
- cy.wrap($canvas).rightclick(70, 93);
+ cy.wrap($canvas).trigger('mouseover', 85, 93);
+ cy.wrap($canvas).rightclick(85, 93);
drillBy('name').then(intercepted => {
const { queries } = intercepted.request.body;
@@ -651,8 +651,8 @@ describe('Drill by modal', () => {
cy.get(`[data-test="drill-by-chart"] canvas`).then($canvas => {
// click second query
cy.wrap($canvas).scrollIntoView();
- cy.wrap($canvas).trigger('mouseover', 246, 114);
- cy.wrap($canvas).rightclick(246, 114);
+ cy.wrap($canvas).trigger('mouseover', 261, 114);
+ cy.wrap($canvas).rightclick(261, 114);
drillBy('ds').then(intercepted => {
const { queries } = intercepted.request.body;
diff --git a/superset-frontend/cypress-base/cypress/e2e/dashboard/drilltodetail.test.ts b/superset-frontend/cypress-base/cypress/e2e/dashboard/drilltodetail.test.ts
index 4ebd64dd6e..6183170d3b 100644
--- a/superset-frontend/cypress-base/cypress/e2e/dashboard/drilltodetail.test.ts
+++ b/superset-frontend/cypress-base/cypress/e2e/dashboard/drilltodetail.test.ts
@@ -96,24 +96,24 @@ function testTimeChart(vizType: string) {
cy.get(`[data-test-viz-type='${vizType}'] canvas`).then($canvas => {
cy.wrap($canvas).scrollIntoView();
- cy.wrap($canvas).trigger('mousemove', 70, 93);
- cy.wrap($canvas).rightclick(70, 93);
+ cy.wrap($canvas).trigger('mousemove', 85, 93);
+ cy.wrap($canvas).rightclick(85, 93);
drillToDetailBy('Drill to detail by 1965');
cy.getBySel('filter-val').should('contain', '1965');
closeModal();
cy.wrap($canvas).scrollIntoView();
- cy.wrap($canvas).trigger('mousemove', 70, 93);
- cy.wrap($canvas).rightclick(70, 93);
+ cy.wrap($canvas).trigger('mousemove', 85, 93);
+ cy.wrap($canvas).rightclick(85, 93);
drillToDetailBy('Drill to detail by boy');
cy.getBySel('filter-val').should('contain', 'boy');
closeModal();
cy.wrap($canvas).scrollIntoView();
- cy.wrap($canvas).trigger('mousemove', 70, 93);
- cy.wrap($canvas).rightclick(70, 93);
+ cy.wrap($canvas).trigger('mousemove', 85, 93);
+ cy.wrap($canvas).rightclick(85, 93);
drillToDetailBy('Drill to detail by all');
cy.getBySel('filter-val').first().should('contain', '1965');
@@ -435,7 +435,7 @@ describe('Drill to detail modal', () => {
SUPPORTED_TIER2_CHARTS.forEach(waitForChartLoad);
});
- describe('Modal actions', () => {
+ describe.only('Modal actions', () => {
it('clears filters', () => {
interceptSamples();
@@ -443,7 +443,7 @@ describe('Drill to detail modal', () => {
cy.get("[data-test-viz-type='box_plot'] canvas").then($canvas => {
const canvasWidth = $canvas.width() || 0;
const canvasHeight = $canvas.height() || 0;
- const canvasCenterX = canvasWidth / 3;
+ const canvasCenterX = canvasWidth / 3 + 15;
const canvasCenterY = (canvasHeight * 5) / 6;
cy.wrap($canvas).scrollIntoView();
diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/sections/chartTitle.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/sections/chartTitle.tsx
index 6c8d08364c..43ad46ba7f 100644
--- a/superset-frontend/packages/superset-ui-chart-controls/src/sections/chartTitle.tsx
+++ b/superset-frontend/packages/superset-ui-chart-controls/src/sections/chartTitle.tsx
@@ -84,7 +84,7 @@ export const titleControls: ControlPanelSectionConfig = {
clearable: true,
label: t('Y Axis Title Margin'),
renderTrigger: true,
- default: TITLE_MARGIN_OPTIONS[0],
+ default: TITLE_MARGIN_OPTIONS[1],
choices: formatSelectOptions(TITLE_MARGIN_OPTIONS),
description: t('Changing this control takes effect instantly'),
},
diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx
index ee2d9a6c5c..55cd48736a 100644
--- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx
+++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx
@@ -122,7 +122,7 @@ function createAxisTitleControl(axis: 'x' | 'y'): ControlSetRow[] {
clearable: true,
label: t('AXIS TITLE MARGIN'),
renderTrigger: true,
- default: sections.TITLE_MARGIN_OPTIONS[0],
+ default: sections.TITLE_MARGIN_OPTIONS[1],
choices: formatSelectOptions(sections.TITLE_MARGIN_OPTIONS),
description: t('Changing this control takes effect instantly'),
visibility: ({ controls }: ControlPanelsContainerProps) =>
(superset) 10/15: fix(sec): resolve CVE-2025-29907 and CVE-2025-25977 by pinning `jspdf` to v3 (#32802)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit ca7c65456a8cdb0b0acd58eaef69dd76aca10f4f
Author: Đỗ Trọng Hải <41...@users.noreply.github.com>
AuthorDate: Sat Mar 22 23:50:13 2025 +0700
fix(sec): resolve CVE-2025-29907 and CVE-2025-25977 by pinning `jspdf` to v3 (#32802)
Signed-off-by: hainenber <do...@gmail.com>
---
superset-frontend/package-lock.json | 36 ++++++++++++++++++++----------------
superset-frontend/package.json | 1 +
2 files changed, 21 insertions(+), 16 deletions(-)
diff --git a/superset-frontend/package-lock.json b/superset-frontend/package-lock.json
index 19ad64ba8e..7d7c948063 100644
--- a/superset-frontend/package-lock.json
+++ b/superset-frontend/package-lock.json
@@ -3229,9 +3229,9 @@
}
},
"node_modules/@babel/runtime": {
- "version": "7.26.0",
- "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.26.0.tgz",
- "integrity": "sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw==",
+ "version": "7.27.0",
+ "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.0.tgz",
+ "integrity": "sha512-VtPOkrdPHZsKc/clNqyi9WUA8TINkZ4cGk63UUE3u4pmB2k+ZMQRDuIOagv8UVd6j7k0T3+RRIb7beKTebNbcw==",
"license": "MIT",
"dependencies": {
"regenerator-runtime": "^0.14.0"
@@ -17561,9 +17561,9 @@
"license": "CC-BY-4.0"
},
"node_modules/canvg": {
- "version": "3.0.10",
- "resolved": "https://registry.npmjs.org/canvg/-/canvg-3.0.10.tgz",
- "integrity": "sha512-qwR2FRNO9NlzTeKIPIKpnTY6fqwuYSequ8Ru8c0YkYU7U0oW+hLUvWadLvAu1Rl72OMNiFhoLu4f8eUjQ7l/+Q==",
+ "version": "3.0.11",
+ "resolved": "https://registry.npmjs.org/canvg/-/canvg-3.0.11.tgz",
+ "integrity": "sha512-5ON+q7jCTgMp9cjpu4Jo6XbvfYwSB2Ow3kzHKfIyJfaCAOHLbdKPQqGKgfED/R5B+3TFFfe8pegYA+b423SRyA==",
"license": "MIT",
"optional": true,
"dependencies": {
@@ -20981,11 +20981,14 @@
}
},
"node_modules/dompurify": {
- "version": "2.5.8",
- "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.5.8.tgz",
- "integrity": "sha512-o1vSNgrmYMQObbSSvF/1brBYEQPHhV1+gsmrusO7/GXtp1T9rCS8cXFqVxK/9crT1jA6Ccv+5MTSjBNqr7Sovw==",
+ "version": "3.2.4",
+ "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.2.4.tgz",
+ "integrity": "sha512-ysFSFEDVduQpyhzAob/kkuJjf5zWkZD8/A9ywSp1byueyuCfHamrCBa14/Oc2iiB0e51B+NpxSl5gmzn+Ms/mg==",
"license": "(MPL-2.0 OR Apache-2.0)",
- "optional": true
+ "optional": true,
+ "optionalDependencies": {
+ "@types/trusted-types": "^2.0.7"
+ }
},
"node_modules/domutils": {
"version": "3.2.2",
@@ -32660,20 +32663,20 @@
}
},
"node_modules/jspdf": {
- "version": "2.5.2",
- "resolved": "https://registry.npmjs.org/jspdf/-/jspdf-2.5.2.tgz",
- "integrity": "sha512-myeX9c+p7znDWPk0eTrujCzNjT+CXdXyk7YmJq5nD5V7uLLKmSXnlQ/Jn/kuo3X09Op70Apm0rQSnFWyGK8uEQ==",
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/jspdf/-/jspdf-3.0.1.tgz",
+ "integrity": "sha512-qaGIxqxetdoNnFQQXxTKUD9/Z7AloLaw94fFsOiJMxbfYdBbrBuhWmbzI8TVjrw7s3jBY1PFHofBKMV/wZPapg==",
"license": "MIT",
"dependencies": {
- "@babel/runtime": "^7.23.2",
+ "@babel/runtime": "^7.26.7",
"atob": "^2.1.2",
"btoa": "^1.2.1",
"fflate": "^0.8.1"
},
"optionalDependencies": {
- "canvg": "^3.0.6",
+ "canvg": "^3.0.11",
"core-js": "^3.6.0",
- "dompurify": "^2.5.4",
+ "dompurify": "^3.2.4",
"html2canvas": "^1.0.0-rc.5"
}
},
@@ -54316,6 +54319,7 @@
"version": "0.20.3",
"license": "Apache-2.0",
"dependencies": {
+ "@types/react-redux": "^7.1.10",
"d3-array": "^1.2.0",
"dayjs": "^1.11.13",
"lodash": "^4.17.21"
diff --git a/superset-frontend/package.json b/superset-frontend/package.json
index 987c137f2e..f9d2f9dd2f 100644
--- a/superset-frontend/package.json
+++ b/superset-frontend/package.json
@@ -381,6 +381,7 @@
},
"puppeteer": "^22.4.1",
"underscore": "^1.13.7",
+ "jspdf": "^3.0.1",
"fast-glob": {
"micromatch": "^4.0.6"
}
(superset) 09/15: fix(model/helper): represent RLS filter clause in proper textual SQL string (#32406)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 5f9fdfe019dc403cafe4db86e9cc6e534f69f9f4
Author: Đỗ Trọng Hải <41...@users.noreply.github.com>
AuthorDate: Sat Mar 22 03:36:03 2025 +0700
fix(model/helper): represent RLS filter clause in proper textual SQL string (#32406)
Signed-off-by: hainenber <do...@gmail.com>
(cherry picked from commit ff0529c9323966a0aa05f7879530953b8557bf00)
---
superset/models/helpers.py | 2 +-
tests/unit_tests/models/helpers_test.py | 16 +++++++++-------
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/superset/models/helpers.py b/superset/models/helpers.py
index 33c7c17d17..5dc97b602a 100644
--- a/superset/models/helpers.py
+++ b/superset/models/helpers.py
@@ -1380,7 +1380,7 @@ class ExploreMixin: # pylint: disable=too-many-public-methods
if engine.dialect.identifier_preparer._double_percents:
sql = sql.replace("%%", "%")
- df = pd.read_sql_query(sql=sql, con=engine)
+ df = pd.read_sql_query(sql=self.text(sql), con=engine)
# replace NaN with None to ensure it can be serialized to JSON
df = df.replace({np.nan: None})
return df["column_values"].to_list()
diff --git a/tests/unit_tests/models/helpers_test.py b/tests/unit_tests/models/helpers_test.py
index cc106dbe64..4e8aa493be 100644
--- a/tests/unit_tests/models/helpers_test.py
+++ b/tests/unit_tests/models/helpers_test.py
@@ -25,7 +25,7 @@ from unittest.mock import patch
import pytest
from pytest_mock import MockerFixture
-from sqlalchemy import create_engine
+from sqlalchemy import create_engine, text
from sqlalchemy.orm.session import Session
from sqlalchemy.pool import StaticPool
@@ -201,10 +201,12 @@ def test_values_for_column_double_percents(
)
# make sure final query has single percents
with database.get_sqla_engine() as engine:
- pd.read_sql_query.assert_called_with(
- sql=(
- "SELECT DISTINCT CASE WHEN b LIKE 'A%' THEN 'yes' ELSE 'nope' END "
- "AS column_values \nFROM t\n LIMIT 10000 OFFSET 0"
- ),
- con=engine,
+ expected_sql = text(
+ "SELECT DISTINCT CASE WHEN b LIKE 'A%' THEN 'yes' ELSE 'nope' END "
+ "AS column_values \nFROM t\n LIMIT 10000 OFFSET 0"
)
+ called_sql = pd.read_sql_query.call_args.kwargs["sql"]
+ called_conn = pd.read_sql_query.call_args.kwargs["con"]
+
+ assert called_sql.compare(expected_sql) is True
+ assert called_conn == engine
(superset) 04/15: fix(sqllab): Pass query_id as kwarg so backoff can see it (#32774)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit db2b4cc297f0314c80c729e76db7d73efd55aaf6
Author: Antonio Rivero <38...@users.noreply.github.com>
AuthorDate: Thu Mar 20 18:46:31 2025 +0100
fix(sqllab): Pass query_id as kwarg so backoff can see it (#32774)
(cherry picked from commit 01801e3c36571fd27c6238ccf8fc535461bfdb6f)
---
superset/sql_lab.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/superset/sql_lab.py b/superset/sql_lab.py
index 25ac9a5c5c..8ba985701d 100644
--- a/superset/sql_lab.py
+++ b/superset/sql_lab.py
@@ -193,7 +193,7 @@ def get_sql_results( # pylint: disable=too-many-arguments
except Exception as ex: # pylint: disable=broad-except
logger.debug("Query %d: %s", query_id, ex)
stats_logger.incr("error_sqllab_unhandled")
- query = get_query(query_id)
+ query = get_query(query_id=query_id)
return handle_query_error(ex, query)
@@ -423,7 +423,7 @@ def execute_sql_statements( # noqa: C901
# only asynchronous queries
stats_logger.timing("sqllab.query.time_pending", now_as_float() - start_time)
- query = get_query(query_id)
+ query = get_query(query_id=query_id)
payload: dict[str, Any] = {"query_id": query_id}
database = query.database
db_engine_spec = database.db_engine_spec
(superset) 06/15: fix(css): typos in styles (#28350)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 4f6b7d02f4038fbbef52e353ea547f8a6dd9ac1c
Author: Ruslan <10...@users.noreply.github.com>
AuthorDate: Fri Mar 21 01:32:02 2025 +0300
fix(css): typos in styles (#28350)
(cherry picked from commit 5ec710efc60fb339816c3ca4257b885cf5c4dfb2)
---
.../plugins/plugin-chart-echarts/src/Bubble/transformProps.ts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Bubble/transformProps.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Bubble/transformProps.ts
index 1888383a52..49e51f511b 100644
--- a/superset-frontend/plugins/plugin-chart-echarts/src/Bubble/transformProps.ts
+++ b/superset-frontend/plugins/plugin-chart-echarts/src/Bubble/transformProps.ts
@@ -201,7 +201,7 @@ export default function transformProps(chartProps: EchartsBubbleChartProps) {
name: bubbleXAxisTitle,
nameLocation: 'middle',
nameTextStyle: {
- fontWight: 'bolder',
+ fontWeight: 'bolder',
},
nameGap: convertInteger(xAxisTitleMargin),
type: xAxisType,
@@ -219,7 +219,7 @@ export default function transformProps(chartProps: EchartsBubbleChartProps) {
name: bubbleYAxisTitle,
nameLocation: 'middle',
nameTextStyle: {
- fontWight: 'bolder',
+ fontWeight: 'bolder',
},
nameGap: convertInteger(yAxisTitleMargin),
min: yAxisMin,
(superset) 05/15: fix(import): Missing catalog field in saved query schema (#32775)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 1306b36823bf3fa2440e57fe92d5f1967e19bac7
Author: Vladislav Korenkov <73...@users.noreply.github.com>
AuthorDate: Fri Mar 21 06:33:51 2025 +1000
fix(import): Missing catalog field in saved query schema (#32775)
Co-authored-by: Vladislav Koren'kov <ko...@dns-shop.ru>
(cherry picked from commit 5866f3ec8390025d1a2e9dc9b64d945d13ac4a78)
---
superset/queries/saved_queries/schemas.py | 1 +
tests/integration_tests/fixtures/importexport.py | 1 +
2 files changed, 2 insertions(+)
diff --git a/superset/queries/saved_queries/schemas.py b/superset/queries/saved_queries/schemas.py
index 7c314e6391..152ddcd087 100644
--- a/superset/queries/saved_queries/schemas.py
+++ b/superset/queries/saved_queries/schemas.py
@@ -39,6 +39,7 @@ get_export_ids_schema = {"type": "array", "items": {"type": "integer"}}
class ImportV1SavedQuerySchema(Schema):
+ catalog = fields.String(allow_none=True, validate=Length(0, 128))
schema = fields.String(allow_none=True, validate=Length(0, 128))
label = fields.String(allow_none=True, validate=Length(0, 256))
description = fields.String(allow_none=True)
diff --git a/tests/integration_tests/fixtures/importexport.py b/tests/integration_tests/fixtures/importexport.py
index 427d0d24a6..33aff24541 100644
--- a/tests/integration_tests/fixtures/importexport.py
+++ b/tests/integration_tests/fixtures/importexport.py
@@ -689,4 +689,5 @@ saved_queries_config = {
"uuid": "05b679b5-8eaf-452c-b874-a7a774cfa4e9",
"version": "1.0.0",
"database_uuid": "b8a1ccd3-779d-4ab7-8ad8-9ab119d7fe89",
+ "catalog": "default",
}
(superset) 07/15: fix(config): correct slack image url in talisman (#32778)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit e49ebce03cb0e15443f9e1e359efb601f250ddde
Author: V9 Developer <99...@users.noreply.github.com>
AuthorDate: Fri Mar 21 22:02:51 2025 +0530
fix(config): correct slack image url in talisman (#32778)
(cherry picked from commit 9bb3a5782da7035a9d316f6e4f146f4b8309b611)
---
docs/docs/security/security.mdx | 43 +++++++++++++++++++++++++++++++++++++++++
superset/config.py | 7 +++++--
2 files changed, 48 insertions(+), 2 deletions(-)
diff --git a/docs/docs/security/security.mdx b/docs/docs/security/security.mdx
index b2e805c2b5..839b5afa94 100644
--- a/docs/docs/security/security.mdx
+++ b/docs/docs/security/security.mdx
@@ -281,6 +281,49 @@ TALISMAN_CONFIG = {
"content_security_policy": { ...
```
+#### Configuring Talisman in Superset
+
+Talisman settings in Superset can be modified using superset_config.py. If you need to adjust security policies, you can override the default configuration.
+
+Example: Overriding Talisman Configuration in superset_config.py for loading images form s3 or other external sources.
+
+```python
+TALISMAN_CONFIG = {
+ "content_security_policy": {
+ "base-uri": ["'self'"],
+ "default-src": ["'self'"],
+ "img-src": [
+ "'self'",
+ "blob:",
+ "data:",
+ "https://apachesuperset.gateway.scarf.sh",
+ "https://static.scarf.sh/",
+ # "https://cdn.brandfolder.io", # Uncomment when SLACK_ENABLE_AVATARS is True # noqa: E501
+ "ows.terrestris.de",
+ "aws.s3.com", # Add Your Bucket or external data source
+ ],
+ "worker-src": ["'self'", "blob:"],
+ "connect-src": [
+ "'self'",
+ "https://api.mapbox.com",
+ "https://events.mapbox.com",
+ ],
+ "object-src": "'none'",
+ "style-src": [
+ "'self'",
+ "'unsafe-inline'",
+ ],
+ "script-src": ["'self'", "'strict-dynamic'"],
+ },
+ "content_security_policy_nonce_in": ["script-src"],
+ "force_https": False,
+ "session_cookie_secure": False,
+}
+```
+
+# For more information on setting up Talisman, please refer to
+https://superset.apache.org/docs/configuration/networking-settings/#changing-flask-talisman-csp
+
### Reporting Security Vulnerabilities
Apache Software Foundation takes a rigorous standpoint in annihilating the security issues in its
diff --git a/superset/config.py b/superset/config.py
index 3452c045b4..cf29e66127 100644
--- a/superset/config.py
+++ b/superset/config.py
@@ -1608,6 +1608,9 @@ CONTENT_SECURITY_POLICY_WARNING = True
TALISMAN_ENABLED = utils.cast_to_boolean(os.environ.get("TALISMAN_ENABLED", True))
# If you want Talisman, how do you want it configured??
+# For more information on setting up Talisman, please refer to
+# https://superset.apache.org/docs/configuration/networking-settings/#changing-flask-talisman-csp
+
TALISMAN_CONFIG = {
"content_security_policy": {
"base-uri": ["'self'"],
@@ -1618,7 +1621,7 @@ TALISMAN_CONFIG = {
"data:",
"https://apachesuperset.gateway.scarf.sh",
"https://static.scarf.sh/",
- # "https://avatars.slack-edge.com", # Uncomment when SLACK_ENABLE_AVATARS is True # noqa: E501
+ # "https://cdn.brandfolder.io", # Uncomment when SLACK_ENABLE_AVATARS is True # noqa: E501
"ows.terrestris.de",
],
"worker-src": ["'self'", "blob:"],
@@ -1649,7 +1652,7 @@ TALISMAN_DEV_CONFIG = {
"data:",
"https://apachesuperset.gateway.scarf.sh",
"https://static.scarf.sh/",
- "https://avatars.slack-edge.com",
+ "https://cdn.brandfolder.io",
"ows.terrestris.de",
],
"worker-src": ["'self'", "blob:"],
(superset) 08/15: fix(excel export): big number truncation handling (#32739)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 171574b1caba3ca187bdfece1d5cbe7cdd0eb836
Author: CharlesNkdl <10...@users.noreply.github.com>
AuthorDate: Fri Mar 21 17:39:59 2025 +0100
fix(excel export): big number truncation handling (#32739)
(cherry picked from commit c0f83a7467d0782703ec534bc9e1b8b5e80a2978)
---
superset/utils/excel.py | 14 ++++++++++++++
tests/unit_tests/utils/excel_tests.py | 24 ++++++++++++++++++++++++
2 files changed, 38 insertions(+)
diff --git a/superset/utils/excel.py b/superset/utils/excel.py
index d34446832a..46e1a1f071 100644
--- a/superset/utils/excel.py
+++ b/superset/utils/excel.py
@@ -56,10 +56,24 @@ def df_to_excel(df: pd.DataFrame, **kwargs: Any) -> Any:
def apply_column_types(
df: pd.DataFrame, column_types: list[GenericDataType]
) -> pd.DataFrame:
+ """
+ Applies the column types to the dataframe to prepare for an excel export
+
+ :param df: The dataframe to apply the column types to
+ :param column_types: The types of the columns
+ :return: The dataframe with the column types applied
+ """
for column, column_type in zip(df.columns, column_types, strict=False):
if column_type == GenericDataType.NUMERIC:
try:
df[column] = pd.to_numeric(df[column])
+ # if the number is too large, convert it to a string
+ # Excel does not support numbers larger than 10^15
+ df[column] = df[column].apply(
+ lambda x: str(x)
+ if isinstance(x, (int, float)) and abs(x) > 10**15
+ else x
+ )
except ValueError:
df[column] = df[column].astype(str)
elif pd.api.types.is_datetime64tz_dtype(df[column]):
diff --git a/tests/unit_tests/utils/excel_tests.py b/tests/unit_tests/utils/excel_tests.py
index deb6d3d0b4..b07fe7a4f0 100644
--- a/tests/unit_tests/utils/excel_tests.py
+++ b/tests/unit_tests/utils/excel_tests.py
@@ -105,3 +105,27 @@ def test_column_data_types_with_failing_conversion():
assert not is_numeric_dtype(df["col1"])
assert not is_numeric_dtype(df["col2"])
assert not is_numeric_dtype(df["col3"])
+
+
+def test_column_data_types_with_large_numeric_values():
+ df = pd.DataFrame(
+ {
+ "big_number": [
+ 10**14,
+ 999999999999999,
+ 10**15 + 1,
+ 10**16,
+ 1100108628127863,
+ 2**54,
+ ],
+ }
+ )
+ apply_column_types(df, [GenericDataType.NUMERIC])
+ assert df["big_number"].tolist() == [
+ 100000000000000,
+ 999999999999999,
+ "1000000000000001",
+ "10000000000000000",
+ "1100108628127863",
+ "18014398509481984",
+ ]
(superset) 15/15: fix: Bump FAB to 4.6.1 (#32848)
Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
michaelsmolina pushed a commit to branch 5.0
in repository https://gitbox.apache.org/repos/asf/superset.git
commit f049049f712a9abbbb3722746ef0bb2686183300
Author: Michael S. Molina <70...@users.noreply.github.com>
AuthorDate: Tue Mar 25 15:29:19 2025 -0300
fix: Bump FAB to 4.6.1 (#32848)
---
pyproject.toml | 2 +-
requirements/base.txt | 2 +-
requirements/development.txt | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/pyproject.toml b/pyproject.toml
index de4776db06..58687662fa 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -44,7 +44,7 @@ dependencies = [
"cryptography>=42.0.4, <44.0.0",
"deprecation>=2.1.0, <2.2.0",
"flask>=2.2.5, <3.0.0",
- "flask-appbuilder>=4.5.4, <5.0.0",
+ "flask-appbuilder>=4.6.1, <5.0.0",
"flask-caching>=2.1.0, <3",
"flask-compress>=1.13, <2.0",
"flask-talisman>=1.0.0, <2.0",
diff --git a/requirements/base.txt b/requirements/base.txt
index 57b7cf64dc..f68fdce9cb 100644
--- a/requirements/base.txt
+++ b/requirements/base.txt
@@ -108,7 +108,7 @@ flask==2.3.3
# flask-session
# flask-sqlalchemy
# flask-wtf
-flask-appbuilder==4.5.4
+flask-appbuilder==4.6.1
# via apache-superset (pyproject.toml)
flask-babel==2.0.0
# via flask-appbuilder
diff --git a/requirements/development.txt b/requirements/development.txt
index 430aad26aa..3276973c0e 100644
--- a/requirements/development.txt
+++ b/requirements/development.txt
@@ -190,7 +190,7 @@ flask==2.3.3
# flask-sqlalchemy
# flask-testing
# flask-wtf
-flask-appbuilder==4.5.4
+flask-appbuilder==4.6.1
# via
# -c requirements/base.txt
# apache-superset