[SIP] Proposal for adding an extensible extra metadata field to charts (slices)
Motivation
Superset datasets already support flexible metadata via the extra field, but charts (slices) do not have an equivalent extensible storage field.
Teams building chart-level guidance and automation (for example, human-authored interpretation notes and machine-readable chart semantics) need a structured place to store metadata that does not fit into description, certification_details, or chart form data.
Using description for this purpose is limiting because it is a user-facing text field rendered in UI contexts where structured JSON does not belong. Adding a flexible chart-level metadata field would provide a clear, first-class place for this type of information.
Proposed Change
Add a new nullable extra column to the slices table and corresponding Slice model field.
- Column name:
extra
- Storage: JSON serialized as text (matching existing Superset patterns)
- SQLAlchemy type:
MediumText (superset.utils.core.MediumText)
- Nullability: nullable, no server default
MediumText is preferred over Text because chart metadata payloads can grow beyond small note-sized content, and existing large JSON-like chart fields (params, query_context) already use MediumText.
Also include extra in chart import/export fields so metadata round-trips cleanly.
New or Changed Public Interfaces
This SIP proposes the DB/model foundation first:
- New model attribute on
Slice: extra
- New DB column:
slices.extra
A follow-up change can expose this through chart REST schemas (ChartPostSchema, ChartPutSchema, GET response schema), but this proposal focuses on establishing the persisted storage contract.
New dependencies
None.
Migration Plan and Compatibility
- Add Alembic migration to create nullable
extra column on slices.
- Downgrade removes the column.
- Fully backward compatible:
- Existing charts unaffected (
NULL default state).
- Existing API behavior unchanged until schema exposure is added.
Rejected Alternatives
-
Reuse description
- Rejected because it is a user-facing prose field and not appropriate for structured metadata.
-
Add a separate chart annotation table
- Rejected for now due to added complexity and join overhead for a use case that can be modeled as chart-scoped extensible metadata.
-
Store metadata only in frontend/local state
- Rejected because metadata should be durable, versionable, and shared across users and automation workflows.
[SIP] Proposal for adding an extensible
extrametadata field to charts (slices)Motivation
Superset datasets already support flexible metadata via the
extrafield, but charts (slices) do not have an equivalent extensible storage field.Teams building chart-level guidance and automation (for example, human-authored interpretation notes and machine-readable chart semantics) need a structured place to store metadata that does not fit into
description,certification_details, or chart form data.Using
descriptionfor this purpose is limiting because it is a user-facing text field rendered in UI contexts where structured JSON does not belong. Adding a flexible chart-level metadata field would provide a clear, first-class place for this type of information.Proposed Change
Add a new nullable
extracolumn to theslicestable and correspondingSlicemodel field.extraMediumText(superset.utils.core.MediumText)MediumTextis preferred overTextbecause chart metadata payloads can grow beyond small note-sized content, and existing large JSON-like chart fields (params,query_context) already useMediumText.Also include
extrain chart import/export fields so metadata round-trips cleanly.New or Changed Public Interfaces
This SIP proposes the DB/model foundation first:
Slice:extraslices.extraA follow-up change can expose this through chart REST schemas (
ChartPostSchema,ChartPutSchema, GET response schema), but this proposal focuses on establishing the persisted storage contract.New dependencies
None.
Migration Plan and Compatibility
extracolumn onslices.NULLdefault state).Rejected Alternatives
Reuse
descriptionAdd a separate chart annotation table
Store metadata only in frontend/local state