Skip to content

Commit

Permalink
fix(charts): Time grain is None when dataset uses Jinja
Browse files Browse the repository at this point in the history
- Fix tests
  • Loading branch information
Antonio-RiveroMartnez committed Nov 2, 2023
1 parent c18d298 commit d2fdb05
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ describe('GENERIC_CHART_AXES is disabled', () => {
datasource: '5__table',
viz_type: 'table',
granularity: 'time_column',
extras: {},
extras: {
time_grain_sqla: 'P1Y',
},
time_range: '1 year ago : 2013',
orderby: [['count(*)', true]],
columns: [
Expand Down Expand Up @@ -182,7 +184,7 @@ describe('GENERIC_CHART_AXES is enabled', () => {
datasource: '5__table',
viz_type: 'table',
granularity: 'time_column',
extras: { where: '', having: '' },
extras: { where: '', having: '', time_grain_sqla: 'P1Y' },
time_range: '1 year ago : 2013',
orderby: [['count(*)', true]],
columns: [
Expand Down Expand Up @@ -240,7 +242,7 @@ describe('GENERIC_CHART_AXES is enabled', () => {
datasource: '5__table',
viz_type: 'table',
granularity: 'time_column',
extras: { where: '', having: '' },
extras: { where: '', having: '', time_grain_sqla: 'P1Y' },
time_range: '1 year ago : 2013',
orderby: [['count(*)', true]],
columns: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ test('should convert a queryObject with x-axis although FF is disabled', () => {
extras: {
having: '',
where: "(foo in ('a', 'b'))",
time_grain_sqla: 'P1W',
},
applied_time_extras: {},
columns: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ describe('GENERIC_CHART_AXES is enabled', () => {
expect.objectContaining({
granularity: 'time_column',
time_range: '1 year ago : 2013',
extras: { having: '', where: '' },
extras: { having: '', where: '', time_grain_sqla: 'P1Y' },
columns: [
{
columnType: 'BASE_AXIS',
Expand Down Expand Up @@ -209,7 +209,7 @@ describe('GENERIC_CHART_AXES is disabled', () => {
expect.objectContaining({
granularity: 'time_column',
time_range: '1 year ago : 2013',
extras: { having: '', where: '' },
extras: { having: '', where: '', time_grain_sqla: 'P1Y' },
columns: [
{
columnType: 'BASE_AXIS',
Expand Down

0 comments on commit d2fdb05

Please sign in to comment.