mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
fix: Dashboard time grain in Pivot Table (#24665)
This commit is contained in:
committed by
GitHub
parent
a156816064
commit
6e59f11f4c
@@ -30,7 +30,10 @@ import {
|
||||
import { PivotTableQueryFormData } from '../types';
|
||||
|
||||
export default function buildQuery(formData: PivotTableQueryFormData) {
|
||||
const { groupbyColumns = [], groupbyRows = [] } = formData;
|
||||
const { groupbyColumns = [], groupbyRows = [], extra_form_data } = formData;
|
||||
const time_grain_sqla =
|
||||
extra_form_data?.time_grain_sqla || formData.time_grain_sqla;
|
||||
|
||||
// TODO: add deduping of AdhocColumns
|
||||
const columns = Array.from(
|
||||
new Set([
|
||||
@@ -40,7 +43,7 @@ export default function buildQuery(formData: PivotTableQueryFormData) {
|
||||
).map(col => {
|
||||
if (
|
||||
isPhysicalColumn(col) &&
|
||||
formData.time_grain_sqla &&
|
||||
time_grain_sqla &&
|
||||
hasGenericChartAxes &&
|
||||
/* Charts created before `GENERIC_CHART_AXES` is enabled have a different
|
||||
* form data, with `granularity_sqla` set instead.
|
||||
@@ -49,7 +52,7 @@ export default function buildQuery(formData: PivotTableQueryFormData) {
|
||||
formData.granularity_sqla === col)
|
||||
) {
|
||||
return {
|
||||
timeGrain: formData.time_grain_sqla,
|
||||
timeGrain: time_grain_sqla,
|
||||
columnType: 'BASE_AXIS',
|
||||
sqlExpression: col,
|
||||
label: col,
|
||||
|
||||
Reference in New Issue
Block a user