Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Document :metabase.lib.field/simple-display-name (#69590)

metamben764befaffb3c
diff --git a/src/metabase/lib/schema/metadata.cljc b/src/metabase/lib/schema/metadata.cljc
index 7cf11b4ba2a..21e74c91fcd 100644
--- a/src/metabase/lib/schema/metadata.cljc
+++ b/src/metabase/lib/schema/metadata.cljc
@@ -384,7 +384,12 @@
;; this happened in a previous stage they should get propagated as the keys below instead.
[:metabase.lib.field/temporal-unit {:optional true} [:maybe ::lib.schema.temporal-bucketing/unit]]
[:metabase.lib.field/binning {:optional true} [:maybe ::lib.schema.binning/binning]]
- ;;
+ ;; For nested fields (fields with a `:parent-id`, e.g. JSON columns), the pre-computed display name including the
+ ;; full parent chain prefix, e.g. `"Grandparent: Parent: Child"`. Used as the highest-priority initial display
+ ;; name in the display name pipeline, before join alias, binning, and temporal bucketing decorations are added.
+ ;; This is distinct from `:lib/original-display-name`, which for a nested field stores just the leaf name
+ ;; (e.g. `"Child"`) — both may coexist on the same column.
+ [:metabase.lib.field/simple-display-name {:optional true} [:maybe ::lib.schema.common/non-blank-string]]
;; If temporal bucketing or binning happened in a previous stage, they are propagated as the keys below.
;; `:inherited-temporal-unit` signals that this column was already bucketed upstream, so the default temporal
;; unit becomes `:inherited` rather than a type-based default like `:month`, preventing double-bucketing.