Skip to content
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

Add a few tests for time granularity parameters #42119

Merged
merged 1 commit into from May 3, 2024

Conversation

bshepherdson
Copy link
Contributor

@bshepherdson bshepherdson commented May 1, 2024

The API/model schemas for dashboard parameters are general enough
that they just work for this new type, which doesn't look very different
from a value parameter right now.

Part of #42118.

Copy link
Contributor Author

bshepherdson commented May 1, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @bshepherdson and the rest of your teammates on Graphite Graphite

@metabase-bot metabase-bot bot added the .Team/QueryProcessor :hammer_and_wrench: label May 1, 2024
@bshepherdson bshepherdson requested a review from a team May 1, 2024 21:02
@bshepherdson bshepherdson force-pushed the qp-parameterize-time-granularity branch from c4416d5 to ba9f1ca Compare May 2, 2024 13:55
@bshepherdson bshepherdson requested a review from camsaul as a code owner May 2, 2024 13:55
@bshepherdson bshepherdson force-pushed the api-test-time-granularity-params branch from 0c071de to 86c597b Compare May 2, 2024 13:55
Copy link
Contributor

@adam-james-v adam-james-v left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, approved, but if you've got a chance, consider:

I think if the temporal parameter should also be usable in a Question context, it's maybe a good idea to add a temporal unit parameter to the card api test too.

For example, maybe you could add a temporal unit parameter to this test (or make a new, small test):

https://github.com/metabase/metabase/blob/master/test/metabase/api/card_test.clj#L174-L185

@bshepherdson
Copy link
Contributor Author

I think if the temporal parameter should also be usable in a Question context, it's maybe a good idea to add a temporal unit parameter to the card api test too.

Temporal parameters only apply to MBQL queries for now. Date truncation and extraction are "spelled" very differently in different databases (eg. DATE_TRUNC('month', some.column) vs. month(some.column) etc.), so it's nontrivial to figure out how the placeholders should work for this.

We want to do it eventually, but it's a stub future milestone and not planned currently.

Base automatically changed from qp-parameterize-time-granularity to master May 2, 2024 21:03
The API/model schemas for dashboard parameters are general enough
that they just work for this new type, which doesn't look very different
from a value parameter right now.
@bshepherdson bshepherdson force-pushed the api-test-time-granularity-params branch from 86c597b to cdb5348 Compare May 2, 2024 21:08
@bshepherdson bshepherdson enabled auto-merge (squash) May 2, 2024 21:08
@bshepherdson bshepherdson added the no-backport Do not backport this PR to any branch label May 3, 2024
@bshepherdson bshepherdson merged commit bf5eb3a into master May 3, 2024
130 of 132 checks passed
@bshepherdson bshepherdson deleted the api-test-time-granularity-params branch May 3, 2024 12:42
Copy link

github-actions bot commented May 3, 2024

@bshepherdson Did you forget to add a milestone to the issue for this PR? When and where should I add a milestone?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-backport Do not backport this PR to any branch .Team/QueryProcessor :hammer_and_wrench:
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants