Skip to content

Commit

Permalink
timestamp bug (apache#21130)
Browse files Browse the repository at this point in the history
  • Loading branch information
AAfghahi authored Aug 18, 2022
1 parent 642a0d7 commit 252ceb7
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions superset/models/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1485,11 +1485,16 @@ def get_sqla_query( # pylint: disable=too-many-arguments,too-many-locals,too-ma
# if groupby field/expr equals granularity field/expr
if selected == granularity:
table_col = columns_by_name[selected]
outer = table_col.get_timestamp_expression(
time_grain=time_grain,
label=selected,
template_processor=template_processor,
)
if isinstance(table_col, dict):
outer = self.get_timestamp_expression(
table_col, time_grain, selected, template_processor
)
else:
outer = table_col.get_timestamp_expression(
time_grain=time_grain,
label=selected,
template_processor=template_processor,
)
# if groupby field equals a selected column
elif selected in columns_by_name:
if isinstance(columns_by_name[selected], dict):
Expand Down

0 comments on commit 252ceb7

Please sign in to comment.