@@ -101,36 +101,35 @@ describe('queryObject conversion', () => {
101101
102102 it ( 'should convert queryObject' , ( ) => {
103103 const { queries } = buildQuery ( { ...formData , x_axis : 'time_column' } ) ;
104- expect ( queries [ 0 ] ) . toEqual (
105- expect . objectContaining ( {
106- granularity : 'time_column' ,
107- time_range : '1 year ago : 2013' ,
108- extras : { having : '' , where : '' , time_grain_sqla : 'P1Y' } ,
109- columns : [
110- {
111- columnType : 'BASE_AXIS' ,
112- expressionType : 'SQL' ,
113- label : 'time_column' ,
114- sqlExpression : 'time_column' ,
115- timeGrain : 'P1Y' ,
116- } ,
117- 'col1' ,
118- ] ,
119- series_columns : [ 'col1' ] ,
120- metrics : [ 'count(*)' ] ,
121- post_processing : [
122- {
123- operation : 'pivot' ,
124- options : {
125- aggregates : { 'count(*)' : { operator : 'mean' } } ,
126- columns : [ 'col1' ] ,
127- drop_missing_columns : true ,
128- index : [ 'time_column' ] ,
129- } ,
104+ expect ( queries [ 0 ] ) . toMatchObject ( {
105+ granularity : 'time_column' ,
106+ time_range : '1 year ago : 2013' ,
107+ extras : { having : '' , where : '' , time_grain_sqla : 'P1Y' } ,
108+ columns : [
109+ {
110+ columnType : 'BASE_AXIS' ,
111+ expressionType : 'SQL' ,
112+ label : 'time_column' ,
113+ sqlExpression : 'time_column' ,
114+ timeGrain : 'P1Y' ,
115+ isColumnReference : true ,
116+ } ,
117+ 'col1' ,
118+ ] ,
119+ series_columns : [ 'col1' ] ,
120+ metrics : [ 'count(*)' ] ,
121+ post_processing : [
122+ {
123+ operation : 'pivot' ,
124+ options : {
125+ aggregates : { 'count(*)' : { operator : 'mean' } } ,
126+ columns : [ 'col1' ] ,
127+ drop_missing_columns : true ,
128+ index : [ 'time_column' ] ,
130129 } ,
131- { operation : 'flatten' } ,
132- ] ,
133- } ) ,
134- ) ;
130+ } ,
131+ { operation : 'flatten' } ,
132+ ] ,
133+ } ) ;
135134 } ) ;
136135} ) ;
0 commit comments