Skip to content

Support Superset catalog, currency, folders, and format metadata#207

Merged
nicosuave merged 4 commits into
mainfrom
update-superset-adapter
Jun 15, 2026
Merged

Support Superset catalog, currency, folders, and format metadata#207
nicosuave merged 4 commits into
mainfrom
update-superset-adapter

Conversation

@nicosuave

Copy link
Copy Markdown
Member

What changed

Extends the Apache Superset dataset adapter (sidemantic/adapters/superset.py) to import and export several dataset/column/metric fields that previously had no Sidemantic mapping. Fields without a first-class Sidemantic equivalent are preserved under meta['superset'] so they survive a Superset -> Sidemantic -> Superset roundtrip.

Upstream features now supported

Verified against the Apache Superset v1 dataset import/export schemas (ImportV1DatasetSchema, ImportV1ColumnSchema, ImportV1MetricSchema).

  • Dataset level:
    • catalog - multi-catalog dataset qualifier. Folded into the model's catalog.schema.table reference and preserved in meta.
    • currency_code_column - per-row currency code column for currency formatting.
    • folders - column/metric folder organization (nested {uuid, type, name, description, children}).
  • Column level:
    • advanced_data_type, python_date_format, datetime_format.
  • Metric level:
    • currency ({symbol, symbolPosition}) and warning_text.
    • d3format - mapped to the Sidemantic format field, and also preserved raw for exact roundtrip.

Tests / fixtures

  • New tests/fixtures/superset/multi_catalog_revenue.yaml exercising the 3-part catalog.schema.table qualifier plus all new metadata.
  • New tests/adapters/superset/test_metadata.py covering parse, export, and roundtrip for every new field.
  • Extended tests/fixtures/superset/orders.yaml so the existing roundtrip tests also cover the new fields.

Backward compatibility

Existing behavior is unchanged: 2-part schema.table references, virtual datasets, metric/column type mapping, and all prior fields keep working. Datasets without the new keys produce no extra metadata.

Known limitations

  • currency, warning_text, and the dataset-level catalog/currency_code_column/folders are pass-through metadata (preserved for roundtrip), not interpreted by Sidemantic's query engine.
  • folders reference columns/metrics by name/uuid as authored upstream; the adapter does not validate that referenced members still exist.

Extend the Apache Superset dataset adapter to import/export fields that
previously had no Sidemantic mapping, preserving them under meta['superset']
for roundtrip fidelity:

- Dataset: catalog (multi-catalog qualifier, mapped into catalog.schema.table),
  currency_code_column, folders (column/metric folder organization).
- Column: advanced_data_type, python_date_format, datetime_format.
- Metric: currency ({symbol, symbolPosition}), d3format (also mapped to the
  Sidemantic format field), warning_text.

Adds a multi_catalog_revenue fixture and a dedicated metadata test module, and
extends the orders fixture to exercise the new fields through roundtrip.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 595f0cc691

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread sidemantic/adapters/superset.py
When a dataset has a catalog but null schema, the two-part catalog.table
reference was re-emitted with the catalog copied into schema, producing
cat.cat.table on the next parse. Treat a preserved catalog with a two-part
reference as catalog.table and keep schema null.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 807db72296

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread sidemantic/adapters/superset.py Outdated
Real Superset exports nest currency_code_column under extra rather than
top-level. Parse now reads both locations (preferring top-level) and export
emits it under extra as well, so dynamic currency formatting survives a
Superset -> Sidemantic -> Superset roundtrip.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 68ee626c65

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread sidemantic/adapters/superset.py
@nicosuave nicosuave merged commit 276e3a1 into main Jun 15, 2026
29 of 30 checks passed
@nicosuave nicosuave deleted the update-superset-adapter branch June 15, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant