Skip to content

feat(atscale_sml): support packages, percentile v1.5 fields, and catalog/model metadata#210

Open
nicosuave wants to merge 5 commits into
mainfrom
update-atscale-sml-adapter
Open

feat(atscale_sml): support packages, percentile v1.5 fields, and catalog/model metadata#210
nicosuave wants to merge 5 commits into
mainfrom
update-atscale-sml-adapter

Conversation

@nicosuave

Copy link
Copy Markdown
Member

Summary

Updates the AtScale SML import adapter to cover newer SML spec features that an audit flagged as missing. All changes are conservative additions that preserve existing behavior.

Upstream features now supported

  • package object type (external Git-repo references): standalone package files are recognized and tracked, and a catalog's inline packages list is registered too. Packages carry no semantic models, so they parse cleanly without materializing anything.
  • Percentile compression and custom_quantiles (SML v1.5): custom_quantiles takes precedence over named_quantiles and drives the generated PERCENTILE_CONT(...) WITHIN GROUP (...) SQL (first quantile). Both fields are preserved on the metric's metadata and round-trip on export.
  • Catalog hidden_models (v1.2), description (v1.6), and dataset_properties: parsed without error; referenced models stay importable.
  • Model-level dataset_properties and overrides: parsed without error; metrics, relationships, and aggregates are unaffected.

Notes / limitations

  • package references are tracked but not resolved/fetched (no Git access at parse time); they intentionally produce no models.
  • Catalog description, hidden_models, dataset_properties, and model overrides/dataset_properties have no direct equivalent in the sidemantic graph today, so they are tolerated rather than mapped. Percentile compression and custom_quantiles are preserved via metric metadata.

Tests

  • New fixtures: a package object, a percentile metric with custom_quantiles + compression, and catalog/model fields exercised via the kitchen-sink fixtures.
  • New tests cover parsing of all the above plus an export round-trip for percentile metadata. Existing atscale_sml tests remain green.

…log/model metadata

- Recognize the package object type (external Git-repo references) as
  standalone files and inline catalog packages without breaking parsing
- Parse percentile compression and custom_quantiles (SML v1.5); use the
  first custom quantile to drive PERCENTILE_CONT and preserve both fields
  in metric metadata, with export round-trip
- Tolerate catalog hidden_models (v1.2), description (v1.6), and
  dataset_properties, plus model-level dataset_properties and overrides

@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: e46ae9b2ed

ℹ️ 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/atscale_sml.py
Imported SML v1.5 custom_quantiles percentiles parse to derived metrics
with agg=None and a PERCENTILE_CONT(...) expression, so _export_metric
fell through to _export_metric_calc and dropped custom_quantiles and
compression. Detect these metrics and export them as percentile metric
definitions so the fields round-trip for imported repositories.

@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: fbaf91dc2a

ℹ️ 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/atscale_sml.py Outdated
Named percentile metrics (named_quantiles) carrying compression but no
custom_quantiles import as derived PERCENTILE_CONT metrics with agg=None,
storing compression in metadata only. _export_percentile_metric previously
returned None without custom_quantiles, so export degraded to a metric_calc
and dropped both the percentile shape and compression. Recover the numeric
quantile from the PERCENTILE_CONT expression and re-emit a percentile metric
so the shape and compression round-trip.

@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: 8315736fd5

ℹ️ 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/atscale_sml.py Outdated
The percentile export helpers used .search() against an end-anchored regex,
so a derived metric whose SQL merely contained a percentile sub-expression
(e.g. "1 + PERCENTILE_CONT(...)") matched the suffix and was reclassified as
a plain percentile metric, silently dropping the prefix. Anchor the pattern at
both ends so only a SQL expression that is entirely a percentile is treated as
one; prefixed expressions now correctly export as metric_calc.

@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: 0d05b74475

ℹ️ 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/atscale_sml.py
Canonical SML package files (version + packages list, no object_type or
unique_name, placed in packages/) were silently ignored: only the
single-package shape with a top-level name and inline catalog packages
were registered. Iterate the top-level packages list for package objects
too so each nested reference is tracked.

@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: 37b1574782

ℹ️ 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/atscale_sml.py
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