You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
feat: support organizing metrics into folders (#20) (#21)
sigma_data_models.folder() only accepted `columns` - there was no way to
group a table's metrics into folders, so metrics always rendered flat in
the Sigma UI regardless of how many a table had.
- folder.sql: folder() now takes an optional `metrics` param alongside
`columns`.
- table.sql: tracks a `metric_ids` map (parallel to the existing
`column_ids`) while composing frozen metrics, then resolves
folder.metrics against it the same way folder.columns resolves against
column_ids - items end up columns first, then metrics, each in declared
order. An unknown metric reference raises a compiler error at compile
time, mirroring the existing unknown-column folder error.
- Docs: macros/schema.yml and README.md updated for the new `metrics` arg.
- Tests: assert_sigma_spec.sql gets shape assertions for a folder mixing
columns+metrics and a metrics-only folder, plus a new
assert_unknown_folder_metric_rejected negative case (registered in
scripts/run_integration_tests_duckdb.sh).
Verified via ./scripts/run_integration_tests_duckdb.sh - all existing
assertions (including the pinned frozen-id regression guard) plus the
new ones pass.
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>