fix(Jinja): Emit time grain to table charts even if they don't have a temporal column (#32871)

This commit is contained in:
Vitor Avila
2025-03-28 13:48:49 -03:00
committed by GitHub
parent e0ed652ed8
commit ab22bb1878
4 changed files with 80 additions and 104 deletions

View File

@@ -148,14 +148,5 @@ describe('plugin-chart-table', () => {
expect(queries[1].extras?.time_grain_sqla).toEqual(TimeGranularity.MONTH);
expect(queries[1].extras?.where).toEqual("(status IN ('In Process'))");
});
it('should not include time_grain_sqla in extras if temporal colum is not used and keep the rest', () => {
const { queries } = buildQuery(extraQueryFormData);
// Extras in regular query
expect(queries[0].extras?.time_grain_sqla).toBeUndefined();
expect(queries[0].extras?.where).toEqual("(status IN ('In Process'))");
// Extras in summary query
expect(queries[1].extras?.time_grain_sqla).toBeUndefined();
expect(queries[1].extras?.where).toEqual("(status IN ('In Process'))");
});
});
});