Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f7134d48dc
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
sidemantic/adapters/atscale_sml.py
Outdated
| relationships.append( | ||
| { | ||
| "unique_name": f"{model.name}_{rel.name}", | ||
| "from": {"dataset": model.name, "join_columns": [join_column]}, | ||
| "to": {"dimension": rel.name, "level": related_key}, |
There was a problem hiding this comment.
Use a dimension level name when exporting relationships
The exported relationship to.level is set to related_key, which falls back to related_model.primary_key when the relationship doesn’t carry an explicit target key. In SML, to.level must reference a dimension level unique_name, but the model’s primary key is not guaranteed to be one of the exported dimension attributes (e.g., many models don’t include the primary key as a dimension). In that case the exported relationship points to a non-existent level and the SML repo is invalid or can’t be joined correctly. Consider resolving the level against related_model.dimensions (e.g., use the dimension attribute that matches rel.primary_key or the join column) and only fall back to primary_key if it’s present in the dimension definition.
Useful? React with 👍 / 👎.
Add an AtScale SML adapter with loader detection and export support. Includes fixtures and kitchen-sink tests that cover core SML constructs and metric variants.