Skip to content

docs(DEV-1782): add end-to-end Cube import example notebook - #299

Open
ZmeiGorynych wants to merge 2 commits into
mainfrom
egor/dev-1782-add-end-to-end-cube-import-example-notebook-under
Open

docs(DEV-1782): add end-to-end Cube import example notebook#299
ZmeiGorynych wants to merge 2 commits into
mainfrom
egor/dev-1782-add-end-to-end-cube-import-example-notebook-under

Conversation

@ZmeiGorynych

Copy link
Copy Markdown
Member

What

Adds docs/examples/15_cube_import/ — an end-to-end walkthrough of slayer import-cube, following the 13_osi_import pattern (self-contained, fully offline, deterministic DuckDB). Closes DEV-1782.

Contents

  • Sample Cube project (cube_project/):
    • cubes/orders.yml + cubes/customers.yml — table-anchored YAML cubes with a join
    • views/orders_overview.yml — a Cube view → facade model
    • cubes/order_facts.js — a JS sql-mode cube using FILTER_PARAMS: a required category pushdown (meta.required) and an optional region pushdown, both list-valued (col IN ({var}))
  • cube_import_nb.ipynb — shows the configs → runs the real slayer import-cube CLI → inspects the generated models (the Variables: category (required), region skeleton line and meta.cube_variables) → queries the view and the inferred join, then demonstrates every FILTER_PARAMS behavior: optional-block collapse to (1=1), scalar→one-element-list coercion, and the required-omitted raise. Every answer is checked against gold SQL.
  • cube_import.md — paired prose page, cross-linking the Cube reference and Variable Substitution.
  • setup_cube.py — deterministic DuckDB + import (CLI & library) + gold helpers, modeled on setup_osi.py.
  • Nav entry in zensical.toml, a back-link from docs/cube/cube_import.md, and a .gitignore line for the generated .cache/.

Tests

  • New non-integration tests/test_cube_import_example.py (16 tests) guards the sample configs + helper in the default suite: variable contract, list_valued markers, optional-block collapse, scalar coercion, required-omitted + empty-list raises, the view/join numbers, and the real CLI's persisted report/models. Gold values are also pinned independently so a coordinated seed+gold mistake can't pass.
  • The notebook is auto-discovered by the existing tests/integration/test_notebooks.py glob harness and executes top-to-bottom (verified: pytest -m integration -k 15_cube_import → 1 passed).
  • Full pytest -m "not integration" suite green (7912 passed); ruff clean.

New docs/examples/15_cube_import/ walking through `slayer import-cube` on a
small jaffle-shop Cube project: YAML cubes + a view + a JS FILTER_PARAMS cube
(required `category`, optional `region`, both list-valued). The notebook runs
the real CLI, inspects the generated models (the `Variables:` skeleton line and
`meta.cube_variables`), and queries them — optional-block collapse to (1=1),
scalar->one-element-list coercion, and the required-omitted raise — checking
every answer against gold SQL.

Adds a paired prose page, a Tutorials nav entry, a back-link from the Cube
reference, and a non-integration test guarding the sample configs + helper.
@linear

linear Bot commented Aug 12, 2026

Copy link
Copy Markdown

DEV-1782

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 24 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: aa357a17-cba2-4661-bf4a-9415bab64d09

📥 Commits

Reviewing files that changed from the base of the PR and between c970ac7 and 29c7048.

📒 Files selected for processing (11)
  • .gitignore
  • docs/cube/cube_import.md
  • docs/examples/15_cube_import/cube_import.md
  • docs/examples/15_cube_import/cube_import_nb.ipynb
  • docs/examples/15_cube_import/cube_project/model/cubes/customers.yml
  • docs/examples/15_cube_import/cube_project/model/cubes/order_facts.js
  • docs/examples/15_cube_import/cube_project/model/cubes/orders.yml
  • docs/examples/15_cube_import/cube_project/model/views/orders_overview.yml
  • docs/examples/15_cube_import/setup_cube.py
  • tests/test_cube_import_example.py
  • zensical.toml

Comment @coderabbitai help to get the list of available commands.

Split composite `assert X and Y` statements in the example test into separate
assertions (python:S9073), and factor the notebook's repeated " gold:" print
label into a small `show()` helper (ipython:S1192).
@sonarqubecloud

Copy link
Copy Markdown

@ZmeiGorynych

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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