Skip to content

Commit

Permalink
fix(explore): Fix generic X-axis time grain disappearing (apache#21484)
Browse files Browse the repository at this point in the history
(cherry picked from commit 324e997)
  • Loading branch information
codyml authored and jinghua-qa committed Sep 19, 2022
1 parent 56e15ce commit 6e51d7d
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,12 @@ const time_grain_sqla: SharedControlConfig<'SelectControl'> = {
if (xAxisValue === undefined || isAdhocColumn(xAxisValue)) {
return true;
}
if (isPhysicalColumn(xAxisValue)) {
return !!xAxis?.options?.[xAxisValue]?.is_dttm;
if (isPhysicalColumn(xAxisValue) && Array.isArray(xAxis?.options)) {
for (let i = 0; i < xAxis.options.length; i += 1) {
if (xAxis.options[i].column_name === xAxisValue) {
return !!xAxis.options[i].is_dttm;
}
}
}
return false;
},
Expand Down

0 comments on commit 6e51d7d

Please sign in to comment.