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

Timegroup Granularity via Variable: Errors on Quarter #295

Open
jjspratt opened this issue Sep 10, 2024 · 1 comment
Open

Timegroup Granularity via Variable: Errors on Quarter #295

jjspratt opened this issue Sep 10, 2024 · 1 comment
Labels
datasource/Redshift type/bug Something isn't working

Comments

@jjspratt
Copy link

What happened:
Query failure on $__timeGroup(column, $Granularity) when Quarter selected.

Granularity defined as

Week = 1w, Month = 1M, Quarter = 1Q

What you expected to happen:
I expect to see results similar to date_trunc('quarter', column). This is what I experience when selected Week or Month.

How to reproduce it (as minimally and precisely as possible):

  1. create custom variable:
    Week : 1w, Month : 1M, Quarter : 1Q
  2. add a panel
  3. Select Redshift as source
  4. Add following as custom query:
with time as (select GETDATE() as "test")


select 
time.test
,$__timeGroup(time.test, $Granularity)
from time
  1. select 'Table View'
  2. Change variable from Week to Month to Quarter
  3. Upon selecting Quarter see error text:
    Could not apply macros: error parsing interval 1Q

-->

Screenshots

If applicable, add screenshots to help explain your problem.
-->

Anything else we need to know?:

Environment:

  • Grafana version: Cloud
  • Plugin version: 1.18.0
  • OS Grafana is installed on: N/A
  • User OS & Browser: Mac Sonoma 14.5 / Chrome
@njvrzm
Copy link
Contributor

njvrzm commented Sep 13, 2024

This does look like a gap in our plugin sdk. I'll bring this up with the team next week and we'll see about getting it into the backlog. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datasource/Redshift type/bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

2 participants