refactor(wren-core): cube Phase C cleanup nits#2276
Merged
Conversation
Move the re-export below pub mod cube; to follow the file's convention
of declaring the module first, and narrow cube to pub(crate). External
consumers go through the curated mdl::{cube_query_to_sql, CubeQuery}
surface; secondary DTOs (Granularity, CubeFilter, FilterValue, …) stay
internal until a binding layer needs them. wren-core-py and
wren-core-wasm still build — neither imports the cube DTOs directly.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
resolve_measures now walks the transitive closure of query.measures rather than the cube's full measure list. A cycle among measures the query never references no longer fails an otherwise valid query. Also pre-compute the word-boundary regex per measure name once at the top of resolve_measures and reuse it for both dependency discovery and fixpoint substitution, instead of rebuilding the regex on every call. Adds test_resolve_measures_ignores_unrequested_cycle for the cycle case. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
6 tasks
This was referenced May 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to PR #2265 — addresses the four CodeRabbit nits left unresolved at merge.
Nit 1+2 — tidy cube module exports (
a00143f2)pub use cube::{cube_query_to_sql, CubeQuery}to sit directly belowpub mod cube;to match the file's convention.cubetopub(crate) mod cube;so the curatedmdl::{cube_query_to_sql, CubeQuery}surface is the single canonical path. Secondary DTOs (Granularity,CubeFilter,FilterValue, …) stay internal until a binding layer needs them.wren-core-pyandwren-core-wasmstill compile — neither imports the cube DTOs.Nit 3+4 — scope measure resolution + cache regex (
725e6cb8)resolve_measuresnow walks the transitive closure ofquery.measuresinstead of every measure on the cube. A cycle among unrelated measures no longer fails an otherwise valid query.test_resolve_measures_ignores_unrequested_cyclecovering the cycle case.Test plan
RUST_MIN_STACK=8388608 cargo test --lib --tests --bins— 117 tests pass (33 cube + 84 prior)cargo clippy --all-targets --all-features -- -D warnings— cleancargo fmt --all -- --check— cleancargo check -p wren-core-pyand-p wren-core-wasm— cleanCloses the four CodeRabbit threads on #2265.
🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests
Refactor