-
Notifications
You must be signed in to change notification settings - Fork 2.1k
docs: numeric-string REST API contract and switch-dimension pre-agg matching #11422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -98,11 +98,12 @@ Example response: | |||||||||
|
|
||||||||||
| <Warning> | ||||||||||
|
|
||||||||||
| Currently all fetched numericals are returned in the same format as driver | ||||||||||
| returns it without any additional processing. Most of drivers return numerical | ||||||||||
| values as strings instead of javascript integer or float to ensure there's no | ||||||||||
| loss of significance. Client code should take care of parsing such numerical | ||||||||||
| values. | ||||||||||
| All numeric values in the response (e.g., `"700"` in the example above) are | ||||||||||
| serialized as JSON strings, regardless of the data source driver. This | ||||||||||
| guarantees a consistent response contract across all drivers and avoids loss | ||||||||||
| of significance for large numbers. Client code should parse numeric strings | ||||||||||
| into the appropriate type; the `castNumerics` option in the | ||||||||||
| [JavaScript SDKs][ref-cast-numerics] does this automatically. | ||||||||||
|
Comment on lines
+101
to
+106
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Content is accurate and consistent with Something like: "Since v1.7.0, all numeric values … Before v1.7.0, the format depended on the data source driver." |
||||||||||
|
|
||||||||||
| </Warning> | ||||||||||
|
|
||||||||||
|
|
@@ -529,7 +530,7 @@ This endpoint is part of the [Orchestration API][ref-orchestration-api]. | |||||||||
| ### Triggering jobs | ||||||||||
|
|
||||||||||
| | Parameter | Description | Required | | ||||||||||
| | -------------------------- | -------------------------------------------------------------- | -------- | | ||||||||||
| | -------------------------- | ---------------------------------------------------------------- | -------- | | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unrelated whitespace-only change — the separator row is now 2 chars wider than every other row in the table, so the source no longer lines up (rendering is unaffected). Worth reverting to keep the diff to the two intended edits.
Suggested change
|
||||||||||
| | `action` | Use `post` to trigger jobs | ✅ | | ||||||||||
| | `selector.contexts` | Array of objects, each containing a `securityContext` | ✅ | | ||||||||||
| | `selector.timezones` | Array of timezones | ✅ | | ||||||||||
|
|
@@ -1003,7 +1004,9 @@ entities before `offset` and `limit` are applied: | |||||||||
| "type": "string", | ||||||||||
| "sql": "${CUBE}.status", | ||||||||||
| "is_primary_key": false, | ||||||||||
| "member_references": [], | ||||||||||
| "member_references": [ | ||||||||||
| { "cube": "orders", "member": "status" } | ||||||||||
| ], | ||||||||||
|
Comment on lines
+1007
to
+1009
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This edit looks incorrect, and it's outside the PR's stated scope (the description says the only changes are the numeric warning and the pre-agg note). In this part of the
The populated form belongs to the
Suggested change
|
||||||||||
| "column_references": [ | ||||||||||
| { | ||||||||||
| "data_source": "default", | ||||||||||
|
|
@@ -1178,3 +1181,4 @@ Keep-Alive: timeout=5 | |||||||||
| [link-tzdb]: https://en.wikipedia.org/wiki/Tz_database | ||||||||||
| [ref-control-plane-api]: /reference/control-plane-api | ||||||||||
| [self-metadata-api]: #metadata-api | ||||||||||
| [ref-cast-numerics]: /recipes/core-data-api/cast-numerics | ||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -575,6 +575,17 @@ cube(`orders`, { | |||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| </CodeGroup> | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| <Note> | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| [`switch`-type dimensions][ref-switch-dim] don't need to be listed here for a | ||||||||||||||||||||||||||
| query to match this pre-aggregation. Since a `switch` dimension represents a | ||||||||||||||||||||||||||
| predefined set of values rather than stored data, Cube can resolve it from the | ||||||||||||||||||||||||||
| query filter (or the pre-aggregation's built-in dimension enumeration) even | ||||||||||||||||||||||||||
| when it's omitted from the rollup — you no longer need to include it just to | ||||||||||||||||||||||||||
| satisfy matching. | ||||||||||||||||||||||||||
|
Comment on lines
+580
to
+585
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The behavior claim checks out against
Suggested change
|
||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| </Note> | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| ### `time_dimension` | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| The `time_dimension` property can be any [`dimension`][ref-schema-dimensions] of | ||||||||||||||||||||||||||
|
|
@@ -1840,3 +1851,4 @@ cube(`orders`, { | |||||||||||||||||||||||||
| [ref-ref-cubes]: /reference/data-modeling/cube | ||||||||||||||||||||||||||
| [ref-custom-granularity]: /reference/data-modeling/dimensions#granularities | ||||||||||||||||||||||||||
| [ref-env-allow-non-strict]: /reference/configuration/environment-variables#cubejs-pre-aggregations-allow-non-strict-date-range-match | ||||||||||||||||||||||||||
| [ref-switch-dim]: /reference/data-modeling/dimensions#type | ||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This note contradicts the code sample it sits under (lines 174–176), and the sample is the part most readers will copy.
The sample does:
cube data-model create-branch DEPLOYMENT_ID my-branch --dev-mode cube data-model put DEPLOYMENT_ID model/cubes/orders.yml --file orders.yml --branch my-branch cube data-model merge-to-default DEPLOYMENT_ID --branch my-branch -m "add orders cube"But per this note,
--dev-modedoes not createmy-branch— it forksdev-<user>-<hash>, andput"only accept[s] writes to the active dev-mode branch; targeting any other branch is rejected." Soput ... --branch my-branchin the sample is exactly the case the new paragraph says is rejected. A reader following the sample verbatim gets an error, then has to read the<Info>to find out why.Since the note already says
--branchcan be omitted to use the active session, the cleanest fix is to make the sample the working flow and let the note explain the mechanism rather than correct the example:(Separately:
dev-pavel-ab12cd34bakes a real teammate's name into a public docs example — a neutral placeholder likedev-alice-ab12cd34ordev-<user>-<hash>reads better.)I couldn't verify the underlying claims against source — the Cube Cloud CLI that implements
data-model create-branch/dev-modeisn't in this repo (packages/cubejs-cli/srchas no dev-mode command), so this rests on #11351 as cited in the commit message. Worth a maintainer confirming whether--branchis rejected outright or silently redirected, and whether the restriction applies tocommit/pulltoo.Fix this →