-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
time_grain always return None in jinja #22774
Comments
I think is related with GENERIC_CHART_AXES flag. |
Solved in last version |
closed incorrectly. |
@jordiisidro thanks for raising, I'll take a look next week (feel free to nag me if I don't open a PR before next weekend) |
@villebro did you open a PR for this issue? I have the same problem with latest version for time_grains in Jinja. Thanks |
The same happens to me in version 2.1.0 with from_dttm in the edit chart. It does not happen in the charts contained in the dashboard. |
In my opinion from_dttm works fine both for chart edition and on dasboards. But time grain parameter does not work on any chart. Only on simple Table it looks fine. |
I think is somehow related, I have managed to get time_grain None together with from_dttm None and to_dttm None. |
I am currently having the same problem. For me it seems to be related to the type of charts. For example, for Pivot Tables the |
Yes, this happens when GENERIC_CHART_AXES is enabled.
|
@villebro no, i have the following feature flags enabled.
|
Hi @villebro did you manage to fix this issue? This holds me back from moving from 2.0 to 2.1. Cant wait to start using 2.1. |
This PR(#23652 ) change the default value of GENERIC_CHART_AXES to true. |
Hello, also facing the same problem. |
@villebro did the fix for I have the following feature flags:
|
@villebro Any status on this issue. Currently using Superset 3.0.0rc2 and now GENERIC_CHART_AXES=true is the default this issues still seems to persist. Can confirm it works normally on tables but not on line graphs |
The issue still exists in 3.0.1, as it seems. @villebro, you seemed confident to know what needs to be fixed. Any update on this? |
I create the PR #25429 that fix for the from_dttm return None, but I'm not sure about the time_grain issue. |
Hey, it looks like it does not help for time_grain |
Running the latest dev version of superset - |
Thanks for the update @Vitor-Avila, however it seems it only works for v3.0? |
@stepcheunghk unsure about the version the PR got associated with. @rusackas would you be able to assist determining that? I believe we're also good to close this bug. |
@Vitor-Avila Hey, coincidentally I've just tested this out. Using docker the 3.0.2 version fixed this issue for me while the 3.0.0 hadn't done so beforehand. |
Thanks for the update @mtrentz - sounds like we ca close this one then :) |
A clear and concise description of what the bug is.
How to reproduce the bug
The variable time_grain used in SQL templating is always None
Other variables like from_dttm work fine.
Sample query:
select date_trunc(
{%- if time_grain == 'P1D' -%}
'day'
{%- elif time_grain == 'P1W' -%}
'week'
{%- elif time_grain == 'P1M' -%}
'month'
{%- elif time_grain == 'P3M' -%}
'quarter'
{%- elif time_grain == 'P1Y' -%}
'year'
{%- elif time_grain == 'P1Y' -%}
'year'
{% else %}
'month'
{%- endif -%}
, data) as data
, tecnologia, proveidor, count(distinct id_ticket) as incidencies
from inc_pet i
where {% if from_dttm is not none %}
i.data >= '{{ from_dttm }}' AND
{% endif %}
{% if to_dttm is not none %}
i.data < '{{ to_dttm }}' AND
{% endif %}
1=1
group by date_trunc(
{%- if time_grain == 'P1D' -%}
'day'
{%- elif time_grain == 'P1W' -%}
'week'
{%- elif time_grain == 'P1M' -%}
'month'
{%- elif time_grain == 'P3M' -%}
'quarter'
{%- elif time_grain == 'P1Y' -%}
'year'
{%- elif time_grain == 'P1Y' -%}
'year'
{% else %}
'month'
{%- endif -%}
, data)
, tecnologia, proveidor
Expected results
I expect that when Granularity chances the time_grain value changes
Actual results
time_grain always return None
Environment
Checklist
Make sure to follow these steps before submitting your issue - thank you!
The text was updated successfully, but these errors were encountered: