Skip to content

Add Rill demo with full project export support#32

Merged
nicosuave merged 7 commits intomainfrom
nicosuave/rill-demo
Jan 5, 2026
Merged

Add Rill demo with full project export support#32
nicosuave merged 7 commits intomainfrom
nicosuave/rill-demo

Conversation

@nicosuave
Copy link
Copy Markdown
Member

Summary

  • Add source_uri field to Model for remote data sources (https://, s3://, gs://)
  • Enhance RillAdapter.export() with full_project=True option 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)
  • Add examples/rill_demo/ with adtech data from rill-examples
  • Default dimension type to "categorical" in SidemanticAdapter

Usage

uv run examples/rill_demo/run_demo.py
# Then open http://localhost:9009

The demo:

  1. Loads sidemantic.yaml (adtech model definition)
  2. Exports to a complete Rill project using RillAdapter
  3. Runs Rill Developer in Docker (installs latest version)
  4. Opens dashboard at localhost:9009

- 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
Copy link
Copy Markdown

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

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: 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".

Comment thread sidemantic/adapters/rill.py Outdated
Comment on lines +416 to +418
sql = f"SELECT * FROM {source_name}\n"

output_file = models_dir / f"{model.name}.sql"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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.
@nicosuave nicosuave merged commit 4da16c9 into main Jan 5, 2026
10 checks passed
@nicosuave nicosuave deleted the nicosuave/rill-demo branch January 5, 2026 00: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