fix: pivot v2 charts created before GENERIC_CHART_AXES is enabled (#23731)

This commit is contained in:
Beto Dealmeida
2023-04-25 19:44:50 -07:00
committed by GitHub
parent e8121b1cd2
commit 314987f32d
3 changed files with 34 additions and 1 deletions

View File

@@ -42,7 +42,11 @@ export default function buildQuery(formData: PivotTableQueryFormData) {
isPhysicalColumn(col) &&
formData.time_grain_sqla &&
hasGenericChartAxes &&
formData?.temporal_columns_lookup?.[col]
/* Charts created before `GENERIC_CHART_AXES` is enabled have a different
* form data, with `granularity_sqla` set instead.
*/
(formData?.temporal_columns_lookup?.[col] ||
formData.granularity_sqla === col)
) {
return {
timeGrain: formData.time_grain_sqla,