hughhhh opened a new pull request, #45929:
URL: https://github.com/apache/superset/pull/45929
### SUMMARY
Supersedes #44431 by @eschutho, rebuilt on current `master` so it can merge.
Her 17 commits are cherry-picked with authorship and trailers intact, and all
credit for the gate goes to her.
With `PARTITION_FILTER_MAPPING` on, every database showed the partition
mapping controls and mirrored filters at query time. That includes engines
where nothing prunes on a partition column. This PR adds a
`supports_partition_filter_mapping` engine capability, set on Hive and Impala
and inherited by Spark SQL, Databricks Interactive Cluster and Ascend. It then
applies that capability in four places:
- **Dataset editor:** the mapping controls only appear on a supported
engine. Pointing a dataset at another database re-reads the capability and the
transform default from the new database's engine.
- **Query time:** `resolve_partition_mapping` declines a stored mapping on
an unsupported engine, logs it once, and the Explore glyph agrees.
- **Saves:** a mapping stored before the gate stays kept but hidden. Saving
no longer returns a 422 for it, and re-pointing the default datetime column
doesn't wipe it.
- **Docs and `UPDATING.md`:** both describe the behaviour change.
**Changes from #44431:**
- **Dropped as already on `master`:** the earlier partition-stack history,
which landed via #43870, and the column-flag half of `1f08a34700`, which
`master` already enforces.
- **Left out of scope:** the bare `:value` fallback default and its
auto-ticked "preserves ordering" flow (the other half of `1f08a34700`, plus
`76fec9ba78` from the old branch). `master`'s default-selection rules stay as
they are.
- **Added:**
- the reviewer-requested database-switch tests. Postgres → Hive asserts a
temporal column arrives with `unix_timestamp(:value)`, and Hive → Postgres
asserts the emitted capability and default are cleared. Both fail if the switch
leaves the default stale.
- test opt-ins for the dialect tests `master` added since #44431 branched.
- message catalog entries for the two new strings.
- removal of a stale duplicate `UPDATING.md` entry.
Separate from #45846, #45848, #45833 and #45851, which are left untouched.
**Open question for review:** the gate admits only Hive and Impala and the
specs that inherit from them. On any other engine, including Postgres, Oracle,
Trino and BigQuery, existing mappings stop mirroring after upgrade, as
`UPDATING.md` describes. Widening the list is a one-line change per spec if
reviewers want it.
### TESTING INSTRUCTIONS
1. Enable `PARTITION_FILTER_MAPPING`.
2. Edit a dataset on a Hive or Impala database. The Partition column
settings appear.
3. Edit a dataset on Postgres. They don't.
4. In the editor, switch a dataset's database between the two and check the
section follows the database.
5. Automated:
- `pytest tests/unit_tests/connectors/sqla/partition_mapping_test.py
tests/unit_tests/models/partition_mirroring_test.py tests/unit_tests/datasets
tests/unit_tests/commands/dataset tests/unit_tests/db_engine_specs`
- `npm run test -- src/components/Datasource
src/components/DatabaseSelector`
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [x] Required feature flags: `PARTITION_FILTER_MAPPING`
- [x] Changes UI
- [ ] Includes DB Migration (follow approval process in
[SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [x] Introduces new feature or API
- [ ] Removes existing feature or API
Created with Claude Opus 5.5 in Claude Code.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]