Skip to content

[SIP-216] Add extensible extra metadata field to charts (slices) #41171

@bsovran

Description

@bsovran

[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

  1. Reuse description

    • Rejected because it is a user-facing prose field and not appropriate for structured metadata.
  2. 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.
  3. Store metadata only in frontend/local state

    • Rejected because metadata should be durable, versionable, and shared across users and automation workflows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions