cube
cube copied to clipboard
Fix: Update CubeValidator.js to fix Quarter preaggregation & Updated Query Format Docs
Check List
- [X] Tests has been run in packages where changes made if available
- [X] Linter has been run for changed code
- [X] Tests for the changes have been added if not covered yet
- [X] Docs have been added / updated if required
Issue Reference this PR resolves
#3411
Hey @PieterVanZyl-Dev ! Thanks for contributing it! Would really appreciate it if you add a test query in https://github.com/cube-js/cube.js/blob/master/packages/cubejs-testing/test/pre-aggregations-test-case.ts.
@paveltiunov I have added a test case for this, I don't know if one will suffice or if I should add 3 (test quarter for mixed and with dimension as well)
@PieterVanZyl-Dev Great! I guess it'd be beneficial to add also pre-aggregation with quarter granularity to the fixture schema.
Codecov Report
Patch coverage: 100.00
% and no project coverage change
Comparison is base (
2769200
) 42.49% compared to head (e9bba00
) 42.49%.
Additional details and impacted files
@@ Coverage Diff @@
## master #3415 +/- ##
=======================================
Coverage 42.49% 42.49%
=======================================
Files 153 153
Lines 20175 20175
Branches 5052 5052
=======================================
Hits 8574 8574
Misses 11284 11284
Partials 317 317
Flag | Coverage Δ | |
---|---|---|
cube-backend | 42.49% <100.00%> (ø) |
Flags with carried forward coverage won't be shown. Click here to find out more.
Impacted Files | Coverage Δ | |
---|---|---|
...bejs-schema-compiler/src/compiler/CubeValidator.js | 96.82% <100.00%> (ø) |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
I'll probably have to pull latest and update
Looks like someone optimized cubeValidator before this PR made it in
(Which was something I wanted to do too)
It's not very DRY to have the same regex in multiple places if you can declare it once
I'll update this tomorrow (my personal PC is currently getting an upgrade)
@paveltiunov @ovr
Please just check this PR when you have a chance
@PieterVanZyl-Dev Seems like the test is failing. Could you please look into it?
@PieterVanZyl-Dev Test is failing because Cube Store lacks quarter granularity support. We'd need to add this support as well.
@PieterVanZyl-Dev Thanks for the fix and help here! Is there anything I (and my company) can help with to move this one forward? Thank you!
@PieterVanZyl-Dev quarter support has arrived to Cube Store. Could you please rebase this PR and remove the angular part. Tests should be passing then.
Great I'll do that on my side later today.
@paveltiunov
● postgresql-cubestore › HTTP Transport › Rolling with Quarter granularity
Error: Internal: This feature is not implemented: Invalid input syntax for type interval: "1 quarter"
147 | }
148 |
> 149 | const error = new RequestError(body.error, body); // TODO error class
| ^
150 | if (callback) {
151 | callback(error);
152 | } else {
at _callee5$ (../cubejs-client-core/src/index.js:149:23)
at tryCatch (../../node_modules/regenerator-runtime/runtime.js:63:40)
at Generator.invoke [as _invoke] (../../node_modules/regenerator-runtime/runtime.js:294:22)
at Generator.next (../../node_modules/regenerator-runtime/runtime.js:119:21)
at asyncGeneratorStep (../../node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
at _next (../../node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
I'm assuming we're waiting for a version bump on cubestore ?
@PieterVanZyl-Dev Yep. Could you please rebase your PR?
Will this PR be merged soon?
Will this PR be merged soon?
It looks like we're waiting for @PieterVanZyl-Dev to rebase...
I also need to use quarter in the trailing of a rolling window. Should it be added here?
rollingWindow.trailing = 1 quarter) does not match regexp: /^(-?\d+) (minute|hour|day|week|month|year)$/
Another bug it may solve is the following:
When you write a pre-aggregation, you pick the granularity of the time dimension. If I pick 'day'
, but want to query my data with granularity 'quarter'
.
This errors happens : error:Error: Internal: This feature is not implemented: Invalid input syntax for type interval: "1 quarter"
@paveltiunov This is blocking me from deploying a quarter feature in production :(
hello team. A strong +1 for this PR, we're looking forward to using this feature and would appreciate updates
Hey @paveltiunov, is there anything I can do to help get this across the finish line? We would really like quarter granularity as well.
Closing this PR due to this: https://github.com/cube-js/cube.js/pull/6285