@@ -256,7 +256,7 @@ describe('STATS Autocomplete', () => {
256256 [
257257 ...getFieldNamesByType ( [ ...ESQL_COMMON_NUMERIC_TYPES , 'date' , 'date_nanos' ] ) ,
258258 ...getFunctionSignaturesByReturnType (
259- Location . EVAL ,
259+ Location . STATS_BY ,
260260 [ 'date' , 'date_nanos' , ...ESQL_COMMON_NUMERIC_TYPES ] ,
261261 {
262262 scalar : true ,
@@ -277,9 +277,9 @@ describe('STATS Autocomplete', () => {
277277 } ) ,
278278 ...getFieldNamesByType ( roundParameterTypes ) ,
279279 ...getFunctionSignaturesByReturnType (
280- Location . EVAL ,
280+ Location . STATS_BY ,
281281 roundParameterTypes ,
282- { scalar : true } ,
282+ { scalar : true , grouping : true } ,
283283 undefined ,
284284 [ 'round' ]
285285 ) ,
@@ -294,9 +294,9 @@ describe('STATS Autocomplete', () => {
294294 } ) ,
295295 ...getFieldNamesByType ( roundParameterTypes ) ,
296296 ...getFunctionSignaturesByReturnType (
297- Location . EVAL ,
297+ Location . STATS_BY ,
298298 ESQL_NUMBER_TYPES ,
299- { scalar : true } ,
299+ { scalar : true , grouping : true } ,
300300 undefined ,
301301 [ 'round' ]
302302 ) ,
@@ -308,9 +308,9 @@ describe('STATS Autocomplete', () => {
308308 [
309309 ...getFieldNamesByType ( roundParameterTypes ) ,
310310 ...getFunctionSignaturesByReturnType (
311- Location . STATS ,
311+ Location . STATS_BY ,
312312 ESQL_NUMBER_TYPES ,
313- { scalar : true } ,
313+ { scalar : true , grouping : true } ,
314314 undefined ,
315315 [ 'round' ]
316316 ) ,
@@ -325,8 +325,9 @@ describe('STATS Autocomplete', () => {
325325 'from a | stats avg(' ,
326326 [
327327 ...expectedFieldsAvg ,
328- ...getFunctionSignaturesByReturnType ( Location . STATS , AVG_TYPES , {
328+ ...getFunctionSignaturesByReturnType ( Location . STATS_BY , AVG_TYPES , {
329329 scalar : true ,
330+ grouping : true ,
330331 } ) ,
331332 ] ,
332333 mockCallbacks
@@ -352,9 +353,9 @@ describe('STATS Autocomplete', () => {
352353 [
353354 ...expectedFieldsAvg ,
354355 ...getFunctionSignaturesByReturnType (
355- Location . EVAL ,
356+ Location . STATS_BY ,
356357 AVG_TYPES ,
357- { scalar : true } ,
358+ { scalar : true , grouping : true } ,
358359 undefined ,
359360 [ 'round' ]
360361 ) ,
@@ -395,6 +396,7 @@ describe('STATS Autocomplete', () => {
395396 ] ,
396397 {
397398 scalar : true ,
399+ grouping : true ,
398400 }
399401 ) ,
400402 ] ;
@@ -414,10 +416,11 @@ describe('STATS Autocomplete', () => {
414416 [
415417 ...getFieldNamesByType ( AVG_TYPES ) ,
416418 ...getFunctionSignaturesByReturnType (
417- Location . EVAL ,
419+ Location . STATS_BY ,
418420 [ ...AVG_TYPES , 'aggregate_metric_double' ] ,
419421 {
420422 scalar : true ,
423+ grouping : true ,
421424 }
422425 ) ,
423426 ] ,
@@ -570,11 +573,6 @@ describe('STATS Autocomplete', () => {
570573 await statsExpectSuggestions ( 'from a | stats a=min(b) by ' , expected ) ;
571574 } ) ;
572575
573- test ( 'no grouping functions as args to scalar function' , async ( ) => {
574- const suggestions = await suggest ( 'FROM a | STATS a=MIN(b) BY ACOS(' ) ;
575- expect ( suggestions . some ( ( s ) => allGroupingFunctions . includes ( s . text ) ) ) . toBe ( false ) ;
576- } ) ;
577-
578576 test ( 'on partial column name' , async ( ) => {
579577 const expected = [
580578 ...allEvalFunctionsForStats ,
0 commit comments