Add Rill demo with full project export support#32
Conversation
- Add source_uri field to Model for remote data sources (https, s3, gs) - Enhance RillAdapter.export() with full_project option to generate: - rill.yaml (project config) - sources/*.yaml (for models with source_uri) - models/*.sql (passthrough SQL) - metrics_views/*.yaml (existing behavior) - Add examples/rill_demo with adtech data from rill-examples - Default dimension type to categorical in SidemanticAdapter
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f86fce3499
ℹ️ 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".
| sql = f"SELECT * FROM {source_name}\n" | ||
|
|
||
| output_file = models_dir / f"{model.name}.sql" |
There was a problem hiding this comment.
Preserve model.sql when generating Rill models
When full_project=True, _export_model_sql always writes SELECT * FROM {source_name} to the model file, so any model that defines a derived sql (filters/joins/CTEs) gets exported as a passthrough table instead of the intended query. In that case, the generated metrics view will reference a model whose logic no longer matches the semantic layer definition, leading to incorrect results for derived models. Consider emitting model.sql when present (falling back to passthrough only when no SQL is provided).
Useful? React with 👍 / 👎.
When a model has a `sql` field defined, use that custom SQL instead of generating a passthrough SELECT * FROM statement. Only fall back to passthrough when no SQL is provided.
Summary
source_urifield to Model for remote data sources (https://, s3://, gs://)RillAdapter.export()withfull_project=Trueoption to generate complete Rill projects:rill.yaml(project config)sources/*.yaml(for models with source_uri)models/*.sql(passthrough SQL)metrics_views/*.yaml(existing behavior)examples/rill_demo/with adtech data from rill-examplesUsage
uv run examples/rill_demo/run_demo.py # Then open http://localhost:9009The demo: