-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fix(api-gateway): Allow querying time dimensions with custom granularity #9068
fix(api-gateway): Allow querying time dimensions with custom granularity #9068
Conversation
Thanks @LFischerstrom 🙌 Honestly, I didn't even know this is possible to query dimensions like this: I feel like we'd at least need a test for this. |
@igorlukanin Ok, it's documented here https://cube.dev/docs/product/apis-integrations/rest-api/query-format It also claims to support custom granularities which I think would rejected by the input validation. |
Yeah, you're right:
And I think you're also right wrt custom granularities. I wonder what is the best fix to that. A wildcard match? I bet @KSDaemon definitely has an opinion on this. |
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.
@LFischerstrom Let's update it like this. So it will support all granularities :)
It would be awesome if you can add a test for querying time dimension with some granulaties. It should not be hard. Have a look at https://github.com/cube-js/cube/blob/master/packages/cubejs-api-gateway/test/index.test.ts#L306-L339 as example. We just need to check that query is allowed by api qateway.
Co-authored-by: Konstantin Burkalev <[email protected]>
Thanks @KSDaemon, will look into adding a tests |
@KSDaemon I'm trying to run the tests locally but it's not working. Are there any instructions that I should follow for setting up the repo to be able to run the tests? |
@LFischerstrom Hi! Hm.... Nothing special is required. What tests are you trying to run? What package? |
@LFischerstrom Try to follow the commands described in https://github.com/cube-js/cube/blob/master/CONTRIBUTING.md#cube-server Probably not all required, but at least:
|
Thanks, I tried to running |
@KSDaemon Alright, the tests pass for me so if you think the new test looks good I think this is ready. |
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.
👍🏻 I think this looks good! @LFischerstrom Thank you for adding the tests!
Check List
It's possible to query time dimensions with granularity as a normal dimension but queries with
quarter
were rejected.