docs(DEV-1782): add end-to-end Cube import example notebook - #299
docs(DEV-1782): add end-to-end Cube import example notebook#299ZmeiGorynych wants to merge 2 commits into
Conversation
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.
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 24 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (11)
Comment |
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).
|
|
@coderabbitai review |
|



What
Adds
docs/examples/15_cube_import/— an end-to-end walkthrough ofslayer import-cube, following the13_osi_importpattern (self-contained, fully offline, deterministic DuckDB). Closes DEV-1782.Contents
cube_project/):cubes/orders.yml+cubes/customers.yml— table-anchored YAML cubes with a joinviews/orders_overview.yml— a Cube view → facade modelcubes/order_facts.js— a JS sql-mode cube usingFILTER_PARAMS: a requiredcategorypushdown (meta.required) and an optionalregionpushdown, both list-valued (col IN ({var}))cube_import_nb.ipynb— shows the configs → runs the realslayer import-cubeCLI → inspects the generated models (theVariables: category (required), regionskeleton line andmeta.cube_variables) → queries the view and the inferred join, then demonstrates everyFILTER_PARAMSbehavior: 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 onsetup_osi.py.zensical.toml, a back-link fromdocs/cube/cube_import.md, and a.gitignoreline for the generated.cache/.Tests
tests/test_cube_import_example.py(16 tests) guards the sample configs + helper in the default suite: variable contract,list_valuedmarkers, 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.tests/integration/test_notebooks.pyglob harness and executes top-to-bottom (verified:pytest -m integration -k 15_cube_import→ 1 passed).pytest -m "not integration"suite green (7912 passed);ruffclean.