You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by hu...@apache.org on 2026/10/06 20:06:32 UTC
(superset) branch hughhhh/pfm-6-explore-indicator updated (c98c51af1a7 -> 5596d7eecbd)
This is an automated email from the ASF dual-hosted git repository.
hughhhh pushed a change to branch hughhhh/pfm-6-explore-indicator
in repository https://gitbox.apache.org/repos/asf/superset.git
from c98c51af1a7 fix(security): stop a transform cancelling the placeholder-position gate
new 2b69a1fe01b fix(datasets): preview a filter the way the chart path mirrors it
new d01cfc542f6 chore: regenerate the message catalogs
new 5596d7eecbd fix(explore): stop designating a partition column changing its flags
The 3 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/static/resources/openapi.json | 1 +
.../DatasourceEditor/DatasourceEditor.tsx | 18 ++--
.../PartitionMappingSection.tsx | 11 +-
.../components/PartitionFilterMapping/types.ts | 1 +
.../PartitionFilterMapping/utils.test.ts | 15 ---
.../components/PartitionFilterMapping/utils.ts | 19 ----
.../DatasourceEditorPartitionMapping.test.tsx | 39 ++++++-
superset/connectors/sqla/partition_mapping.py | 89 +++++++++++++---
superset/datasets/api.py | 1 +
superset/models/helpers.py | 86 ++++++++++------
superset/translations/ar/LC_MESSAGES/messages.po | 8 ++
superset/translations/ca/LC_MESSAGES/messages.po | 8 ++
superset/translations/cs/LC_MESSAGES/messages.po | 8 ++
superset/translations/de/LC_MESSAGES/messages.po | 8 ++
superset/translations/en/LC_MESSAGES/messages.po | 8 ++
superset/translations/es/LC_MESSAGES/messages.po | 8 ++
superset/translations/fa/LC_MESSAGES/messages.po | 8 ++
superset/translations/fi/LC_MESSAGES/messages.po | 8 ++
superset/translations/fr/LC_MESSAGES/messages.po | 8 ++
superset/translations/it/LC_MESSAGES/messages.po | 8 ++
superset/translations/ja/LC_MESSAGES/messages.po | 8 ++
superset/translations/ko/LC_MESSAGES/messages.po | 8 ++
superset/translations/lv/LC_MESSAGES/messages.po | 8 ++
superset/translations/messages.pot | 4 +
superset/translations/mi/LC_MESSAGES/messages.po | 8 ++
superset/translations/nl/LC_MESSAGES/messages.po | 8 ++
superset/translations/pl/LC_MESSAGES/messages.po | 8 ++
superset/translations/pt/LC_MESSAGES/messages.po | 8 ++
.../translations/pt_BR/LC_MESSAGES/messages.po | 8 ++
superset/translations/ro/LC_MESSAGES/messages.po | 8 ++
superset/translations/ru/LC_MESSAGES/messages.po | 8 ++
superset/translations/sk/LC_MESSAGES/messages.po | 8 ++
superset/translations/sl/LC_MESSAGES/messages.po | 8 ++
superset/translations/sr/LC_MESSAGES/messages.po | 8 ++
.../translations/sr_Latn/LC_MESSAGES/messages.po | 8 ++
superset/translations/ta/LC_MESSAGES/messages.po | 8 ++
superset/translations/th/LC_MESSAGES/messages.po | 8 ++
superset/translations/tr/LC_MESSAGES/messages.po | 8 ++
superset/translations/uk/LC_MESSAGES/messages.po | 8 ++
superset/translations/zh/LC_MESSAGES/messages.po | 8 ++
.../translations/zh_TW/LC_MESSAGES/messages.po | 8 ++
.../datasets/partition_mapping_preview_test.py | 112 ++++++++++++++++++++-
42 files changed, 533 insertions(+), 103 deletions(-)
(superset) 02/03: chore: regenerate the message catalogs
Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hughhhh pushed a commit to branch hughhhh/pfm-6-explore-indicator
in repository https://gitbox.apache.org/repos/asf/superset.git
commit d01cfc542f67e10ac7694e218d774dc96b410530
Author: Hugh A Miles II <hu...@gmail.com>
AuthorDate: Tue Oct 6 13:35:47 2026 -0400
chore: regenerate the message catalogs
The preview's new `resolution` reason carries one translatable string. Extracted
with `scripts/translations/babel_update.sh`'s own `pybabel extract` flags and
normalized through `msgcat` the same way, then verified by diffing the msgid
set against a fresh extraction -- which is what `check_pot_drift.py` asserts.
The entry is inserted at its sorted position rather than the template being
rewritten, so the diff carries no `POT-Creation-Date` churn.
The catalog diff is purely additive: one untranslated entry per language and
nothing else. `pybabel update` re-flags `% calculation`, `% of parent` and
`% of total` as python-format on every write, so the script's closing strip pass
was run too; without it those three would have shown up as spurious changes in
all 31 catalogs.
`msgfmt --check` fails on fr, it, pt and sl, which it also does on
origin/master -- verified, not introduced here.
Co-Authored-By: Claude Opus 5 (1M context) <no...@anthropic.com>
---
superset/translations/ar/LC_MESSAGES/messages.po | 8 ++++++++
superset/translations/ca/LC_MESSAGES/messages.po | 8 ++++++++
superset/translations/cs/LC_MESSAGES/messages.po | 8 ++++++++
superset/translations/de/LC_MESSAGES/messages.po | 8 ++++++++
superset/translations/en/LC_MESSAGES/messages.po | 8 ++++++++
superset/translations/es/LC_MESSAGES/messages.po | 8 ++++++++
superset/translations/fa/LC_MESSAGES/messages.po | 8 ++++++++
superset/translations/fi/LC_MESSAGES/messages.po | 8 ++++++++
superset/translations/fr/LC_MESSAGES/messages.po | 8 ++++++++
superset/translations/it/LC_MESSAGES/messages.po | 8 ++++++++
superset/translations/ja/LC_MESSAGES/messages.po | 8 ++++++++
superset/translations/ko/LC_MESSAGES/messages.po | 8 ++++++++
superset/translations/lv/LC_MESSAGES/messages.po | 8 ++++++++
superset/translations/messages.pot | 4 ++++
superset/translations/mi/LC_MESSAGES/messages.po | 8 ++++++++
superset/translations/nl/LC_MESSAGES/messages.po | 8 ++++++++
superset/translations/pl/LC_MESSAGES/messages.po | 8 ++++++++
superset/translations/pt/LC_MESSAGES/messages.po | 8 ++++++++
superset/translations/pt_BR/LC_MESSAGES/messages.po | 8 ++++++++
superset/translations/ro/LC_MESSAGES/messages.po | 8 ++++++++
superset/translations/ru/LC_MESSAGES/messages.po | 8 ++++++++
superset/translations/sk/LC_MESSAGES/messages.po | 8 ++++++++
superset/translations/sl/LC_MESSAGES/messages.po | 8 ++++++++
superset/translations/sr/LC_MESSAGES/messages.po | 8 ++++++++
superset/translations/sr_Latn/LC_MESSAGES/messages.po | 8 ++++++++
superset/translations/ta/LC_MESSAGES/messages.po | 8 ++++++++
superset/translations/th/LC_MESSAGES/messages.po | 8 ++++++++
superset/translations/tr/LC_MESSAGES/messages.po | 8 ++++++++
superset/translations/uk/LC_MESSAGES/messages.po | 8 ++++++++
superset/translations/zh/LC_MESSAGES/messages.po | 8 ++++++++
superset/translations/zh_TW/LC_MESSAGES/messages.po | 8 ++++++++
31 files changed, 244 insertions(+)
diff --git a/superset/translations/ar/LC_MESSAGES/messages.po b/superset/translations/ar/LC_MESSAGES/messages.po
index 4f7d5cc8a03..37ed3f4a633 100644
--- a/superset/translations/ar/LC_MESSAGES/messages.po
+++ b/superset/translations/ar/LC_MESSAGES/messages.po
@@ -18741,6 +18741,14 @@ msgid ""
"one."
msgstr "هذا البريد الإلكتروني مرتبط بالفعل بحساب. يرجى اختيار بريد إلكتروني آخر."
+#, python-format
+msgid ""
+"This engine compares less of a %(operator)s value on %(column)s than the "
+"filter carries, so there is no mirror a predicate on the partition column"
+" could stand in for. Map a column the engine compares in full to mirror "
+"this operator."
+msgstr ""
+
#, python-format
msgid "This export was requested on %(when)s UTC."
msgstr ""
diff --git a/superset/translations/ca/LC_MESSAGES/messages.po b/superset/translations/ca/LC_MESSAGES/messages.po
index 19ba49d1cfe..171186b1258 100644
--- a/superset/translations/ca/LC_MESSAGES/messages.po
+++ b/superset/translations/ca/LC_MESSAGES/messages.po
@@ -18191,6 +18191,14 @@ msgid ""
"one."
msgstr "Aquest correu electrònic ja està associat amb un compte."
+#, python-format
+msgid ""
+"This engine compares less of a %(operator)s value on %(column)s than the "
+"filter carries, so there is no mirror a predicate on the partition column"
+" could stand in for. Map a column the engine compares in full to mirror "
+"this operator."
+msgstr ""
+
#, python-format
msgid "This export was requested on %(when)s UTC."
msgstr ""
diff --git a/superset/translations/cs/LC_MESSAGES/messages.po b/superset/translations/cs/LC_MESSAGES/messages.po
index 4444b7071e6..9ef5774fb2a 100644
--- a/superset/translations/cs/LC_MESSAGES/messages.po
+++ b/superset/translations/cs/LC_MESSAGES/messages.po
@@ -17586,6 +17586,14 @@ msgid ""
"one."
msgstr "Tento e-mail je již spojen s účtem."
+#, python-format
+msgid ""
+"This engine compares less of a %(operator)s value on %(column)s than the "
+"filter carries, so there is no mirror a predicate on the partition column"
+" could stand in for. Map a column the engine compares in full to mirror "
+"this operator."
+msgstr ""
+
#, python-format
msgid "This export was requested on %(when)s UTC."
msgstr ""
diff --git a/superset/translations/de/LC_MESSAGES/messages.po b/superset/translations/de/LC_MESSAGES/messages.po
index c34e1fec627..5c460903108 100644
--- a/superset/translations/de/LC_MESSAGES/messages.po
+++ b/superset/translations/de/LC_MESSAGES/messages.po
@@ -17231,6 +17231,14 @@ msgstr ""
"Diese E-Mail-Adresse ist bereits mit einem Konto verknüpft. Bitte wählen "
"Sie eine andere."
+#, python-format
+msgid ""
+"This engine compares less of a %(operator)s value on %(column)s than the "
+"filter carries, so there is no mirror a predicate on the partition column"
+" could stand in for. Map a column the engine compares in full to mirror "
+"this operator."
+msgstr ""
+
#, python-format
msgid "This export was requested on %(when)s UTC."
msgstr ""
diff --git a/superset/translations/en/LC_MESSAGES/messages.po b/superset/translations/en/LC_MESSAGES/messages.po
index f0b0c3406dc..620177da8cb 100644
--- a/superset/translations/en/LC_MESSAGES/messages.po
+++ b/superset/translations/en/LC_MESSAGES/messages.po
@@ -15860,6 +15860,14 @@ msgid ""
"one."
msgstr ""
+#, python-format
+msgid ""
+"This engine compares less of a %(operator)s value on %(column)s than the "
+"filter carries, so there is no mirror a predicate on the partition column"
+" could stand in for. Map a column the engine compares in full to mirror "
+"this operator."
+msgstr ""
+
#, python-format
msgid "This export was requested on %(when)s UTC."
msgstr ""
diff --git a/superset/translations/es/LC_MESSAGES/messages.po b/superset/translations/es/LC_MESSAGES/messages.po
index a206a7c8509..560d2dc7276 100644
--- a/superset/translations/es/LC_MESSAGES/messages.po
+++ b/superset/translations/es/LC_MESSAGES/messages.po
@@ -18096,6 +18096,14 @@ msgid ""
"one."
msgstr "Este correo electrónico ya está asociado con una cuenta."
+#, python-format
+msgid ""
+"This engine compares less of a %(operator)s value on %(column)s than the "
+"filter carries, so there is no mirror a predicate on the partition column"
+" could stand in for. Map a column the engine compares in full to mirror "
+"this operator."
+msgstr ""
+
#, python-format
msgid "This export was requested on %(when)s UTC."
msgstr ""
diff --git a/superset/translations/fa/LC_MESSAGES/messages.po b/superset/translations/fa/LC_MESSAGES/messages.po
index 0a9e4bf3b3a..804a9a95759 100644
--- a/superset/translations/fa/LC_MESSAGES/messages.po
+++ b/superset/translations/fa/LC_MESSAGES/messages.po
@@ -18300,6 +18300,14 @@ msgstr ""
"این ایمیل قبلاً با یک حساب کاربری مرتبط شده است. لطفاً آدرس دیگری انتخاب "
"کنید."
+#, python-format
+msgid ""
+"This engine compares less of a %(operator)s value on %(column)s than the "
+"filter carries, so there is no mirror a predicate on the partition column"
+" could stand in for. Map a column the engine compares in full to mirror "
+"this operator."
+msgstr ""
+
#, python-format
msgid "This export was requested on %(when)s UTC."
msgstr ""
diff --git a/superset/translations/fi/LC_MESSAGES/messages.po b/superset/translations/fi/LC_MESSAGES/messages.po
index 362dbdb7f2a..8f5689e6901 100644
--- a/superset/translations/fi/LC_MESSAGES/messages.po
+++ b/superset/translations/fi/LC_MESSAGES/messages.po
@@ -28432,6 +28432,14 @@ msgid ""
"one."
msgstr "Tämä sähköpostiosoite on jo liitetty tiliin. Valitse toinen."
+#, python-format
+msgid ""
+"This engine compares less of a %(operator)s value on %(column)s than the "
+"filter carries, so there is no mirror a predicate on the partition column"
+" could stand in for. Map a column the engine compares in full to mirror "
+"this operator."
+msgstr ""
+
#, python-format
msgid "This export was requested on %(when)s UTC."
msgstr ""
diff --git a/superset/translations/fr/LC_MESSAGES/messages.po b/superset/translations/fr/LC_MESSAGES/messages.po
index 9fa2d1b6f16..ec6aec8586a 100644
--- a/superset/translations/fr/LC_MESSAGES/messages.po
+++ b/superset/translations/fr/LC_MESSAGES/messages.po
@@ -17545,6 +17545,14 @@ msgid ""
"one."
msgstr "Cet e-mail est déjà associé à un compte. Veuillez en choisir un autre."
+#, python-format
+msgid ""
+"This engine compares less of a %(operator)s value on %(column)s than the "
+"filter carries, so there is no mirror a predicate on the partition column"
+" could stand in for. Map a column the engine compares in full to mirror "
+"this operator."
+msgstr ""
+
#, python-format
msgid "This export was requested on %(when)s UTC."
msgstr ""
diff --git a/superset/translations/it/LC_MESSAGES/messages.po b/superset/translations/it/LC_MESSAGES/messages.po
index 2bcaa5f4d68..b73d5e97f92 100644
--- a/superset/translations/it/LC_MESSAGES/messages.po
+++ b/superset/translations/it/LC_MESSAGES/messages.po
@@ -21604,6 +21604,14 @@ msgid ""
"one."
msgstr "Questo indirizzo email è già associato a un account. Sceglierne un altro."
+#, python-format
+msgid ""
+"This engine compares less of a %(operator)s value on %(column)s than the "
+"filter carries, so there is no mirror a predicate on the partition column"
+" could stand in for. Map a column the engine compares in full to mirror "
+"this operator."
+msgstr ""
+
#, python-format
msgid "This export was requested on %(when)s UTC."
msgstr "Questa esportazione è stata richiesta il %(when)s UTC."
diff --git a/superset/translations/ja/LC_MESSAGES/messages.po b/superset/translations/ja/LC_MESSAGES/messages.po
index f4402040419..423a89f2246 100644
--- a/superset/translations/ja/LC_MESSAGES/messages.po
+++ b/superset/translations/ja/LC_MESSAGES/messages.po
@@ -15939,6 +15939,14 @@ msgid ""
"one."
msgstr "このメールアドレスは既にアカウントに登録されています。別のものを選択してください。"
+#, python-format
+msgid ""
+"This engine compares less of a %(operator)s value on %(column)s than the "
+"filter carries, so there is no mirror a predicate on the partition column"
+" could stand in for. Map a column the engine compares in full to mirror "
+"this operator."
+msgstr ""
+
#, python-format
msgid "This export was requested on %(when)s UTC."
msgstr ""
diff --git a/superset/translations/ko/LC_MESSAGES/messages.po b/superset/translations/ko/LC_MESSAGES/messages.po
index 4958e687d95..dc8659c41ba 100644
--- a/superset/translations/ko/LC_MESSAGES/messages.po
+++ b/superset/translations/ko/LC_MESSAGES/messages.po
@@ -25721,6 +25721,14 @@ msgid ""
"one."
msgstr "이 이메일은 이미 계정과 연결되어 있습니다. 다른 이메일을 선택하세요."
+#, python-format
+msgid ""
+"This engine compares less of a %(operator)s value on %(column)s than the "
+"filter carries, so there is no mirror a predicate on the partition column"
+" could stand in for. Map a column the engine compares in full to mirror "
+"this operator."
+msgstr ""
+
#, python-format
msgid "This export was requested on %(when)s UTC."
msgstr ""
diff --git a/superset/translations/lv/LC_MESSAGES/messages.po b/superset/translations/lv/LC_MESSAGES/messages.po
index d6a9e2dc7f4..e5bae04e9fc 100644
--- a/superset/translations/lv/LC_MESSAGES/messages.po
+++ b/superset/translations/lv/LC_MESSAGES/messages.po
@@ -17259,6 +17259,14 @@ msgid ""
"one."
msgstr "Šis e-pasts jau ir saistīts ar kontu. Lūdzu, izvēlieties citu."
+#, python-format
+msgid ""
+"This engine compares less of a %(operator)s value on %(column)s than the "
+"filter carries, so there is no mirror a predicate on the partition column"
+" could stand in for. Map a column the engine compares in full to mirror "
+"this operator."
+msgstr ""
+
#, python-format
msgid "This export was requested on %(when)s UTC."
msgstr ""
diff --git a/superset/translations/messages.pot b/superset/translations/messages.pot
index 725e9c6811c..2dfbb2002d3 100644
--- a/superset/translations/messages.pot
+++ b/superset/translations/messages.pot
@@ -14713,6 +14713,10 @@ msgstr ""
msgid "This email is already associated with an account. Please choose another one."
msgstr ""
+#, python-format
+msgid "This engine compares less of a %(operator)s value on %(column)s than the filter carries, so there is no mirror a predicate on the partition column could stand in for. Map a column the engine compares in full to mirror this operator."
+msgstr ""
+
#, python-format
msgid "This export was requested on %(when)s UTC."
msgstr ""
diff --git a/superset/translations/mi/LC_MESSAGES/messages.po b/superset/translations/mi/LC_MESSAGES/messages.po
index b7ce2eb0e63..6c585c7510f 100644
--- a/superset/translations/mi/LC_MESSAGES/messages.po
+++ b/superset/translations/mi/LC_MESSAGES/messages.po
@@ -18098,6 +18098,14 @@ msgid ""
"one."
msgstr "Kei te hono kē tēnei īmēra ki tētahi kaute."
+#, python-format
+msgid ""
+"This engine compares less of a %(operator)s value on %(column)s than the "
+"filter carries, so there is no mirror a predicate on the partition column"
+" could stand in for. Map a column the engine compares in full to mirror "
+"this operator."
+msgstr ""
+
#, python-format
msgid "This export was requested on %(when)s UTC."
msgstr ""
diff --git a/superset/translations/nl/LC_MESSAGES/messages.po b/superset/translations/nl/LC_MESSAGES/messages.po
index 722c22cf28d..77e7e7be490 100644
--- a/superset/translations/nl/LC_MESSAGES/messages.po
+++ b/superset/translations/nl/LC_MESSAGES/messages.po
@@ -18727,6 +18727,14 @@ msgstr ""
"Dit e-mailadres is al gekoppeld aan een account. Kies een ander "
"e-mailadres."
+#, python-format
+msgid ""
+"This engine compares less of a %(operator)s value on %(column)s than the "
+"filter carries, so there is no mirror a predicate on the partition column"
+" could stand in for. Map a column the engine compares in full to mirror "
+"this operator."
+msgstr ""
+
#, python-format
msgid "This export was requested on %(when)s UTC."
msgstr ""
diff --git a/superset/translations/pl/LC_MESSAGES/messages.po b/superset/translations/pl/LC_MESSAGES/messages.po
index e1adbd342f8..b8257fd50d4 100644
--- a/superset/translations/pl/LC_MESSAGES/messages.po
+++ b/superset/translations/pl/LC_MESSAGES/messages.po
@@ -19045,6 +19045,14 @@ msgid ""
"one."
msgstr "Ten adres e-mail jest już powiązany z kontem. Wybierz inny."
+#, python-format
+msgid ""
+"This engine compares less of a %(operator)s value on %(column)s than the "
+"filter carries, so there is no mirror a predicate on the partition column"
+" could stand in for. Map a column the engine compares in full to mirror "
+"this operator."
+msgstr ""
+
#, python-format
msgid "This export was requested on %(when)s UTC."
msgstr ""
diff --git a/superset/translations/pt/LC_MESSAGES/messages.po b/superset/translations/pt/LC_MESSAGES/messages.po
index cd9212e4dcb..91907473bc4 100644
--- a/superset/translations/pt/LC_MESSAGES/messages.po
+++ b/superset/translations/pt/LC_MESSAGES/messages.po
@@ -22380,6 +22380,14 @@ msgid ""
"one."
msgstr "Este email já está associado a uma conta. Por favor escolha outro."
+#, python-format
+msgid ""
+"This engine compares less of a %(operator)s value on %(column)s than the "
+"filter carries, so there is no mirror a predicate on the partition column"
+" could stand in for. Map a column the engine compares in full to mirror "
+"this operator."
+msgstr ""
+
#, python-format
msgid "This export was requested on %(when)s UTC."
msgstr ""
diff --git a/superset/translations/pt_BR/LC_MESSAGES/messages.po b/superset/translations/pt_BR/LC_MESSAGES/messages.po
index 9a2ff76b83e..649422f76ee 100644
--- a/superset/translations/pt_BR/LC_MESSAGES/messages.po
+++ b/superset/translations/pt_BR/LC_MESSAGES/messages.po
@@ -18798,6 +18798,14 @@ msgid ""
"one."
msgstr "Este e-mail já está associado a uma conta. Por favor, escolha outro."
+#, python-format
+msgid ""
+"This engine compares less of a %(operator)s value on %(column)s than the "
+"filter carries, so there is no mirror a predicate on the partition column"
+" could stand in for. Map a column the engine compares in full to mirror "
+"this operator."
+msgstr ""
+
#, python-format
msgid "This export was requested on %(when)s UTC."
msgstr ""
diff --git a/superset/translations/ro/LC_MESSAGES/messages.po b/superset/translations/ro/LC_MESSAGES/messages.po
index 8ab7d2277d0..ca6a7ebfdf4 100644
--- a/superset/translations/ro/LC_MESSAGES/messages.po
+++ b/superset/translations/ro/LC_MESSAGES/messages.po
@@ -18397,6 +18397,14 @@ msgid ""
"one."
msgstr "Acest email este deja asociat cu un cont. Vă rugăm să alegeți altul."
+#, python-format
+msgid ""
+"This engine compares less of a %(operator)s value on %(column)s than the "
+"filter carries, so there is no mirror a predicate on the partition column"
+" could stand in for. Map a column the engine compares in full to mirror "
+"this operator."
+msgstr ""
+
#, python-format
msgid "This export was requested on %(when)s UTC."
msgstr ""
diff --git a/superset/translations/ru/LC_MESSAGES/messages.po b/superset/translations/ru/LC_MESSAGES/messages.po
index 04304cf0e2e..f2888386098 100644
--- a/superset/translations/ru/LC_MESSAGES/messages.po
+++ b/superset/translations/ru/LC_MESSAGES/messages.po
@@ -16956,6 +16956,14 @@ msgid ""
"one."
msgstr "Этот email уже привязан к учетной записи. Пожалуйста, укажите другой."
+#, python-format
+msgid ""
+"This engine compares less of a %(operator)s value on %(column)s than the "
+"filter carries, so there is no mirror a predicate on the partition column"
+" could stand in for. Map a column the engine compares in full to mirror "
+"this operator."
+msgstr ""
+
#, python-format
msgid "This export was requested on %(when)s UTC."
msgstr ""
diff --git a/superset/translations/sk/LC_MESSAGES/messages.po b/superset/translations/sk/LC_MESSAGES/messages.po
index be7ee40237e..82d93fc2351 100644
--- a/superset/translations/sk/LC_MESSAGES/messages.po
+++ b/superset/translations/sk/LC_MESSAGES/messages.po
@@ -17592,6 +17592,14 @@ msgid ""
"one."
msgstr "Tento e-mail je již spojen s účtem."
+#, python-format
+msgid ""
+"This engine compares less of a %(operator)s value on %(column)s than the "
+"filter carries, so there is no mirror a predicate on the partition column"
+" could stand in for. Map a column the engine compares in full to mirror "
+"this operator."
+msgstr ""
+
#, python-format
msgid "This export was requested on %(when)s UTC."
msgstr ""
diff --git a/superset/translations/sl/LC_MESSAGES/messages.po b/superset/translations/sl/LC_MESSAGES/messages.po
index 8813e1957b9..5d65333747b 100644
--- a/superset/translations/sl/LC_MESSAGES/messages.po
+++ b/superset/translations/sl/LC_MESSAGES/messages.po
@@ -17440,6 +17440,14 @@ msgid ""
"one."
msgstr "Ta e-poštni naslov je že povezan z računom. Prosim izberite drugega."
+#, python-format
+msgid ""
+"This engine compares less of a %(operator)s value on %(column)s than the "
+"filter carries, so there is no mirror a predicate on the partition column"
+" could stand in for. Map a column the engine compares in full to mirror "
+"this operator."
+msgstr ""
+
#, python-format
msgid "This export was requested on %(when)s UTC."
msgstr ""
diff --git a/superset/translations/sr/LC_MESSAGES/messages.po b/superset/translations/sr/LC_MESSAGES/messages.po
index 1d2ab476789..4dcf59356e5 100644
--- a/superset/translations/sr/LC_MESSAGES/messages.po
+++ b/superset/translations/sr/LC_MESSAGES/messages.po
@@ -20798,6 +20798,14 @@ msgid ""
"one."
msgstr "Овај имејл је већ повезан са налогом. Изаберите други."
+#, python-format
+msgid ""
+"This engine compares less of a %(operator)s value on %(column)s than the "
+"filter carries, so there is no mirror a predicate on the partition column"
+" could stand in for. Map a column the engine compares in full to mirror "
+"this operator."
+msgstr ""
+
#, python-format
msgid "This export was requested on %(when)s UTC."
msgstr ""
diff --git a/superset/translations/sr_Latn/LC_MESSAGES/messages.po b/superset/translations/sr_Latn/LC_MESSAGES/messages.po
index e843cc80254..22f65c40cd8 100644
--- a/superset/translations/sr_Latn/LC_MESSAGES/messages.po
+++ b/superset/translations/sr_Latn/LC_MESSAGES/messages.po
@@ -20813,6 +20813,14 @@ msgid ""
"one."
msgstr "Ovaj imejl je već povezan sa nalogom. Izaberite drugi."
+#, python-format
+msgid ""
+"This engine compares less of a %(operator)s value on %(column)s than the "
+"filter carries, so there is no mirror a predicate on the partition column"
+" could stand in for. Map a column the engine compares in full to mirror "
+"this operator."
+msgstr ""
+
#, python-format
msgid "This export was requested on %(when)s UTC."
msgstr ""
diff --git a/superset/translations/ta/LC_MESSAGES/messages.po b/superset/translations/ta/LC_MESSAGES/messages.po
index 6ea6d1dbae8..b9300d802cc 100644
--- a/superset/translations/ta/LC_MESSAGES/messages.po
+++ b/superset/translations/ta/LC_MESSAGES/messages.po
@@ -16795,6 +16795,14 @@ msgstr ""
"இந்த மின்னஞ்சல் ஏற்கனவே ஒரு கணக்குடன் இணைக்கப்பட்டுள்ளது. வேறு ஒன்றை "
"தேர்ந்தெடுக்கவும்."
+#, python-format
+msgid ""
+"This engine compares less of a %(operator)s value on %(column)s than the "
+"filter carries, so there is no mirror a predicate on the partition column"
+" could stand in for. Map a column the engine compares in full to mirror "
+"this operator."
+msgstr ""
+
#, python-format
msgid "This export was requested on %(when)s UTC."
msgstr ""
diff --git a/superset/translations/th/LC_MESSAGES/messages.po b/superset/translations/th/LC_MESSAGES/messages.po
index 38ee5def2d9..a59d9fdb282 100644
--- a/superset/translations/th/LC_MESSAGES/messages.po
+++ b/superset/translations/th/LC_MESSAGES/messages.po
@@ -28100,6 +28100,14 @@ msgid ""
"one."
msgstr "อีเมลนี้ถูกเชื่อมโยงกับบัญชีอยู่แล้ว กรุณาเลือกอีเมลอื่น"
+#, python-format
+msgid ""
+"This engine compares less of a %(operator)s value on %(column)s than the "
+"filter carries, so there is no mirror a predicate on the partition column"
+" could stand in for. Map a column the engine compares in full to mirror "
+"this operator."
+msgstr ""
+
#, python-format
msgid "This export was requested on %(when)s UTC."
msgstr ""
diff --git a/superset/translations/tr/LC_MESSAGES/messages.po b/superset/translations/tr/LC_MESSAGES/messages.po
index 216a451f066..a3eb507fe38 100644
--- a/superset/translations/tr/LC_MESSAGES/messages.po
+++ b/superset/translations/tr/LC_MESSAGES/messages.po
@@ -18034,6 +18034,14 @@ msgid ""
"one."
msgstr "Bu e-posta zaten bir hesapla ilişkilendirilir. Lütfen başka birini seçin."
+#, python-format
+msgid ""
+"This engine compares less of a %(operator)s value on %(column)s than the "
+"filter carries, so there is no mirror a predicate on the partition column"
+" could stand in for. Map a column the engine compares in full to mirror "
+"this operator."
+msgstr ""
+
#, python-format
msgid "This export was requested on %(when)s UTC."
msgstr ""
diff --git a/superset/translations/uk/LC_MESSAGES/messages.po b/superset/translations/uk/LC_MESSAGES/messages.po
index f5722acacb3..da986f96c4e 100644
--- a/superset/translations/uk/LC_MESSAGES/messages.po
+++ b/superset/translations/uk/LC_MESSAGES/messages.po
@@ -17262,6 +17262,14 @@ msgstr ""
"Ця електронна адреса вже пов'язана з наявним обліковим записом. Виберіть "
"іншу."
+#, python-format
+msgid ""
+"This engine compares less of a %(operator)s value on %(column)s than the "
+"filter carries, so there is no mirror a predicate on the partition column"
+" could stand in for. Map a column the engine compares in full to mirror "
+"this operator."
+msgstr ""
+
#, python-format
msgid "This export was requested on %(when)s UTC."
msgstr ""
diff --git a/superset/translations/zh/LC_MESSAGES/messages.po b/superset/translations/zh/LC_MESSAGES/messages.po
index c64d3d7e3ff..f126b575ea6 100644
--- a/superset/translations/zh/LC_MESSAGES/messages.po
+++ b/superset/translations/zh/LC_MESSAGES/messages.po
@@ -17701,6 +17701,14 @@ msgid ""
"one."
msgstr "此邮箱已关联到一个账户。请选择其他邮箱。"
+#, python-format
+msgid ""
+"This engine compares less of a %(operator)s value on %(column)s than the "
+"filter carries, so there is no mirror a predicate on the partition column"
+" could stand in for. Map a column the engine compares in full to mirror "
+"this operator."
+msgstr ""
+
#, python-format
msgid "This export was requested on %(when)s UTC."
msgstr "此导出请求于 %(when)s UTC 发起。"
diff --git a/superset/translations/zh_TW/LC_MESSAGES/messages.po b/superset/translations/zh_TW/LC_MESSAGES/messages.po
index 559088ea1db..2cfc8b76140 100644
--- a/superset/translations/zh_TW/LC_MESSAGES/messages.po
+++ b/superset/translations/zh_TW/LC_MESSAGES/messages.po
@@ -18874,6 +18874,14 @@ msgid ""
"one."
msgstr "此電子郵件已與一個帳戶關聯。請選擇其他電子郵件。"
+#, python-format
+msgid ""
+"This engine compares less of a %(operator)s value on %(column)s than the "
+"filter carries, so there is no mirror a predicate on the partition column"
+" could stand in for. Map a column the engine compares in full to mirror "
+"this operator."
+msgstr ""
+
#, python-format
msgid "This export was requested on %(when)s UTC."
msgstr ""
(superset) 03/03: fix(explore): stop designating a partition column changing its flags
Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hughhhh pushed a commit to branch hughhhh/pfm-6-explore-indicator
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 5596d7eecbd514bc29fd1523fc0fb6ad9ca3a66b
Author: Hugh A Miles II <hu...@gmail.com>
AuthorDate: Tue Oct 6 16:04:42 2026 -0400
fix(explore): stop designating a partition column changing its flags
The customer decided on 2026-09-22 that marking a column as the partition
column must not change its "Is filterable" / "Is dimension" flags: they stay
checked and the column stays visible in Explore. The editor did the opposite --
`applyPartitionColumnDefaults` forced both to false on select, and the column
dropped out of Explore's dimension and filter pickers.
Hiding the partition key is a per-column decision the owner makes, not a side
effect of the mapping, and forcing it silently changed behaviour for a dataset
that already exposes its partition column.
This got worse rather than better in round 7: once `syncMetadata` merged
against the live column state instead of the mount-time snapshot, the unticking
survived the save rather than being quietly reverted by it.
The helper and its only call site are removed. The muted `partition-column-row`
styling is cosmetic and stays -- it marks the row without changing what the
column does.
Ported from #44431's 1f08a34, which carries this alongside an unrelated change
to `defaultTransformFor`; only the flag fix is taken here.
`gender` is the test's probe because it ships with both flags set. `num`, the
column these tests usually map, has both already false and so could not tell
the two behaviours apart -- which is how this survived a suite that already
exercised partition selection.
Co-Authored-By: Claude Opus 5 (1M context) <no...@anthropic.com>
---
.../DatasourceEditor/DatasourceEditor.tsx | 18 +++++-----
.../PartitionFilterMapping/utils.test.ts | 15 ---------
.../components/PartitionFilterMapping/utils.ts | 19 -----------
.../DatasourceEditorPartitionMapping.test.tsx | 39 ++++++++++++++++++++--
4 files changed, 44 insertions(+), 47 deletions(-)
diff --git a/superset-frontend/src/components/Datasource/components/DatasourceEditor/DatasourceEditor.tsx b/superset-frontend/src/components/Datasource/components/DatasourceEditor/DatasourceEditor.tsx
index 353a3807c0b..64d55174ee9 100644
--- a/superset-frontend/src/components/Datasource/components/DatasourceEditor/DatasourceEditor.tsx
+++ b/superset-frontend/src/components/Datasource/components/DatasourceEditor/DatasourceEditor.tsx
@@ -107,7 +107,6 @@ import {
import {
applyImplicitMappingMove,
applyMappingMove,
- applyPartitionColumnDefaults,
clearMappingTransforms,
defaultTransformFor,
nextMappedColumnOverride,
@@ -1402,11 +1401,11 @@ function DatasourceEditor({
columnName,
),
}));
- if (columnName) {
- setDatabaseColumns(prev =>
- applyPartitionColumnDefaults(prev, columnName),
- );
- }
+ // Deliberately nothing else. Designating a partition column must not
+ // touch that column's own `filterable`/`groupby` flags: hiding it from
+ // Explore is a per-column decision the owner makes, not a side effect of
+ // the mapping, and forcing it here silently changed behaviour for a
+ // dataset that already exposes its partition column.
},
[],
);
@@ -1609,10 +1608,9 @@ function DatasourceEditor({
// `setDatasource` call writes `columns`, and the props-sync effect only
// re-seeds the two column states. Merging a sync against it restored
// whatever the dataset held when the modal opened -- a transform and
- // monotonicity flag just cleared, the `filterable`/`groupby` flags
- // `applyPartitionColumnDefaults` just turned off, a description edited this
- // session -- because `updateColumns` passes an unchanged column through
- // verbatim.
+ // monotonicity flag just cleared, a `filterable`/`groupby` flag just toggled,
+ // a description edited this session -- because `updateColumns` passes an
+ // unchanged column through verbatim.
const currentColumns = useMemo(
() => [...databaseColumns, ...calculatedColumns],
[databaseColumns, calculatedColumns],
diff --git a/superset-frontend/src/components/Datasource/components/DatasourceEditor/components/PartitionFilterMapping/utils.test.ts b/superset-frontend/src/components/Datasource/components/DatasourceEditor/components/PartitionFilterMapping/utils.test.ts
index 5bd81ee5c31..a62d7827b18 100644
--- a/superset-frontend/src/components/Datasource/components/DatasourceEditor/components/PartitionFilterMapping/utils.test.ts
+++ b/superset-frontend/src/components/Datasource/components/DatasourceEditor/components/PartitionFilterMapping/utils.test.ts
@@ -19,7 +19,6 @@
import {
applyImplicitMappingMove,
applyMappingMove,
- applyPartitionColumnDefaults,
clearMappingTransforms,
defaultTransformFor,
mappedColumnIsImplicit,
@@ -377,20 +376,6 @@ test('clearing the default datetime column clears the mapping transform with it'
});
});
-test('designating a partition column takes it out of the Explore pickers', () => {
- const updated = applyPartitionColumnDefaults(COLUMNS, 'dt_epoch');
-
- expect(updated.find(c => c.column_name === 'dt_epoch')).toMatchObject({
- filterable: false,
- groupby: false,
- });
- // Everything else is left alone.
- expect(updated.find(c => c.column_name === 'country')).toMatchObject({
- filterable: true,
- groupby: true,
- });
-});
-
test('only temporal columns get a pre-filled transform', () => {
const datasource = {
partition_value_transform_default: 'unix_timestamp(:value)',
diff --git a/superset-frontend/src/components/Datasource/components/DatasourceEditor/components/PartitionFilterMapping/utils.ts b/superset-frontend/src/components/Datasource/components/DatasourceEditor/components/PartitionFilterMapping/utils.ts
index 624e0ad91dd..31f1bf22587 100644
--- a/superset-frontend/src/components/Datasource/components/DatasourceEditor/components/PartitionFilterMapping/utils.ts
+++ b/superset-frontend/src/components/Datasource/components/DatasourceEditor/components/PartitionFilterMapping/utils.ts
@@ -472,25 +472,6 @@ export function nextMappedColumnOverride(
return previousOverride ?? null;
}
-/**
- * Columns updated for a newly designated partition column.
- *
- * The partition key is technical, so it defaults out of Explore's dimension and
- * filter pickers. Only the defaults are set -- an owner who wants the raw
- * column exposed can toggle it back, and clearing the partition column later
- * does not undo their choice.
- */
-export function applyPartitionColumnDefaults<T extends PartitionMappingColumn>(
- columns: T[],
- partitionColumnName: string,
-): T[] {
- return columns.map(column =>
- column.column_name === partitionColumnName
- ? { ...column, filterable: false, groupby: false }
- : column,
- );
-}
-
/**
* Where "Map a column →" should take an owner with nothing mapped yet.
*
diff --git a/superset-frontend/src/components/Datasource/components/DatasourceEditor/tests/DatasourceEditorPartitionMapping.test.tsx b/superset-frontend/src/components/Datasource/components/DatasourceEditor/tests/DatasourceEditorPartitionMapping.test.tsx
index 6e0913851e2..958d5759cce 100644
--- a/superset-frontend/src/components/Datasource/components/DatasourceEditor/tests/DatasourceEditorPartitionMapping.test.tsx
+++ b/superset-frontend/src/components/Datasource/components/DatasourceEditor/tests/DatasourceEditorPartitionMapping.test.tsx
@@ -338,9 +338,9 @@ test('DatasourceEditor source pins syncMetadata to the live column state', () =>
// `updateColumns` passes an unchanged column through verbatim, so merging a
// sync against that snapshot restores whatever the dataset held when the
// modal opened -- the transform and monotonicity flag the owner just
- // cleared, the `filterable`/`groupby` flags `applyPartitionColumnDefaults`
- // just turned off, any description edited this session. The merge semantics
- // themselves are covered in `utils/partitionMapping.test.ts`.
+ // cleared, a `filterable`/`groupby` flag they just toggled, any description
+ // edited this session. The merge semantics themselves are covered in
+ // `utils/partitionMapping.test.ts`.
// eslint-disable-next-line global-require
const { readFileSync } = require('fs');
// eslint-disable-next-line global-require
@@ -414,3 +414,36 @@ test("the mapped column's row is muted in the columns table", async () => {
'num',
);
});
+
+test('designating a partition column leaves its filterable and groupby flags alone', async () => {
+ // The customer's decision (2026-09-22): marking a column as the partition
+ // column must not change its "Is filterable" / "Is dimension" flags, and the
+ // column stays visible in Explore. The editor forced both to false, which
+ // silently changed behaviour for a dataset that already exposes its partition
+ // key -- and once the sync merged against live state rather than the
+ // mount-time snapshot, the unticking survived the save instead of being
+ // quietly reverted by it.
+ //
+ // `gender` is the probe because it starts with both flags set; `num`, the
+ // column these tests usually map, ships with both already false and so could
+ // not tell the two behaviours apart.
+ const props = createProps();
+ props.datasource.main_dttm_col = 'ds';
+ props.datasource.partition_column = null;
+ props.datasource.partition_mapped_column = null;
+
+ fastRender(props);
+ await dismissDatasourceWarning();
+ await userEvent.click(await screen.findByTestId('collection-tab-Columns'));
+ await screen.findByTestId('partition-column-select');
+
+ await selectOption('gender', 'Partition column');
+
+ await waitFor(() => {
+ expect(props.onChange).toHaveBeenCalled();
+ });
+ expect(columnNamed(lastSavedColumns(props), 'gender')).toMatchObject({
+ filterable: true,
+ groupby: true,
+ });
+});
(superset) 01/03: fix(datasets): preview a filter the way the chart path mirrors it
Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hughhhh pushed a commit to branch hughhhh/pfm-6-explore-indicator
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 2b69a1fe01bb4abc71b33bf55b7f22d6f94278bc
Author: Hugh A Miles II <hu...@gmail.com>
AuthorDate: Tue Oct 6 13:35:18 2026 -0400
fix(datasets): preview a filter the way the chart path mirrors it
Preview handed its coerced sample straight to `build_mirrored_predicates`,
while a chart filter first goes through `_mirror_probe_input` -- the step that
widens a bound outward and declines an equality where the engine compares less
of the value than the filter carries. So the preview reported a valid predicate
for requests the query path emits no mirror for, and showed an un-widened,
narrower bound than the query actually uses. The owner was shown pruning they
would never get.
Fixed by sharing the step rather than calling it twice. The whole
normalize-or-decline sequence -- render an expression as a literal, widen or
decline, and the `IN` list's all-or-nothing semantics, where one `None` or one
declining member declines the list entire -- moves into
`ExploreMixin.mirror_probe_request`, which both callers now use. The chart path
is a pure refactor; its 99 tests are unchanged.
The `UNMIRRORABLE` sentinel moves to `partition_mapping` because the dependency
runs helpers -> partition_mapping, so that is the only direction it can cross;
`_UNMIRRORABLE` stays as a local alias. `_probe_input` drops its own
`ColumnElement` conversion, which the shared step already does.
A decline gets its own `resolution` reason rather than reusing `engine`, which
means "the probe did not come back". The editor renders it as a warning
alongside `operator`: the transform is fine and the engine evaluates it, so
calling it an error would be wrong. The probe-and-build tail is now
`_preview_probe`, leaving the gates that answer from the stored mapping alone
readable as the run of guard clauses they are.
Three preview tests mapped a temporal column for convenience while asserting
something else, and a text sample on one now correctly declines; they move to a
text mapped column.
Co-Authored-By: Claude Opus 5 (1M context) <no...@anthropic.com>
---
docs/static/resources/openapi.json | 1 +
.../PartitionMappingSection.tsx | 11 +-
.../components/PartitionFilterMapping/types.ts | 1 +
superset/connectors/sqla/partition_mapping.py | 89 +++++++++++++---
superset/datasets/api.py | 1 +
superset/models/helpers.py | 86 ++++++++++------
.../datasets/partition_mapping_preview_test.py | 112 ++++++++++++++++++++-
7 files changed, 245 insertions(+), 56 deletions(-)
diff --git a/docs/static/resources/openapi.json b/docs/static/resources/openapi.json
index bba4dd36afa..d5ba4e262b5 100644
--- a/docs/static/resources/openapi.json
+++ b/docs/static/resources/openapi.json
@@ -24754,6 +24754,7 @@
"validation",
"parse",
"operator",
+ "resolution",
"engine",
"type"
],
diff --git a/superset-frontend/src/components/Datasource/components/DatasourceEditor/components/PartitionFilterMapping/PartitionMappingSection.tsx b/superset-frontend/src/components/Datasource/components/DatasourceEditor/components/PartitionFilterMapping/PartitionMappingSection.tsx
index 50e9cd6bc8f..cb912271a36 100644
--- a/superset-frontend/src/components/Datasource/components/DatasourceEditor/components/PartitionFilterMapping/PartitionMappingSection.tsx
+++ b/superset-frontend/src/components/Datasource/components/DatasourceEditor/components/PartitionFilterMapping/PartitionMappingSection.tsx
@@ -315,9 +315,14 @@ export default function PartitionMappingSection({
{/* Only one of preview and error is ever visible. */}
{!loading && preview && !preview.valid && (
<Alert
- // A range that won't mirror is a live warning about the checkbox
- // above, not a broken transform; calling it an error would be wrong.
- type={preview.reason === 'operator' ? 'warning' : 'error'}
+ // A range that won't mirror, or an operator this column's type puts
+ // out of reach, is a live warning about the checkbox and the column
+ // above -- not a broken transform; calling it an error would be wrong.
+ type={
+ preview.reason === 'operator' || preview.reason === 'resolution'
+ ? 'warning'
+ : 'error'
+ }
showIcon
data-test="partition-mapping-error"
message={
diff --git a/superset-frontend/src/components/Datasource/components/DatasourceEditor/components/PartitionFilterMapping/types.ts b/superset-frontend/src/components/Datasource/components/DatasourceEditor/components/PartitionFilterMapping/types.ts
index 9a730381fcf..85e1ef4c59a 100644
--- a/superset-frontend/src/components/Datasource/components/DatasourceEditor/components/PartitionFilterMapping/types.ts
+++ b/superset-frontend/src/components/Datasource/components/DatasourceEditor/components/PartitionFilterMapping/types.ts
@@ -54,6 +54,7 @@ export interface PartitionMappingPreview {
| 'parse'
| 'validation'
| 'operator'
+ | 'resolution'
| 'engine'
| 'type'
| 'unconfigured';
diff --git a/superset/connectors/sqla/partition_mapping.py b/superset/connectors/sqla/partition_mapping.py
index f006ea5f092..c68aa63bb02 100644
--- a/superset/connectors/sqla/partition_mapping.py
+++ b/superset/connectors/sqla/partition_mapping.py
@@ -271,6 +271,20 @@ MIRRORABLE_OPERATORS = MIRRORABLE_ALWAYS | MIRRORABLE_IF_MONOTONIC
PREVIEWABLE_OPERATORS = MIRRORABLE_OPERATORS - {FilterOperator.TEMPORAL_RANGE}
+#: Returned by `ExploreMixin.mirror_probe_request` for a filter no mirror can
+#: stand in for: one the engine compares more coarsely than the value carries, a
+#: value it cannot render as a literal, or an ``IN`` list with a member of
+#: either kind. A sentinel rather than `None`, because `None` is a filter value
+#: in its own right.
+#:
+#: Lives here rather than beside that method so the preview can read it too:
+#: `superset.models.helpers` imports this module, so the sentinel can only cross
+#: the boundary in this direction. Both callers have to recognise the same
+#: object -- a preview that answered "valid" for a request the chart path
+#: declines is the drift this is here to prevent.
+UNMIRRORABLE = object()
+
+
#: A transform that preserves ordering need not be *strictly* increasing: a day
#: key such as ``to_char(ts, 'YYYYMMDD')`` maps a whole day of timestamps onto
#: one value. For such a ``T``, ``col < v`` only implies ``T(col) <= T(v)`` and
@@ -1907,9 +1921,55 @@ def preview_partition_mapping( # pylint: disable=too-many-return-statements
),
}
- value = _probe_input(
- datasource, columns_by_name[mapped_column], operator, sample_values
+ return _preview_probe(
+ datasource,
+ mapping,
+ columns_by_name[mapped_column],
+ operator,
+ sample_values,
+ sample_input,
)
+
+
+def _preview_probe(
+ datasource: SqlaTable,
+ mapping: PartitionMapping,
+ mapped_col: "TableColumn",
+ operator: FilterOperator,
+ sample_values: list[str],
+ sample_input: str,
+) -> dict[str, Any]:
+ """
+ The half of a preview that needs the warehouse.
+
+ Split out from `preview_partition_mapping` so that the gates which answer
+ from the stored mapping alone stay readable as the single run of guard
+ clauses they are. Everything here has either run a query or decided not to.
+ """
+ value = datasource.mirror_probe_request(
+ operator,
+ _probe_input(datasource, mapped_col, operator, sample_values),
+ mapped_col,
+ )
+ if value is UNMIRRORABLE:
+ # The same step the chart path applies, so the preview cannot promise a
+ # mirror the query declines. Its own reason: the transform is fine and
+ # the engine evaluates it, the filter just carries more of the value
+ # than the engine compares on this column -- which is the column's type
+ # talking, not a broken expression.
+ return {
+ "valid": False,
+ "reason": "resolution",
+ "sample_input": sample_input,
+ "error": _(
+ "This engine compares less of a %(operator)s value on "
+ "%(column)s than the filter carries, so there is no mirror a "
+ "predicate on the partition column could stand in for. Map a "
+ "column the engine compares in full to mirror this operator.",
+ operator=operator.value,
+ column=mapped_col.column_name,
+ ),
+ }
errors: list[str] = []
type_errors: list[str] = []
predicates = build_mirrored_predicates(
@@ -1973,11 +2033,17 @@ def _probe_input(
`preview_partition_mapping`'s docstring did not actually hold.
Coerced by `filter_values_handler`, the same function the query path uses,
- rather than by a second implementation of the same rules.
+ rather than by a second implementation of the same rules. Everything the
+ query path then does to the coerced value -- rendering an expression as a
+ literal, widening a bound, declining a comparison the engine resolves too
+ coarsely -- is `ExploreMixin.mirror_probe_request`'s, and the caller hands
+ this result straight to it.
Ranges are not previewable (see `PREVIEWABLE_OPERATORS`), so the bound
conversion `_collect_partition_mirror_range` applies -- a ``datetime`` into
the column's stored representation -- has no counterpart here.
+
+ :returns: `UNMIRRORABLE` where the samples cannot be coerced at all
"""
is_list = operator == FilterOperator.IN
column_spec = datasource.db_engine_spec.get_column_spec(native_type=column.type)
@@ -1994,19 +2060,10 @@ def _probe_input(
db_engine_spec=datasource.db_engine_spec,
db_extra=datasource.db_extra,
)
-
- def bindable(value: Any) -> Any:
- # An epoch-milliseconds sample on a temporal column comes back as
- # engine SQL rather than a value, and SQL cannot be the value of a bind
- # parameter -- carried as text so the probe substitutes it, the same way
- # an array literal is.
- if isinstance(value, ColumnElement):
- return raw_probe_value(datasource.database, value)
- return value
-
- if is_list and isinstance(handled, (list, tuple)):
- return [bindable(entry) for entry in handled]
- return bindable(handled)
+ # No `ColumnElement` conversion here: an epoch-milliseconds sample comes back
+ # as engine SQL rather than a value, and `mirror_probe_request` renders it --
+ # the same step, on the same values, as for a chart filter.
+ return handled
def _render_sample_input(
diff --git a/superset/datasets/api.py b/superset/datasets/api.py
index 42ff00b8ff3..958cae3851b 100644
--- a/superset/datasets/api.py
+++ b/superset/datasets/api.py
@@ -2236,6 +2236,7 @@ class DatasetRestApi(SoftDeleteApiMixin, BaseSupersetModelRestApi):
- validation
- parse
- operator
+ - resolution
- engine
- type
sample_input:
diff --git a/superset/models/helpers.py b/superset/models/helpers.py
index 5c4f5a7a99d..ae53937d5cf 100644
--- a/superset/models/helpers.py
+++ b/superset/models/helpers.py
@@ -100,6 +100,7 @@ from superset.connectors.sqla.partition_mapping import (
PartitionMapping,
raw_probe_value,
resolve_partition_mapping,
+ UNMIRRORABLE,
UPPER_BOUND_OPERATORS,
)
from superset.constants import (
@@ -468,13 +469,14 @@ def _shift_grainless_temporal_source(
#: filter value in its own right.
_UNRENDERABLE = object()
-#: Returned by `ExploreMixin._mirror_probe_input` when the engine compares less
-#: of the filter's value than any mirror could be built from. A sentinel rather
-#: than `None` for the same reason `_UNRENDERABLE` is, and a *separate* sentinel
-#: because the two decline for different reasons: that one is an engine that
-#: cannot render a literal at all, which is worth a warning, and this one is an
-#: ordinary filter the mirror has to stay quiet about.
-_UNMIRRORABLE = object()
+#: `_UNMIRRORABLE` is `UNMIRRORABLE`, imported from
+#: `superset.connectors.sqla.partition_mapping` so the preview path can
+#: recognise the same object. Kept under the private name here because it
+#: appears throughout this module, and separate from `_UNRENDERABLE` because the
+#: two decline for different reasons: that one is an engine that cannot render a
+#: literal at all, which is worth a warning, and this one is an ordinary filter
+#: the mirror has to stay quiet about.
+_UNMIRRORABLE = UNMIRRORABLE
def _instant_from_filter_value(value: Any) -> Optional[datetime]:
@@ -4872,34 +4874,55 @@ class ExploreMixin: # pylint: disable=too-many-public-methods
Only operators the mapping declares safe are recorded; see the operator
matrix in `superset.connectors.sqla.partition_mapping`.
- Every value then goes through `_mirror_probe_input`, which is where what
- the engine actually compares is applied. Routing per *value* rather than
- per Python type is what makes a bound widen and an equality decline
- whichever shape the value arrived in -- a `datetime` from
- drill-to-detail, or the raw string a simple filter binds.
+ The value itself is resolved by `mirror_probe_request`, which the preview
+ endpoint calls too so that the two cannot answer differently.
"""
if mapping is None or column_name != mapping.mapped_column:
return
if not mapping.mirrors(operator):
return
+ mapped_col = next(
+ (col for col in self.columns if col.column_name == column_name), None
+ )
+ probe_value = self.mirror_probe_request(operator, value, mapped_col)
+ if probe_value is UNMIRRORABLE:
+ return
+ sink.append((operator, probe_value))
+
+ def mirror_probe_request(
+ self,
+ operator: utils.FilterOperator,
+ value: Any,
+ col: Optional["TableColumn"],
+ ) -> Any:
+ """
+ ``value`` as the mirror may probe the transform at, or `UNMIRRORABLE`.
+
+ The whole of what has to happen to a filter value before it can be
+ probed, in one place because two callers need it: the chart query path,
+ and the dataset editor's preview endpoint. The preview used to coerce the
+ value and then probe it directly, so it reported a mirror for a request
+ the chart path declines -- an owner was shown a valid predicate on a
+ `DATE` mapped column whose equality filters never mirror at all.
+
+ Routing per *value* rather than per Python type is what makes a bound
+ widen and an equality decline whichever shape the value arrived in -- a
+ `datetime` from drill-to-detail, or the raw string a simple filter binds.
+ """
# First, and ahead of anything that reads the value as an instant: a
# value `filter_values_handler` already turned into engine SQL is
# carried as text from here on, and the probe has to receive exactly
# that literal -- it is what the real predicate compares, so there is
- # nothing left to resolve about it.
- probe_input = self._as_probe_input(value)
- if probe_input is _UNRENDERABLE:
- return
- value = probe_input
-
- mapped_col = next(
- (col for col in self.columns if col.column_name == column_name), None
- )
+ # nothing left to resolve about it. Idempotent, so a caller that has
+ # already rendered its own values may still come through here.
+ value = self._as_probe_input(value)
+ if value is _UNRENDERABLE:
+ return UNMIRRORABLE
if operator == utils.FilterOperator.IN:
if not isinstance(value, (list, tuple)) or not value:
- return
+ return UNMIRRORABLE
if any(item is None for item in value):
# A `None` in the list widens the real predicate to
# `col IS NULL OR col IN (...)`. Mirroring only the non-null
@@ -4907,22 +4930,21 @@ class ExploreMixin: # pylint: disable=too-many-public-methods
# would drop rows it keeps. Checked before the conversion
# below, which passes a `None` straight through and could not
# be told apart from a value afterwards.
- return
+ return UNMIRRORABLE
members = tuple(
- self._mirror_probe_input(operator, item, mapped_col) for item in value
+ self._mirror_probe_input(operator, item, col) for item in value
)
- if any(member is _UNMIRRORABLE for member in members):
+ if any(member is UNMIRRORABLE for member in members):
# One member the engine compares more coarsely than the mirror
# can be built from is the whole list's problem: dropping just
# that member is the same narrowing the `None` guard above
# refuses. So the list declines entire.
- return
- sink.append((operator, members))
- elif value is not None:
- probe_value = self._mirror_probe_input(operator, value, mapped_col)
- if probe_value is _UNMIRRORABLE:
- return
- sink.append((operator, probe_value))
+ return UNMIRRORABLE
+ return members
+
+ if value is None:
+ return UNMIRRORABLE
+ return self._mirror_probe_input(operator, value, col)
def _build_partition_mirror_predicates(
self,
diff --git a/tests/unit_tests/datasets/partition_mapping_preview_test.py b/tests/unit_tests/datasets/partition_mapping_preview_test.py
index 78a75681021..fd84a9e51a9 100644
--- a/tests/unit_tests/datasets/partition_mapping_preview_test.py
+++ b/tests/unit_tests/datasets/partition_mapping_preview_test.py
@@ -98,6 +98,11 @@ def dataset(session: Session) -> Any:
# else in a text comparison and one of them compares it as never
# equal rather than refusing it.
TableColumn(column_name="part_ts", type="TIMESTAMP"),
+ # A text *mapped* column. A temporal one will not stand in for it:
+ # a sample that is not an ISO instant declines on a column the
+ # engine compares more coarsely than the value carries, which is
+ # the right answer there and noise in a test about anything else.
+ TableColumn(column_name="country", type="VARCHAR"),
],
)
table.partition_column = "dt_epoch"
@@ -219,7 +224,7 @@ def test_preview_mirrors_in_element_wise(
response = client.post(
f"/api/v1/dataset/{dataset.id}/partition_mapping/preview/",
json={
- "mapped_column": "event_time",
+ "mapped_column": "country",
"partition_column": "region_key",
"value_transform": "lower(:value)",
"sample_values": ["US", "CA"],
@@ -229,7 +234,7 @@ def test_preview_mirrors_in_element_wise(
assert response.json["result"] == {
"valid": True,
- "sample_input": "event_time IN ('US', 'CA')",
+ "sample_input": "country IN ('US', 'CA')",
"emitted_predicate": "region_key IN ('us', 'ca') OR region_key IS NULL",
}
@@ -617,7 +622,7 @@ def test_a_probe_that_returns_null_reports_a_reason_not_a_predicate(
response = client.post(
f"/api/v1/dataset/{dataset.id}/partition_mapping/preview/",
json={
- "mapped_column": "event_time",
+ "mapped_column": "country",
"value_transform": "unix_timestamp(:value)",
"sample_values": ["not a date"],
},
@@ -639,7 +644,7 @@ def test_a_probed_string_is_quoted_and_escaped_by_the_dialect(
response = client.post(
f"/api/v1/dataset/{dataset.id}/partition_mapping/preview/",
json={
- "mapped_column": "event_time",
+ "mapped_column": "country",
"partition_column": "region_key",
"value_transform": "lower(:value)",
"sample_values": ["O'Hara"],
@@ -651,7 +656,7 @@ def test_a_probed_string_is_quoted_and_escaped_by_the_dialect(
assert result["emitted_predicate"] == "region_key = 'o''hara' OR region_key IS NULL"
# The sample input is display-only but still reads as SQL, so the value it
# echoes back is quoted and escaped the same way.
- assert result["sample_input"] == "event_time == 'O''Hara'"
+ assert result["sample_input"] == "country == 'O''Hara'"
def test_an_over_long_transform_is_rejected_before_the_engine(
@@ -967,3 +972,100 @@ def test_preview_leaves_a_string_column_s_sample_alone(
assert response.status_code == 200
assert probed == [["02134"]]
+
+
+def test_preview_declines_an_equality_the_chart_path_declines(
+ client: Any, full_api_access: None, dataset: Any
+) -> None:
+ """
+ The preview used to hand its coerced sample straight to
+ `build_mirrored_predicates`, while a chart filter first goes through
+ `mirror_probe_request`. So where the engine compares less of a value than
+ the filter carries, previewing `==` reported a valid predicate while the
+ chart emitted no mirror at all -- the owner was shown pruning they would
+ never get.
+
+ SQLite renders a temporal literal to the second, so a sample carrying
+ microseconds is the shape that declines here; the bare-day case that
+ Presto, Trino and BigQuery produce for a `DATE` column is the same gate and
+ is covered against those renderings in `partition_mirroring_test.py`.
+
+ An equality has nowhere to widen to, so declining is the answer -- with its
+ own reason, because the transform is fine and the engine evaluates it.
+ """
+ with patch(PROBE, return_value=["20260706100811"]) as probe:
+ response = client.post(
+ f"/api/v1/dataset/{dataset.id}/partition_mapping/preview/",
+ json={
+ "mapped_column": "event_time",
+ "partition_column": "region_key",
+ "value_transform": "to_char(:value, 'YYYYMMDDHH24MISS')",
+ "sample_values": ["2026-07-06 10:08:11.123456"],
+ },
+ )
+
+ assert response.status_code == 200
+ result = response.json["result"]
+ assert result["valid"] is False
+ assert result["reason"] == "resolution"
+ assert "emitted_predicate" not in result
+ # Declined before the engine, as the chart path declines before the engine.
+ probe.assert_not_called()
+
+
+def test_preview_and_the_chart_path_agree_about_a_coarse_column(
+ app: Flask, client: Any, full_api_access: None, dataset: Any
+) -> None:
+ """
+ The invariant behind the fix, asserted in both directions: for the same
+ filter, the preview's verdict and the query's emitted SQL say the same
+ thing. Pinned because the two paths drifted twice -- once over coercion,
+ once over resolution -- and each time the symptom was a preview promising a
+ mirror the chart does not emit.
+ """
+ # Two previews, and the rate-limit tests above leave a budget of one behind
+ # on the shared `app.config`.
+ app.config["PARTITION_TRANSFORM_PREVIEW_RATE_LIMIT"] = 30
+
+ transform = "to_char(:value, 'YYYYMMDDHH24MISS')"
+ for column in dataset.columns:
+ if column.column_name == "event_time":
+ column.partition_value_transform = transform
+ dataset.partition_column = "region_key"
+ db.session.flush()
+
+ def preview_and_query(sample: str) -> tuple[Any, str]:
+ with patch(PROBE, return_value=["20260706100811"]):
+ previewed = client.post(
+ f"/api/v1/dataset/{dataset.id}/partition_mapping/preview/",
+ json={
+ "mapped_column": "event_time",
+ "partition_column": "region_key",
+ "value_transform": transform,
+ "sample_values": [sample],
+ },
+ ).json["result"]
+ sql = str(
+ dataset.get_sqla_query(
+ columns=["country"],
+ metrics=[],
+ orderby=[],
+ extras={},
+ granularity=None,
+ is_timeseries=False,
+ filter=[{"col": "event_time", "op": "==", "val": sample}],
+ ).sqla_query.compile(compile_kwargs={"literal_binds": True})
+ )
+ return previewed, sql
+
+ # More of the value than SQLite compares: neither mirrors.
+ coarse, coarse_sql = preview_and_query("2026-07-06 10:08:11.123456")
+ assert coarse["valid"] is False
+ assert coarse["reason"] == "resolution"
+ assert "region_key" not in coarse_sql
+
+ # Exactly what it compares: both do.
+ exact, exact_sql = preview_and_query("2026-07-06 10:08:11")
+ assert exact["valid"] is True
+ assert "region_key = '20260706100811'" in exact["emitted_predicate"]
+ assert "region_key = '20260706100811'" in exact_sql