mirror of
https://github.com/apache/superset.git
synced 2026-06-11 10:39:15 +00:00
Add _get_canonical_metric_name() to DatasetValidator that searches only available_metrics, preventing a column with matching case-insensitive name from shadowing a saved metric's canonical casing. Update all 7 chart plugins (xy, table, pie, big_number, handlebars, mixed_timeseries, pivot_table) to branch on saved_metric flag: saved metrics now go through _get_canonical_metric_name while regular column refs continue to use _get_canonical_column_name. Fix pre_validate alias handling in xy and mixed_timeseries plugins to accept Pydantic AliasChoices keys (metrics/x_axis/metrics_b) so payloads using canonical Superset field names are not incorrectly rejected. Add TestGetCanonicalMetricName, TestSavedMetricNormalizationCorrectness, and TestPreValidateAliasHandling test classes covering the collision case and alias acceptance. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>