Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var FluxTestPackages = []*ast.Package{&ast.Package{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: nil, }, Files: []*ast.File{&ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 47, }, File: "changes_test.flux", Source: "package promql_test\nimport \"testing\"\nimport \"internal/promql\"\n\noption now = () =>\n\t(2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:53Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:03Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:13Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:23Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:53Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:53:03Z,metric_name2,2,prometheus\r\n,,1,2018-12-18T20:53:13Z,metric_name2,2,prometheus\r\n,,1,2018-12-18T20:53:23Z,metric_name2,2,prometheus\r\n,,2,2018-12-18T20:52:33Z,metric_name3,1,prometheus\r\n,,2,2018-12-18T20:52:43Z,metric_name3,2,prometheus\r\n,,2,2018-12-18T20:52:53Z,metric_name3,3,prometheus\r\n,,2,2018-12-18T20:53:03Z,metric_name3,1,prometheus\r\n,,2,2018-12-18T20:53:13Z,metric_name3,2,prometheus\r\n,,2,2018-12-18T20:53:23Z,metric_name3,3,prometheus\r\n\"\noutData = \"\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_start,_stop,_field,_value,_measurement\r\n,,0,2018-12-01T00:00:00Z,2030-01-01T00:00:00Z,metric_name1,0,prometheus\r\n,,1,2018-12-01T00:00:00Z,2030-01-01T00:00:00Z,metric_name2,1,prometheus\r\n,,2,2018-12-01T00:00:00Z,2030-01-01T00:00:00Z,metric_name3,5,prometheus\r\n\"\nt_changes = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-12-01T00:00:00Z)\n\t\t|> promql.changes())\n\ntest _changes = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_changes})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "changes_test.flux", Source: "now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 5, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 5, }, File: "changes_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "changes_test.flux", Source: "() =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 5, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "changes_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 2, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 6, }, File: "changes_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 3, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "changes_test.flux", Source: "option now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 5, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 31, }, File: "changes_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:53Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:03Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:13Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:23Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:53Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:53:03Z,metric_name2,2,prometheus\r\n,,1,2018-12-18T20:53:13Z,metric_name2,2,prometheus\r\n,,1,2018-12-18T20:53:23Z,metric_name2,2,prometheus\r\n,,2,2018-12-18T20:52:33Z,metric_name3,1,prometheus\r\n,,2,2018-12-18T20:52:43Z,metric_name3,2,prometheus\r\n,,2,2018-12-18T20:52:53Z,metric_name3,3,prometheus\r\n,,2,2018-12-18T20:53:03Z,metric_name3,1,prometheus\r\n,,2,2018-12-18T20:53:13Z,metric_name3,2,prometheus\r\n,,2,2018-12-18T20:53:23Z,metric_name3,3,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "changes_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 31, }, File: "changes_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:53Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:03Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:13Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:23Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:53Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:53:03Z,metric_name2,2,prometheus\r\n,,1,2018-12-18T20:53:13Z,metric_name2,2,prometheus\r\n,,1,2018-12-18T20:53:23Z,metric_name2,2,prometheus\r\n,,2,2018-12-18T20:52:33Z,metric_name3,1,prometheus\r\n,,2,2018-12-18T20:52:43Z,metric_name3,2,prometheus\r\n,,2,2018-12-18T20:52:53Z,metric_name3,3,prometheus\r\n,,2,2018-12-18T20:53:03Z,metric_name3,1,prometheus\r\n,,2,2018-12-18T20:53:13Z,metric_name3,2,prometheus\r\n,,2,2018-12-18T20:53:23Z,metric_name3,3,prometheus\r\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:53Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:03Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:13Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:23Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:53Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:53:03Z,metric_name2,2,prometheus\r\n,,1,2018-12-18T20:53:13Z,metric_name2,2,prometheus\r\n,,1,2018-12-18T20:53:23Z,metric_name2,2,prometheus\r\n,,2,2018-12-18T20:52:33Z,metric_name3,1,prometheus\r\n,,2,2018-12-18T20:52:43Z,metric_name3,2,prometheus\r\n,,2,2018-12-18T20:52:53Z,metric_name3,3,prometheus\r\n,,2,2018-12-18T20:53:03Z,metric_name3,1,prometheus\r\n,,2,2018-12-18T20:53:13Z,metric_name3,2,prometheus\r\n,,2,2018-12-18T20:53:23Z,metric_name3,3,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 40, }, File: "changes_test.flux", Source: "outData = \"\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_start,_stop,_field,_value,_measurement\r\n,,0,2018-12-01T00:00:00Z,2030-01-01T00:00:00Z,metric_name1,0,prometheus\r\n,,1,2018-12-01T00:00:00Z,2030-01-01T00:00:00Z,metric_name2,1,prometheus\r\n,,2,2018-12-01T00:00:00Z,2030-01-01T00:00:00Z,metric_name3,5,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 32, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 32, }, File: "changes_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 32, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 40, }, File: "changes_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_start,_stop,_field,_value,_measurement\r\n,,0,2018-12-01T00:00:00Z,2030-01-01T00:00:00Z,metric_name1,0,prometheus\r\n,,1,2018-12-01T00:00:00Z,2030-01-01T00:00:00Z,metric_name2,1,prometheus\r\n,,2,2018-12-01T00:00:00Z,2030-01-01T00:00:00Z,metric_name3,5,prometheus\r\n\"", Start: ast.Position{ Column: 11, Line: 32, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_start,_stop,_field,_value,_measurement\r\n,,0,2018-12-01T00:00:00Z,2030-01-01T00:00:00Z,metric_name1,0,prometheus\r\n,,1,2018-12-01T00:00:00Z,2030-01-01T00:00:00Z,metric_name2,1,prometheus\r\n,,2,2018-12-01T00:00:00Z,2030-01-01T00:00:00Z,metric_name3,5,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 44, }, File: "changes_test.flux", Source: "t_changes = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-12-01T00:00:00Z)\n\t\t|> promql.changes())", Start: ast.Position{ Column: 1, Line: 41, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 41, }, File: "changes_test.flux", Source: "t_changes", Start: ast.Position{ Column: 1, Line: 41, }, }, }, Name: "t_changes", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 44, }, File: "changes_test.flux", Source: "(table=<-) =>\n\t(table\n\t\t|> range(start: 2018-12-01T00:00:00Z)\n\t\t|> promql.changes())", Start: ast.Position{ Column: 13, Line: 41, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 44, }, File: "changes_test.flux", Source: "(table\n\t\t|> range(start: 2018-12-01T00:00:00Z)\n\t\t|> promql.changes())", Start: ast.Position{ Column: 2, Line: 42, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 42, }, File: "changes_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 42, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 43, }, File: "changes_test.flux", Source: "table\n\t\t|> range(start: 2018-12-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 42, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 43, }, File: "changes_test.flux", Source: "start: 2018-12-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 43, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 43, }, File: "changes_test.flux", Source: "start: 2018-12-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 43, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 43, }, File: "changes_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 43, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 43, }, File: "changes_test.flux", Source: "2018-12-01T00:00:00Z", Start: ast.Position{ Column: 19, Line: 43, }, }, }, Value: parser.MustParseTime("2018-12-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 43, }, File: "changes_test.flux", Source: "range(start: 2018-12-01T00:00:00Z)", Start: ast.Position{ Column: 6, Line: 43, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 43, }, File: "changes_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 43, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 44, }, File: "changes_test.flux", Source: "table\n\t\t|> range(start: 2018-12-01T00:00:00Z)\n\t\t|> promql.changes()", Start: ast.Position{ Column: 3, Line: 42, }, }, }, Call: &ast.CallExpression{ Arguments: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 44, }, File: "changes_test.flux", Source: "promql.changes()", Start: ast.Position{ Column: 6, Line: 44, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 44, }, File: "changes_test.flux", Source: "promql.changes", Start: ast.Position{ Column: 6, Line: 44, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 44, }, File: "changes_test.flux", Source: "promql", Start: ast.Position{ Column: 6, Line: 44, }, }, }, Name: "promql", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 44, }, File: "changes_test.flux", Source: "changes", Start: ast.Position{ Column: 13, Line: 44, }, }, }, Name: "changes", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 41, }, File: "changes_test.flux", Source: "table=<-", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 41, }, File: "changes_test.flux", Source: "table", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 41, }, File: "changes_test.flux", Source: "<-", Start: ast.Position{ Column: 20, Line: 41, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 47, }, File: "changes_test.flux", Source: "_changes = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_changes})", Start: ast.Position{ Column: 6, Line: 46, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 46, }, File: "changes_test.flux", Source: "_changes", Start: ast.Position{ Column: 6, Line: 46, }, }, }, Name: "_changes", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 47, }, File: "changes_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_changes})", Start: ast.Position{ Column: 17, Line: 46, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 47, }, File: "changes_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_changes})", Start: ast.Position{ Column: 2, Line: 47, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 96, Line: 47, }, File: "changes_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_changes}", Start: ast.Position{ Column: 3, Line: 47, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 47, }, File: "changes_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 47, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 47, }, File: "changes_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 47, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 47, }, File: "changes_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 47, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 47, }, File: "changes_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 47, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 47, }, File: "changes_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 47, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 47, }, File: "changes_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 47, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 47, }, File: "changes_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 47, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 47, }, File: "changes_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 47, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 47, }, File: "changes_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 47, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 47, }, File: "changes_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 47, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 47, }, File: "changes_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 47, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 47, }, File: "changes_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 47, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 47, }, File: "changes_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 47, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 47, }, File: "changes_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 47, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 47, }, File: "changes_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 47, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 47, }, File: "changes_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 47, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 47, }, File: "changes_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 47, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 47, }, File: "changes_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 47, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 47, }, File: "changes_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 47, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 47, }, File: "changes_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 47, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 95, Line: 47, }, File: "changes_test.flux", Source: "fn: t_changes", Start: ast.Position{ Column: 82, Line: 47, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 47, }, File: "changes_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 47, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 95, Line: 47, }, File: "changes_test.flux", Source: "t_changes", Start: ast.Position{ Column: 86, Line: 47, }, }, }, Name: "t_changes", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 47, }, File: "changes_test.flux", Source: "test _changes = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_changes})", Start: ast.Position{ Column: 1, Line: 46, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "changes_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 2, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "changes_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 2, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "changes_test.flux", Source: "import \"internal/promql\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "changes_test.flux", Source: "\"internal/promql\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "internal/promql", }, }}, Metadata: "parser-type=rust", Name: "changes_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "changes_test.flux", Source: "package promql_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "changes_test.flux", Source: "promql_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "promql_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 41, }, File: "dayOfMonth_test.flux", Source: "package promql_test\nimport \"testing\"\nimport \"internal/promql\"\n\noption now = () =>\n\t(2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-01T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-02T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-03T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-29T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-30T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-31T20:00:00Z,metric_name,0,prometheus\r\n\"\noutData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,outData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-01T20:00:00Z,metric_name,1,prometheus\r\n,,0,2018-12-02T20:00:00Z,metric_name,2,prometheus\r\n,,0,2018-12-03T20:00:00Z,metric_name,3,prometheus\r\n,,0,2018-12-29T20:00:00Z,metric_name,29,prometheus\r\n,,0,2018-12-30T20:00:00Z,metric_name,30,prometheus\r\n,,0,2018-12-31T20:00:00Z,metric_name,31,prometheus\r\n\"\nt_promqlDayOfMonth = (table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()\n\t\t|> map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlDayOfMonth(timestamp: r._value)})))\n\ntest _promqlDayOfMonth = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlDayOfMonth})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "dayOfMonth_test.flux", Source: "now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 5, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 5, }, File: "dayOfMonth_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "dayOfMonth_test.flux", Source: "() =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 5, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "dayOfMonth_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 2, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 6, }, File: "dayOfMonth_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 3, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "dayOfMonth_test.flux", Source: "option now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 5, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "dayOfMonth_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-01T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-02T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-03T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-29T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-30T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-31T20:00:00Z,metric_name,0,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "dayOfMonth_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "dayOfMonth_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-01T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-02T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-03T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-29T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-30T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-31T20:00:00Z,metric_name,0,prometheus\r\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-01T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-02T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-03T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-29T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-30T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-31T20:00:00Z,metric_name,0,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 31, }, File: "dayOfMonth_test.flux", Source: "outData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,outData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-01T20:00:00Z,metric_name,1,prometheus\r\n,,0,2018-12-02T20:00:00Z,metric_name,2,prometheus\r\n,,0,2018-12-03T20:00:00Z,metric_name,3,prometheus\r\n,,0,2018-12-29T20:00:00Z,metric_name,29,prometheus\r\n,,0,2018-12-30T20:00:00Z,metric_name,30,prometheus\r\n,,0,2018-12-31T20:00:00Z,metric_name,31,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 20, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 20, }, File: "dayOfMonth_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 20, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 31, }, File: "dayOfMonth_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,outData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-01T20:00:00Z,metric_name,1,prometheus\r\n,,0,2018-12-02T20:00:00Z,metric_name,2,prometheus\r\n,,0,2018-12-03T20:00:00Z,metric_name,3,prometheus\r\n,,0,2018-12-29T20:00:00Z,metric_name,29,prometheus\r\n,,0,2018-12-30T20:00:00Z,metric_name,30,prometheus\r\n,,0,2018-12-31T20:00:00Z,metric_name,31,prometheus\r\n\"", Start: ast.Position{ Column: 11, Line: 20, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,outData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-01T20:00:00Z,metric_name,1,prometheus\r\n,,0,2018-12-02T20:00:00Z,metric_name,2,prometheus\r\n,,0,2018-12-03T20:00:00Z,metric_name,3,prometheus\r\n,,0,2018-12-29T20:00:00Z,metric_name,29,prometheus\r\n,,0,2018-12-30T20:00:00Z,metric_name,30,prometheus\r\n,,0,2018-12-31T20:00:00Z,metric_name,31,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 38, }, File: "dayOfMonth_test.flux", Source: "t_promqlDayOfMonth = (table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()\n\t\t|> map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlDayOfMonth(timestamp: r._value)})))", Start: ast.Position{ Column: 1, Line: 32, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 32, }, File: "dayOfMonth_test.flux", Source: "t_promqlDayOfMonth", Start: ast.Position{ Column: 1, Line: 32, }, }, }, Name: "t_promqlDayOfMonth", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 38, }, File: "dayOfMonth_test.flux", Source: "(table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()\n\t\t|> map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlDayOfMonth(timestamp: r._value)})))", Start: ast.Position{ Column: 22, Line: 32, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 38, }, File: "dayOfMonth_test.flux", Source: "(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()\n\t\t|> map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlDayOfMonth(timestamp: r._value)})))", Start: ast.Position{ Column: 2, Line: 33, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 33, }, File: "dayOfMonth_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 33, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 34, }, File: "dayOfMonth_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 33, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 34, }, File: "dayOfMonth_test.flux", Source: "start: 1980-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 34, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 34, }, File: "dayOfMonth_test.flux", Source: "start: 1980-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 34, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 34, }, File: "dayOfMonth_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 34, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 34, }, File: "dayOfMonth_test.flux", Source: "1980-01-01T00:00:00Z", Start: ast.Position{ Column: 19, Line: 34, }, }, }, Value: parser.MustParseTime("1980-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 34, }, File: "dayOfMonth_test.flux", Source: "range(start: 1980-01-01T00:00:00Z)", Start: ast.Position{ Column: 6, Line: 34, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 34, }, File: "dayOfMonth_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 34, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 35, }, File: "dayOfMonth_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 3, Line: 33, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 35, }, File: "dayOfMonth_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 11, Line: 35, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 35, }, File: "dayOfMonth_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 11, Line: 35, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 35, }, File: "dayOfMonth_test.flux", Source: "columns", Start: ast.Position{ Column: 11, Line: 35, }, }, }, Name: "columns", }, Separator: nil, Value: &ast.ArrayExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 35, }, File: "dayOfMonth_test.flux", Source: "[\"_start\", \"_stop\"]", Start: ast.Position{ Column: 20, Line: 35, }, }, }, Elements: []ast.Expression{&ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 35, }, File: "dayOfMonth_test.flux", Source: "\"_start\"", Start: ast.Position{ Column: 21, Line: 35, }, }, }, Value: "_start", }, &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 38, Line: 35, }, File: "dayOfMonth_test.flux", Source: "\"_stop\"", Start: ast.Position{ Column: 31, Line: 35, }, }, }, Value: "_stop", }}, Lbrack: nil, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 35, }, File: "dayOfMonth_test.flux", Source: "drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 6, Line: 35, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 35, }, File: "dayOfMonth_test.flux", Source: "drop", Start: ast.Position{ Column: 6, Line: 35, }, }, }, Name: "drop", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 36, }, File: "dayOfMonth_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()", Start: ast.Position{ Column: 3, Line: 33, }, }, }, Call: &ast.CallExpression{ Arguments: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 36, }, File: "dayOfMonth_test.flux", Source: "promql.timestamp()", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 36, }, File: "dayOfMonth_test.flux", Source: "promql.timestamp", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 36, }, File: "dayOfMonth_test.flux", Source: "promql", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Name: "promql", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 36, }, File: "dayOfMonth_test.flux", Source: "timestamp", Start: ast.Position{ Column: 13, Line: 36, }, }, }, Name: "timestamp", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 38, }, File: "dayOfMonth_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()\n\t\t|> map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlDayOfMonth(timestamp: r._value)}))", Start: ast.Position{ Column: 3, Line: 33, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 38, }, File: "dayOfMonth_test.flux", Source: "fn: (r) =>\n\t\t\t({r with _value: promql.promqlDayOfMonth(timestamp: r._value)})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 38, }, File: "dayOfMonth_test.flux", Source: "fn: (r) =>\n\t\t\t({r with _value: promql.promqlDayOfMonth(timestamp: r._value)})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 37, }, File: "dayOfMonth_test.flux", Source: "fn", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 38, }, File: "dayOfMonth_test.flux", Source: "(r) =>\n\t\t\t({r with _value: promql.promqlDayOfMonth(timestamp: r._value)})", Start: ast.Position{ Column: 14, Line: 37, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 38, }, File: "dayOfMonth_test.flux", Source: "({r with _value: promql.promqlDayOfMonth(timestamp: r._value)})", Start: ast.Position{ Column: 4, Line: 38, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 38, }, File: "dayOfMonth_test.flux", Source: "{r with _value: promql.promqlDayOfMonth(timestamp: r._value)}", Start: ast.Position{ Column: 5, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 38, }, File: "dayOfMonth_test.flux", Source: "_value: promql.promqlDayOfMonth(timestamp: r._value)", Start: ast.Position{ Column: 13, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 38, }, File: "dayOfMonth_test.flux", Source: "_value", Start: ast.Position{ Column: 13, Line: 38, }, }, }, Name: "_value", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 38, }, File: "dayOfMonth_test.flux", Source: "timestamp: r._value", Start: ast.Position{ Column: 45, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 38, }, File: "dayOfMonth_test.flux", Source: "timestamp: r._value", Start: ast.Position{ Column: 45, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 38, }, File: "dayOfMonth_test.flux", Source: "timestamp", Start: ast.Position{ Column: 45, Line: 38, }, }, }, Name: "timestamp", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 38, }, File: "dayOfMonth_test.flux", Source: "r._value", Start: ast.Position{ Column: 56, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 57, Line: 38, }, File: "dayOfMonth_test.flux", Source: "r", Start: ast.Position{ Column: 56, Line: 38, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 38, }, File: "dayOfMonth_test.flux", Source: "_value", Start: ast.Position{ Column: 58, Line: 38, }, }, }, Name: "_value", }, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 38, }, File: "dayOfMonth_test.flux", Source: "promql.promqlDayOfMonth(timestamp: r._value)", Start: ast.Position{ Column: 21, Line: 38, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 44, Line: 38, }, File: "dayOfMonth_test.flux", Source: "promql.promqlDayOfMonth", Start: ast.Position{ Column: 21, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 38, }, File: "dayOfMonth_test.flux", Source: "promql", Start: ast.Position{ Column: 21, Line: 38, }, }, }, Name: "promql", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 44, Line: 38, }, File: "dayOfMonth_test.flux", Source: "promqlDayOfMonth", Start: ast.Position{ Column: 28, Line: 38, }, }, }, Name: "promqlDayOfMonth", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }}, Rbrace: nil, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 38, }, File: "dayOfMonth_test.flux", Source: "r", Start: ast.Position{ Column: 6, Line: 38, }, }, }, Name: "r", }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "dayOfMonth_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "dayOfMonth_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Name: "r", }, Separator: nil, Value: nil, }}, Rparan: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 38, }, File: "dayOfMonth_test.flux", Source: "map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlDayOfMonth(timestamp: r._value)}))", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 37, }, File: "dayOfMonth_test.flux", Source: "map", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Name: "map", }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 32, }, File: "dayOfMonth_test.flux", Source: "table=<-", Start: ast.Position{ Column: 23, Line: 32, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 32, }, File: "dayOfMonth_test.flux", Source: "table", Start: ast.Position{ Column: 23, Line: 32, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 32, }, File: "dayOfMonth_test.flux", Source: "<-", Start: ast.Position{ Column: 29, Line: 32, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 41, }, File: "dayOfMonth_test.flux", Source: "_promqlDayOfMonth = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlDayOfMonth})", Start: ast.Position{ Column: 6, Line: 40, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 40, }, File: "dayOfMonth_test.flux", Source: "_promqlDayOfMonth", Start: ast.Position{ Column: 6, Line: 40, }, }, }, Name: "_promqlDayOfMonth", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 41, }, File: "dayOfMonth_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlDayOfMonth})", Start: ast.Position{ Column: 26, Line: 40, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 41, }, File: "dayOfMonth_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlDayOfMonth})", Start: ast.Position{ Column: 2, Line: 41, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 41, }, File: "dayOfMonth_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlDayOfMonth}", Start: ast.Position{ Column: 3, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 41, }, File: "dayOfMonth_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 41, }, File: "dayOfMonth_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 41, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 41, }, File: "dayOfMonth_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 41, }, File: "dayOfMonth_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 41, }, File: "dayOfMonth_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 41, }, File: "dayOfMonth_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 41, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 41, }, File: "dayOfMonth_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 41, }, File: "dayOfMonth_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 41, }, File: "dayOfMonth_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 41, }, File: "dayOfMonth_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 41, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 41, }, File: "dayOfMonth_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 41, }, File: "dayOfMonth_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 41, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 41, }, File: "dayOfMonth_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 41, }, File: "dayOfMonth_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 41, }, File: "dayOfMonth_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 41, }, File: "dayOfMonth_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 41, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 41, }, File: "dayOfMonth_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 41, }, File: "dayOfMonth_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 41, }, File: "dayOfMonth_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 41, }, File: "dayOfMonth_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 41, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 41, }, File: "dayOfMonth_test.flux", Source: "fn: t_promqlDayOfMonth", Start: ast.Position{ Column: 82, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 41, }, File: "dayOfMonth_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 41, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 41, }, File: "dayOfMonth_test.flux", Source: "t_promqlDayOfMonth", Start: ast.Position{ Column: 86, Line: 41, }, }, }, Name: "t_promqlDayOfMonth", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 41, }, File: "dayOfMonth_test.flux", Source: "test _promqlDayOfMonth = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlDayOfMonth})", Start: ast.Position{ Column: 1, Line: 40, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "dayOfMonth_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 2, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "dayOfMonth_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 2, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "dayOfMonth_test.flux", Source: "import \"internal/promql\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "dayOfMonth_test.flux", Source: "\"internal/promql\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "internal/promql", }, }}, Metadata: "parser-type=rust", Name: "dayOfMonth_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "dayOfMonth_test.flux", Source: "package promql_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "dayOfMonth_test.flux", Source: "promql_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "promql_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 43, }, File: "dayOfWeek_test.flux", Source: "package promql_test\nimport \"testing\"\nimport \"internal/promql\"\n\noption now = () =>\n\t(2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-03T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-04T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-05T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-06T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-07T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-08T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-09T20:00:00Z,metric_name,0,prometheus\r\n\"\noutData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,outData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-03T20:00:00Z,metric_name,1,prometheus\r\n,,0,2018-12-04T20:00:00Z,metric_name,2,prometheus\r\n,,0,2018-12-05T20:00:00Z,metric_name,3,prometheus\r\n,,0,2018-12-06T20:00:00Z,metric_name,4,prometheus\r\n,,0,2018-12-07T20:00:00Z,metric_name,5,prometheus\r\n,,0,2018-12-08T20:00:00Z,metric_name,6,prometheus\r\n,,0,2018-12-09T20:00:00Z,metric_name,0,prometheus\r\n\"\nt_promqlDayOfWeek = (table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()\n\t\t|> map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlDayOfWeek(timestamp: r._value)})))\n\ntest _promqlDayOfWeek = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlDayOfWeek})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "dayOfWeek_test.flux", Source: "now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 5, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 5, }, File: "dayOfWeek_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "dayOfWeek_test.flux", Source: "() =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 5, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "dayOfWeek_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 2, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 6, }, File: "dayOfWeek_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 3, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "dayOfWeek_test.flux", Source: "option now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 5, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 20, }, File: "dayOfWeek_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-03T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-04T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-05T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-06T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-07T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-08T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-09T20:00:00Z,metric_name,0,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "dayOfWeek_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 20, }, File: "dayOfWeek_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-03T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-04T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-05T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-06T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-07T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-08T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-09T20:00:00Z,metric_name,0,prometheus\r\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-03T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-04T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-05T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-06T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-07T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-08T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-09T20:00:00Z,metric_name,0,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 33, }, File: "dayOfWeek_test.flux", Source: "outData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,outData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-03T20:00:00Z,metric_name,1,prometheus\r\n,,0,2018-12-04T20:00:00Z,metric_name,2,prometheus\r\n,,0,2018-12-05T20:00:00Z,metric_name,3,prometheus\r\n,,0,2018-12-06T20:00:00Z,metric_name,4,prometheus\r\n,,0,2018-12-07T20:00:00Z,metric_name,5,prometheus\r\n,,0,2018-12-08T20:00:00Z,metric_name,6,prometheus\r\n,,0,2018-12-09T20:00:00Z,metric_name,0,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 21, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 21, }, File: "dayOfWeek_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 21, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 33, }, File: "dayOfWeek_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,outData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-03T20:00:00Z,metric_name,1,prometheus\r\n,,0,2018-12-04T20:00:00Z,metric_name,2,prometheus\r\n,,0,2018-12-05T20:00:00Z,metric_name,3,prometheus\r\n,,0,2018-12-06T20:00:00Z,metric_name,4,prometheus\r\n,,0,2018-12-07T20:00:00Z,metric_name,5,prometheus\r\n,,0,2018-12-08T20:00:00Z,metric_name,6,prometheus\r\n,,0,2018-12-09T20:00:00Z,metric_name,0,prometheus\r\n\"", Start: ast.Position{ Column: 11, Line: 21, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,outData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-03T20:00:00Z,metric_name,1,prometheus\r\n,,0,2018-12-04T20:00:00Z,metric_name,2,prometheus\r\n,,0,2018-12-05T20:00:00Z,metric_name,3,prometheus\r\n,,0,2018-12-06T20:00:00Z,metric_name,4,prometheus\r\n,,0,2018-12-07T20:00:00Z,metric_name,5,prometheus\r\n,,0,2018-12-08T20:00:00Z,metric_name,6,prometheus\r\n,,0,2018-12-09T20:00:00Z,metric_name,0,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 40, }, File: "dayOfWeek_test.flux", Source: "t_promqlDayOfWeek = (table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()\n\t\t|> map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlDayOfWeek(timestamp: r._value)})))", Start: ast.Position{ Column: 1, Line: 34, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 34, }, File: "dayOfWeek_test.flux", Source: "t_promqlDayOfWeek", Start: ast.Position{ Column: 1, Line: 34, }, }, }, Name: "t_promqlDayOfWeek", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 40, }, File: "dayOfWeek_test.flux", Source: "(table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()\n\t\t|> map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlDayOfWeek(timestamp: r._value)})))", Start: ast.Position{ Column: 21, Line: 34, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 40, }, File: "dayOfWeek_test.flux", Source: "(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()\n\t\t|> map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlDayOfWeek(timestamp: r._value)})))", Start: ast.Position{ Column: 2, Line: 35, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 35, }, File: "dayOfWeek_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 36, }, File: "dayOfWeek_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "dayOfWeek_test.flux", Source: "start: 1980-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "dayOfWeek_test.flux", Source: "start: 1980-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 36, }, File: "dayOfWeek_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 36, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "dayOfWeek_test.flux", Source: "1980-01-01T00:00:00Z", Start: ast.Position{ Column: 19, Line: 36, }, }, }, Value: parser.MustParseTime("1980-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 36, }, File: "dayOfWeek_test.flux", Source: "range(start: 1980-01-01T00:00:00Z)", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 36, }, File: "dayOfWeek_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 37, }, File: "dayOfWeek_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 37, }, File: "dayOfWeek_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 11, Line: 37, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 37, }, File: "dayOfWeek_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 11, Line: 37, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 37, }, File: "dayOfWeek_test.flux", Source: "columns", Start: ast.Position{ Column: 11, Line: 37, }, }, }, Name: "columns", }, Separator: nil, Value: &ast.ArrayExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 37, }, File: "dayOfWeek_test.flux", Source: "[\"_start\", \"_stop\"]", Start: ast.Position{ Column: 20, Line: 37, }, }, }, Elements: []ast.Expression{&ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 37, }, File: "dayOfWeek_test.flux", Source: "\"_start\"", Start: ast.Position{ Column: 21, Line: 37, }, }, }, Value: "_start", }, &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 38, Line: 37, }, File: "dayOfWeek_test.flux", Source: "\"_stop\"", Start: ast.Position{ Column: 31, Line: 37, }, }, }, Value: "_stop", }}, Lbrack: nil, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 37, }, File: "dayOfWeek_test.flux", Source: "drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 37, }, File: "dayOfWeek_test.flux", Source: "drop", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Name: "drop", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 38, }, File: "dayOfWeek_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Call: &ast.CallExpression{ Arguments: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 38, }, File: "dayOfWeek_test.flux", Source: "promql.timestamp()", Start: ast.Position{ Column: 6, Line: 38, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 38, }, File: "dayOfWeek_test.flux", Source: "promql.timestamp", Start: ast.Position{ Column: 6, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 38, }, File: "dayOfWeek_test.flux", Source: "promql", Start: ast.Position{ Column: 6, Line: 38, }, }, }, Name: "promql", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 38, }, File: "dayOfWeek_test.flux", Source: "timestamp", Start: ast.Position{ Column: 13, Line: 38, }, }, }, Name: "timestamp", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 40, }, File: "dayOfWeek_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()\n\t\t|> map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlDayOfWeek(timestamp: r._value)}))", Start: ast.Position{ Column: 3, Line: 35, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "dayOfWeek_test.flux", Source: "fn: (r) =>\n\t\t\t({r with _value: promql.promqlDayOfWeek(timestamp: r._value)})", Start: ast.Position{ Column: 10, Line: 39, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "dayOfWeek_test.flux", Source: "fn: (r) =>\n\t\t\t({r with _value: promql.promqlDayOfWeek(timestamp: r._value)})", Start: ast.Position{ Column: 10, Line: 39, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 39, }, File: "dayOfWeek_test.flux", Source: "fn", Start: ast.Position{ Column: 10, Line: 39, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "dayOfWeek_test.flux", Source: "(r) =>\n\t\t\t({r with _value: promql.promqlDayOfWeek(timestamp: r._value)})", Start: ast.Position{ Column: 14, Line: 39, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "dayOfWeek_test.flux", Source: "({r with _value: promql.promqlDayOfWeek(timestamp: r._value)})", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 40, }, File: "dayOfWeek_test.flux", Source: "{r with _value: promql.promqlDayOfWeek(timestamp: r._value)}", Start: ast.Position{ Column: 5, Line: 40, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 40, }, File: "dayOfWeek_test.flux", Source: "_value: promql.promqlDayOfWeek(timestamp: r._value)", Start: ast.Position{ Column: 13, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 40, }, File: "dayOfWeek_test.flux", Source: "_value", Start: ast.Position{ Column: 13, Line: 40, }, }, }, Name: "_value", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 40, }, File: "dayOfWeek_test.flux", Source: "timestamp: r._value", Start: ast.Position{ Column: 44, Line: 40, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 40, }, File: "dayOfWeek_test.flux", Source: "timestamp: r._value", Start: ast.Position{ Column: 44, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 40, }, File: "dayOfWeek_test.flux", Source: "timestamp", Start: ast.Position{ Column: 44, Line: 40, }, }, }, Name: "timestamp", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 40, }, File: "dayOfWeek_test.flux", Source: "r._value", Start: ast.Position{ Column: 55, Line: 40, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 56, Line: 40, }, File: "dayOfWeek_test.flux", Source: "r", Start: ast.Position{ Column: 55, Line: 40, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 40, }, File: "dayOfWeek_test.flux", Source: "_value", Start: ast.Position{ Column: 57, Line: 40, }, }, }, Name: "_value", }, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 40, }, File: "dayOfWeek_test.flux", Source: "promql.promqlDayOfWeek(timestamp: r._value)", Start: ast.Position{ Column: 21, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "dayOfWeek_test.flux", Source: "promql.promqlDayOfWeek", Start: ast.Position{ Column: 21, Line: 40, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 40, }, File: "dayOfWeek_test.flux", Source: "promql", Start: ast.Position{ Column: 21, Line: 40, }, }, }, Name: "promql", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "dayOfWeek_test.flux", Source: "promqlDayOfWeek", Start: ast.Position{ Column: 28, Line: 40, }, }, }, Name: "promqlDayOfWeek", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }}, Rbrace: nil, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 40, }, File: "dayOfWeek_test.flux", Source: "r", Start: ast.Position{ Column: 6, Line: 40, }, }, }, Name: "r", }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 39, }, File: "dayOfWeek_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 39, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 39, }, File: "dayOfWeek_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 39, }, }, }, Name: "r", }, Separator: nil, Value: nil, }}, Rparan: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 40, }, File: "dayOfWeek_test.flux", Source: "map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlDayOfWeek(timestamp: r._value)}))", Start: ast.Position{ Column: 6, Line: 39, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 39, }, File: "dayOfWeek_test.flux", Source: "map", Start: ast.Position{ Column: 6, Line: 39, }, }, }, Name: "map", }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 34, }, File: "dayOfWeek_test.flux", Source: "table=<-", Start: ast.Position{ Column: 22, Line: 34, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 34, }, File: "dayOfWeek_test.flux", Source: "table", Start: ast.Position{ Column: 22, Line: 34, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 34, }, File: "dayOfWeek_test.flux", Source: "<-", Start: ast.Position{ Column: 28, Line: 34, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 43, }, File: "dayOfWeek_test.flux", Source: "_promqlDayOfWeek = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlDayOfWeek})", Start: ast.Position{ Column: 6, Line: 42, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 42, }, File: "dayOfWeek_test.flux", Source: "_promqlDayOfWeek", Start: ast.Position{ Column: 6, Line: 42, }, }, }, Name: "_promqlDayOfWeek", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 43, }, File: "dayOfWeek_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlDayOfWeek})", Start: ast.Position{ Column: 25, Line: 42, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 43, }, File: "dayOfWeek_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlDayOfWeek})", Start: ast.Position{ Column: 2, Line: 43, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 43, }, File: "dayOfWeek_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlDayOfWeek}", Start: ast.Position{ Column: 3, Line: 43, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 43, }, File: "dayOfWeek_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 43, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 43, }, File: "dayOfWeek_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 43, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 43, }, File: "dayOfWeek_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 43, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 43, }, File: "dayOfWeek_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 43, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 43, }, File: "dayOfWeek_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 43, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 43, }, File: "dayOfWeek_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 43, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 43, }, File: "dayOfWeek_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 43, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 43, }, File: "dayOfWeek_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 43, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 43, }, File: "dayOfWeek_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 43, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 43, }, File: "dayOfWeek_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 43, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 43, }, File: "dayOfWeek_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 43, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 43, }, File: "dayOfWeek_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 43, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 43, }, File: "dayOfWeek_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 43, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 43, }, File: "dayOfWeek_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 43, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 43, }, File: "dayOfWeek_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 43, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 43, }, File: "dayOfWeek_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 43, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 43, }, File: "dayOfWeek_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 43, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 43, }, File: "dayOfWeek_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 43, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 43, }, File: "dayOfWeek_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 43, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 43, }, File: "dayOfWeek_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 43, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 43, }, File: "dayOfWeek_test.flux", Source: "fn: t_promqlDayOfWeek", Start: ast.Position{ Column: 82, Line: 43, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 43, }, File: "dayOfWeek_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 43, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 43, }, File: "dayOfWeek_test.flux", Source: "t_promqlDayOfWeek", Start: ast.Position{ Column: 86, Line: 43, }, }, }, Name: "t_promqlDayOfWeek", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 43, }, File: "dayOfWeek_test.flux", Source: "test _promqlDayOfWeek = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlDayOfWeek})", Start: ast.Position{ Column: 1, Line: 42, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "dayOfWeek_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 2, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "dayOfWeek_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 2, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "dayOfWeek_test.flux", Source: "import \"internal/promql\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "dayOfWeek_test.flux", Source: "\"internal/promql\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "internal/promql", }, }}, Metadata: "parser-type=rust", Name: "dayOfWeek_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "dayOfWeek_test.flux", Source: "package promql_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "dayOfWeek_test.flux", Source: "promql_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "promql_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 41, }, File: "daysInMonth_test.flux", Source: "package promql_test\nimport \"testing\"\nimport \"internal/promql\"\n\noption now = () =>\n\t(2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-02-04T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-03-05T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-10-06T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-11-07T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-08T20:00:00Z,metric_name,0,prometheus\r\n\"\noutData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,outData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T20:00:00Z,metric_name,31,prometheus\r\n,,0,2018-02-04T20:00:00Z,metric_name,28,prometheus\r\n,,0,2018-03-05T20:00:00Z,metric_name,31,prometheus\r\n,,0,2018-10-06T20:00:00Z,metric_name,31,prometheus\r\n,,0,2018-11-07T20:00:00Z,metric_name,30,prometheus\r\n,,0,2018-12-08T20:00:00Z,metric_name,31,prometheus\r\n\"\nt_promqlDaysInMonth = (table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()\n\t\t|> map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlDaysInMonth(timestamp: r._value)})))\n\ntest _promqlDaysInMonth = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlDaysInMonth})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "daysInMonth_test.flux", Source: "now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 5, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 5, }, File: "daysInMonth_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "daysInMonth_test.flux", Source: "() =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 5, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "daysInMonth_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 2, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 6, }, File: "daysInMonth_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 3, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "daysInMonth_test.flux", Source: "option now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 5, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "daysInMonth_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-02-04T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-03-05T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-10-06T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-11-07T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-08T20:00:00Z,metric_name,0,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "daysInMonth_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "daysInMonth_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-02-04T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-03-05T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-10-06T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-11-07T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-08T20:00:00Z,metric_name,0,prometheus\r\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-02-04T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-03-05T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-10-06T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-11-07T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-08T20:00:00Z,metric_name,0,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 31, }, File: "daysInMonth_test.flux", Source: "outData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,outData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T20:00:00Z,metric_name,31,prometheus\r\n,,0,2018-02-04T20:00:00Z,metric_name,28,prometheus\r\n,,0,2018-03-05T20:00:00Z,metric_name,31,prometheus\r\n,,0,2018-10-06T20:00:00Z,metric_name,31,prometheus\r\n,,0,2018-11-07T20:00:00Z,metric_name,30,prometheus\r\n,,0,2018-12-08T20:00:00Z,metric_name,31,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 20, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 20, }, File: "daysInMonth_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 20, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 31, }, File: "daysInMonth_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,outData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T20:00:00Z,metric_name,31,prometheus\r\n,,0,2018-02-04T20:00:00Z,metric_name,28,prometheus\r\n,,0,2018-03-05T20:00:00Z,metric_name,31,prometheus\r\n,,0,2018-10-06T20:00:00Z,metric_name,31,prometheus\r\n,,0,2018-11-07T20:00:00Z,metric_name,30,prometheus\r\n,,0,2018-12-08T20:00:00Z,metric_name,31,prometheus\r\n\"", Start: ast.Position{ Column: 11, Line: 20, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,outData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T20:00:00Z,metric_name,31,prometheus\r\n,,0,2018-02-04T20:00:00Z,metric_name,28,prometheus\r\n,,0,2018-03-05T20:00:00Z,metric_name,31,prometheus\r\n,,0,2018-10-06T20:00:00Z,metric_name,31,prometheus\r\n,,0,2018-11-07T20:00:00Z,metric_name,30,prometheus\r\n,,0,2018-12-08T20:00:00Z,metric_name,31,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 38, }, File: "daysInMonth_test.flux", Source: "t_promqlDaysInMonth = (table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()\n\t\t|> map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlDaysInMonth(timestamp: r._value)})))", Start: ast.Position{ Column: 1, Line: 32, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 32, }, File: "daysInMonth_test.flux", Source: "t_promqlDaysInMonth", Start: ast.Position{ Column: 1, Line: 32, }, }, }, Name: "t_promqlDaysInMonth", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 38, }, File: "daysInMonth_test.flux", Source: "(table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()\n\t\t|> map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlDaysInMonth(timestamp: r._value)})))", Start: ast.Position{ Column: 23, Line: 32, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 38, }, File: "daysInMonth_test.flux", Source: "(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()\n\t\t|> map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlDaysInMonth(timestamp: r._value)})))", Start: ast.Position{ Column: 2, Line: 33, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 33, }, File: "daysInMonth_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 33, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 34, }, File: "daysInMonth_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 33, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 34, }, File: "daysInMonth_test.flux", Source: "start: 1980-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 34, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 34, }, File: "daysInMonth_test.flux", Source: "start: 1980-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 34, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 34, }, File: "daysInMonth_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 34, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 34, }, File: "daysInMonth_test.flux", Source: "1980-01-01T00:00:00Z", Start: ast.Position{ Column: 19, Line: 34, }, }, }, Value: parser.MustParseTime("1980-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 34, }, File: "daysInMonth_test.flux", Source: "range(start: 1980-01-01T00:00:00Z)", Start: ast.Position{ Column: 6, Line: 34, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 34, }, File: "daysInMonth_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 34, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 35, }, File: "daysInMonth_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 3, Line: 33, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 35, }, File: "daysInMonth_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 11, Line: 35, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 35, }, File: "daysInMonth_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 11, Line: 35, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 35, }, File: "daysInMonth_test.flux", Source: "columns", Start: ast.Position{ Column: 11, Line: 35, }, }, }, Name: "columns", }, Separator: nil, Value: &ast.ArrayExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 35, }, File: "daysInMonth_test.flux", Source: "[\"_start\", \"_stop\"]", Start: ast.Position{ Column: 20, Line: 35, }, }, }, Elements: []ast.Expression{&ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 35, }, File: "daysInMonth_test.flux", Source: "\"_start\"", Start: ast.Position{ Column: 21, Line: 35, }, }, }, Value: "_start", }, &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 38, Line: 35, }, File: "daysInMonth_test.flux", Source: "\"_stop\"", Start: ast.Position{ Column: 31, Line: 35, }, }, }, Value: "_stop", }}, Lbrack: nil, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 35, }, File: "daysInMonth_test.flux", Source: "drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 6, Line: 35, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 35, }, File: "daysInMonth_test.flux", Source: "drop", Start: ast.Position{ Column: 6, Line: 35, }, }, }, Name: "drop", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 36, }, File: "daysInMonth_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()", Start: ast.Position{ Column: 3, Line: 33, }, }, }, Call: &ast.CallExpression{ Arguments: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 36, }, File: "daysInMonth_test.flux", Source: "promql.timestamp()", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 36, }, File: "daysInMonth_test.flux", Source: "promql.timestamp", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 36, }, File: "daysInMonth_test.flux", Source: "promql", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Name: "promql", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 36, }, File: "daysInMonth_test.flux", Source: "timestamp", Start: ast.Position{ Column: 13, Line: 36, }, }, }, Name: "timestamp", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 38, }, File: "daysInMonth_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()\n\t\t|> map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlDaysInMonth(timestamp: r._value)}))", Start: ast.Position{ Column: 3, Line: 33, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 38, }, File: "daysInMonth_test.flux", Source: "fn: (r) =>\n\t\t\t({r with _value: promql.promqlDaysInMonth(timestamp: r._value)})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 38, }, File: "daysInMonth_test.flux", Source: "fn: (r) =>\n\t\t\t({r with _value: promql.promqlDaysInMonth(timestamp: r._value)})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 37, }, File: "daysInMonth_test.flux", Source: "fn", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 38, }, File: "daysInMonth_test.flux", Source: "(r) =>\n\t\t\t({r with _value: promql.promqlDaysInMonth(timestamp: r._value)})", Start: ast.Position{ Column: 14, Line: 37, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 38, }, File: "daysInMonth_test.flux", Source: "({r with _value: promql.promqlDaysInMonth(timestamp: r._value)})", Start: ast.Position{ Column: 4, Line: 38, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 38, }, File: "daysInMonth_test.flux", Source: "{r with _value: promql.promqlDaysInMonth(timestamp: r._value)}", Start: ast.Position{ Column: 5, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 38, }, File: "daysInMonth_test.flux", Source: "_value: promql.promqlDaysInMonth(timestamp: r._value)", Start: ast.Position{ Column: 13, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 38, }, File: "daysInMonth_test.flux", Source: "_value", Start: ast.Position{ Column: 13, Line: 38, }, }, }, Name: "_value", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 38, }, File: "daysInMonth_test.flux", Source: "timestamp: r._value", Start: ast.Position{ Column: 46, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 38, }, File: "daysInMonth_test.flux", Source: "timestamp: r._value", Start: ast.Position{ Column: 46, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 55, Line: 38, }, File: "daysInMonth_test.flux", Source: "timestamp", Start: ast.Position{ Column: 46, Line: 38, }, }, }, Name: "timestamp", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 38, }, File: "daysInMonth_test.flux", Source: "r._value", Start: ast.Position{ Column: 57, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 38, }, File: "daysInMonth_test.flux", Source: "r", Start: ast.Position{ Column: 57, Line: 38, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 38, }, File: "daysInMonth_test.flux", Source: "_value", Start: ast.Position{ Column: 59, Line: 38, }, }, }, Name: "_value", }, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 38, }, File: "daysInMonth_test.flux", Source: "promql.promqlDaysInMonth(timestamp: r._value)", Start: ast.Position{ Column: 21, Line: 38, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 38, }, File: "daysInMonth_test.flux", Source: "promql.promqlDaysInMonth", Start: ast.Position{ Column: 21, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 38, }, File: "daysInMonth_test.flux", Source: "promql", Start: ast.Position{ Column: 21, Line: 38, }, }, }, Name: "promql", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 38, }, File: "daysInMonth_test.flux", Source: "promqlDaysInMonth", Start: ast.Position{ Column: 28, Line: 38, }, }, }, Name: "promqlDaysInMonth", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }}, Rbrace: nil, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 38, }, File: "daysInMonth_test.flux", Source: "r", Start: ast.Position{ Column: 6, Line: 38, }, }, }, Name: "r", }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "daysInMonth_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "daysInMonth_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Name: "r", }, Separator: nil, Value: nil, }}, Rparan: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 38, }, File: "daysInMonth_test.flux", Source: "map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlDaysInMonth(timestamp: r._value)}))", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 37, }, File: "daysInMonth_test.flux", Source: "map", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Name: "map", }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 32, Line: 32, }, File: "daysInMonth_test.flux", Source: "table=<-", Start: ast.Position{ Column: 24, Line: 32, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 32, }, File: "daysInMonth_test.flux", Source: "table", Start: ast.Position{ Column: 24, Line: 32, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 32, Line: 32, }, File: "daysInMonth_test.flux", Source: "<-", Start: ast.Position{ Column: 30, Line: 32, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 41, }, File: "daysInMonth_test.flux", Source: "_promqlDaysInMonth = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlDaysInMonth})", Start: ast.Position{ Column: 6, Line: 40, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 40, }, File: "daysInMonth_test.flux", Source: "_promqlDaysInMonth", Start: ast.Position{ Column: 6, Line: 40, }, }, }, Name: "_promqlDaysInMonth", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 41, }, File: "daysInMonth_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlDaysInMonth})", Start: ast.Position{ Column: 27, Line: 40, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 41, }, File: "daysInMonth_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlDaysInMonth})", Start: ast.Position{ Column: 2, Line: 41, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 41, }, File: "daysInMonth_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlDaysInMonth}", Start: ast.Position{ Column: 3, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 41, }, File: "daysInMonth_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 41, }, File: "daysInMonth_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 41, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 41, }, File: "daysInMonth_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 41, }, File: "daysInMonth_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 41, }, File: "daysInMonth_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 41, }, File: "daysInMonth_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 41, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 41, }, File: "daysInMonth_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 41, }, File: "daysInMonth_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 41, }, File: "daysInMonth_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 41, }, File: "daysInMonth_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 41, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 41, }, File: "daysInMonth_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 41, }, File: "daysInMonth_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 41, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 41, }, File: "daysInMonth_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 41, }, File: "daysInMonth_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 41, }, File: "daysInMonth_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 41, }, File: "daysInMonth_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 41, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 41, }, File: "daysInMonth_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 41, }, File: "daysInMonth_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 41, }, File: "daysInMonth_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 41, }, File: "daysInMonth_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 41, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 41, }, File: "daysInMonth_test.flux", Source: "fn: t_promqlDaysInMonth", Start: ast.Position{ Column: 82, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 41, }, File: "daysInMonth_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 41, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 41, }, File: "daysInMonth_test.flux", Source: "t_promqlDaysInMonth", Start: ast.Position{ Column: 86, Line: 41, }, }, }, Name: "t_promqlDaysInMonth", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 41, }, File: "daysInMonth_test.flux", Source: "test _promqlDaysInMonth = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlDaysInMonth})", Start: ast.Position{ Column: 1, Line: 40, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "daysInMonth_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 2, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "daysInMonth_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 2, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "daysInMonth_test.flux", Source: "import \"internal/promql\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "daysInMonth_test.flux", Source: "\"internal/promql\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "internal/promql", }, }}, Metadata: "parser-type=rust", Name: "daysInMonth_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "daysInMonth_test.flux", Source: "package promql_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "daysInMonth_test.flux", Source: "promql_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "promql_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 18, }, File: "emptyTable_test.flux", Source: "package promql_test\n\nimport \"testing\"\nimport \"internal/promql\"\n\noption now = () => (2030-01-01T00:00:00Z)\n\noutData = \"\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double\n#group,false,true,true,true,false,false\n#default,_result,0,1970-01-01T00:00:00Z,1970-01-01T00:00:00Z,,\n,result,table,_start,_stop,_time,_value\n\"\n\nt_emptyTable = (table=<-) => table\n\ntest _emptyTable = () =>\n\t({input: promql.emptyTable(), want: testing.loadMem(csv: outData), fn: t_emptyTable})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "emptyTable_test.flux", Source: "now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 6, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 6, }, File: "emptyTable_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "emptyTable_test.flux", Source: "() => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 6, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "emptyTable_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 20, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 6, }, File: "emptyTable_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 21, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "emptyTable_test.flux", Source: "option now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 6, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 13, }, File: "emptyTable_test.flux", Source: "outData = \"\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double\n#group,false,true,true,true,false,false\n#default,_result,0,1970-01-01T00:00:00Z,1970-01-01T00:00:00Z,,\n,result,table,_start,_stop,_time,_value\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 8, }, File: "emptyTable_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 13, }, File: "emptyTable_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double\n#group,false,true,true,true,false,false\n#default,_result,0,1970-01-01T00:00:00Z,1970-01-01T00:00:00Z,,\n,result,table,_start,_stop,_time,_value\n\"", Start: ast.Position{ Column: 11, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,dateTime:RFC3339,double\n#group,false,true,true,true,false,false\n#default,_result,0,1970-01-01T00:00:00Z,1970-01-01T00:00:00Z,,\n,result,table,_start,_stop,_time,_value\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 15, }, File: "emptyTable_test.flux", Source: "t_emptyTable = (table=<-) => table", Start: ast.Position{ Column: 1, Line: 15, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 13, Line: 15, }, File: "emptyTable_test.flux", Source: "t_emptyTable", Start: ast.Position{ Column: 1, Line: 15, }, }, }, Name: "t_emptyTable", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 15, }, File: "emptyTable_test.flux", Source: "(table=<-) => table", Start: ast.Position{ Column: 16, Line: 15, }, }, }, Body: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 15, }, File: "emptyTable_test.flux", Source: "table", Start: ast.Position{ Column: 30, Line: 15, }, }, }, Name: "table", }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 15, }, File: "emptyTable_test.flux", Source: "table=<-", Start: ast.Position{ Column: 17, Line: 15, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 15, }, File: "emptyTable_test.flux", Source: "table", Start: ast.Position{ Column: 17, Line: 15, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 15, }, File: "emptyTable_test.flux", Source: "<-", Start: ast.Position{ Column: 23, Line: 15, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 18, }, File: "emptyTable_test.flux", Source: "_emptyTable = () =>\n\t({input: promql.emptyTable(), want: testing.loadMem(csv: outData), fn: t_emptyTable})", Start: ast.Position{ Column: 6, Line: 17, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 17, }, File: "emptyTable_test.flux", Source: "_emptyTable", Start: ast.Position{ Column: 6, Line: 17, }, }, }, Name: "_emptyTable", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 18, }, File: "emptyTable_test.flux", Source: "() =>\n\t({input: promql.emptyTable(), want: testing.loadMem(csv: outData), fn: t_emptyTable})", Start: ast.Position{ Column: 20, Line: 17, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 18, }, File: "emptyTable_test.flux", Source: "({input: promql.emptyTable(), want: testing.loadMem(csv: outData), fn: t_emptyTable})", Start: ast.Position{ Column: 2, Line: 18, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 86, Line: 18, }, File: "emptyTable_test.flux", Source: "{input: promql.emptyTable(), want: testing.loadMem(csv: outData), fn: t_emptyTable}", Start: ast.Position{ Column: 3, Line: 18, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 18, }, File: "emptyTable_test.flux", Source: "input: promql.emptyTable()", Start: ast.Position{ Column: 4, Line: 18, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 18, }, File: "emptyTable_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 18, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 18, }, File: "emptyTable_test.flux", Source: "promql.emptyTable()", Start: ast.Position{ Column: 11, Line: 18, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 18, }, File: "emptyTable_test.flux", Source: "promql.emptyTable", Start: ast.Position{ Column: 11, Line: 18, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 18, }, File: "emptyTable_test.flux", Source: "promql", Start: ast.Position{ Column: 11, Line: 18, }, }, }, Name: "promql", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 18, }, File: "emptyTable_test.flux", Source: "emptyTable", Start: ast.Position{ Column: 18, Line: 18, }, }, }, Name: "emptyTable", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 18, }, File: "emptyTable_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 32, Line: 18, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 18, }, File: "emptyTable_test.flux", Source: "want", Start: ast.Position{ Column: 32, Line: 18, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 18, }, File: "emptyTable_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 54, Line: 18, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 18, }, File: "emptyTable_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 54, Line: 18, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 57, Line: 18, }, File: "emptyTable_test.flux", Source: "csv", Start: ast.Position{ Column: 54, Line: 18, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 18, }, File: "emptyTable_test.flux", Source: "outData", Start: ast.Position{ Column: 59, Line: 18, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 18, }, File: "emptyTable_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 38, Line: 18, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 18, }, File: "emptyTable_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 38, Line: 18, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 18, }, File: "emptyTable_test.flux", Source: "testing", Start: ast.Position{ Column: 38, Line: 18, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 18, }, File: "emptyTable_test.flux", Source: "loadMem", Start: ast.Position{ Column: 46, Line: 18, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 85, Line: 18, }, File: "emptyTable_test.flux", Source: "fn: t_emptyTable", Start: ast.Position{ Column: 69, Line: 18, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 18, }, File: "emptyTable_test.flux", Source: "fn", Start: ast.Position{ Column: 69, Line: 18, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 85, Line: 18, }, File: "emptyTable_test.flux", Source: "t_emptyTable", Start: ast.Position{ Column: 73, Line: 18, }, }, }, Name: "t_emptyTable", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 18, }, File: "emptyTable_test.flux", Source: "test _emptyTable = () =>\n\t({input: promql.emptyTable(), want: testing.loadMem(csv: outData), fn: t_emptyTable})", Start: ast.Position{ Column: 1, Line: 17, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "emptyTable_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "emptyTable_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 4, }, File: "emptyTable_test.flux", Source: "import \"internal/promql\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 4, }, File: "emptyTable_test.flux", Source: "\"internal/promql\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "internal/promql", }, }}, Metadata: "parser-type=rust", Name: "emptyTable_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "emptyTable_test.flux", Source: "package promql_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "emptyTable_test.flux", Source: "promql_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "promql_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 52, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "package promql_test\r\n\r\nimport \"testing\"\r\nimport \"internal/promql\"\r\nimport c \"csv\"\r\n\r\noption now = () =>\r\n\t(2030-01-01T00:00:00Z)\r\n// todo(faith): remove overload https://github.com/influxdata/flux/issues/3155\r\noption testing.loadStorage = (csv) => c.from(csv: csv)\r\n\r\ninData = \"\r\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:53Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:03Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:13Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:23Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:53Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:53:03Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:13Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:23Z,metric_name2,100,prometheus\r\n,,2,2018-12-18T20:52:33Z,metric_name3,100,prometheus\r\n,,2,2018-12-18T20:52:43Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:52:53Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:03Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:53:13Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:23Z,metric_name3,400,prometheus\r\n,,3,2018-12-18T20:52:33Z,metric_name4,100,prometheus\r\n\"\r\noutData = \"\r\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_start,_stop,_field,_value,_measurement\r\n,,0,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name1,0,prometheus\r\n,,1,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name2,0.3663333333333333,prometheus\r\n,,2,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name3,2.533333333333333,prometheus\r\n\"\r\nt_extrapolatedRate = (table=<-) =>\r\n\t(table\r\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)\r\n\t\t|> promql.extrapolatedRate(isCounter: true, isRate: true))\r\n\r\ntest _extrapolatedRate = () =>\r\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_extrapolatedRate})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 8, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "now = () =>\r\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 7, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 7, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 7, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 8, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "() =>\r\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 8, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 2, Line: 8, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 8, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 3, Line: 8, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 8, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "option now = () =>\r\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.OptionStatement{ Assignment: &ast.MemberAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 55, Line: 10, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "testing.loadStorage = (csv) => c.from(csv: csv)", Start: ast.Position{ Column: 8, Line: 10, }, }, }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 55, Line: 10, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "(csv) => c.from(csv: csv)", Start: ast.Position{ Column: 30, Line: 10, }, }, }, Body: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 10, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "csv: csv", Start: ast.Position{ Column: 46, Line: 10, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 10, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "csv: csv", Start: ast.Position{ Column: 46, Line: 10, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 10, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "csv", Start: ast.Position{ Column: 46, Line: 10, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 10, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "csv", Start: ast.Position{ Column: 51, Line: 10, }, }, }, Name: "csv", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 55, Line: 10, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "c.from(csv: csv)", Start: ast.Position{ Column: 39, Line: 10, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 10, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "c.from", Start: ast.Position{ Column: 39, Line: 10, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 10, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "c", Start: ast.Position{ Column: 39, Line: 10, }, }, }, Name: "c", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 10, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "from", Start: ast.Position{ Column: 41, Line: 10, }, }, }, Name: "from", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 10, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 10, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 10, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 10, }, }, }, Name: "csv", }, Separator: nil, Value: nil, }}, Rparan: nil, }, Member: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 10, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 8, Line: 10, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 10, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "testing", Start: ast.Position{ Column: 8, Line: 10, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 10, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 16, Line: 10, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, }, BaseNode: ast.BaseNode{ Comments: []ast.Comment{ast.Comment{Text: "// todo(faith): remove overload https://github.com/influxdata/flux/issues/3155\r\n"}}, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 55, Line: 10, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "option testing.loadStorage = (csv) => c.from(csv: csv)", Start: ast.Position{ Column: 1, Line: 10, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 36, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "inData = \"\r\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:53Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:03Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:13Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:23Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:53Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:53:03Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:13Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:23Z,metric_name2,100,prometheus\r\n,,2,2018-12-18T20:52:33Z,metric_name3,100,prometheus\r\n,,2,2018-12-18T20:52:43Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:52:53Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:03Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:53:13Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:23Z,metric_name3,400,prometheus\r\n,,3,2018-12-18T20:52:33Z,metric_name4,100,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 12, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 12, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 12, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 36, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "\"\r\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:53Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:03Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:13Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:23Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:53Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:53:03Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:13Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:23Z,metric_name2,100,prometheus\r\n,,2,2018-12-18T20:52:33Z,metric_name3,100,prometheus\r\n,,2,2018-12-18T20:52:43Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:52:53Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:03Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:53:13Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:23Z,metric_name3,400,prometheus\r\n,,3,2018-12-18T20:52:33Z,metric_name4,100,prometheus\r\n\"", Start: ast.Position{ Column: 10, Line: 12, }, }, }, Value: "\r\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:53Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:03Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:13Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:23Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:53Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:53:03Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:13Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:23Z,metric_name2,100,prometheus\r\n,,2,2018-12-18T20:52:33Z,metric_name3,100,prometheus\r\n,,2,2018-12-18T20:52:43Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:52:53Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:03Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:53:13Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:23Z,metric_name3,400,prometheus\r\n,,3,2018-12-18T20:52:33Z,metric_name4,100,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 45, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "outData = \"\r\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_start,_stop,_field,_value,_measurement\r\n,,0,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name1,0,prometheus\r\n,,1,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name2,0.3663333333333333,prometheus\r\n,,2,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name3,2.533333333333333,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 37, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 37, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 37, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 45, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "\"\r\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_start,_stop,_field,_value,_measurement\r\n,,0,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name1,0,prometheus\r\n,,1,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name2,0.3663333333333333,prometheus\r\n,,2,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name3,2.533333333333333,prometheus\r\n\"", Start: ast.Position{ Column: 11, Line: 37, }, }, }, Value: "\r\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_start,_stop,_field,_value,_measurement\r\n,,0,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name1,0,prometheus\r\n,,1,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name2,0.3663333333333333,prometheus\r\n,,2,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name3,2.533333333333333,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 49, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "t_extrapolatedRate = (table=<-) =>\r\n\t(table\r\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)\r\n\t\t|> promql.extrapolatedRate(isCounter: true, isRate: true))", Start: ast.Position{ Column: 1, Line: 46, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 46, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "t_extrapolatedRate", Start: ast.Position{ Column: 1, Line: 46, }, }, }, Name: "t_extrapolatedRate", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 49, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "(table=<-) =>\r\n\t(table\r\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)\r\n\t\t|> promql.extrapolatedRate(isCounter: true, isRate: true))", Start: ast.Position{ Column: 22, Line: 46, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 49, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "(table\r\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)\r\n\t\t|> promql.extrapolatedRate(isCounter: true, isRate: true))", Start: ast.Position{ Column: 2, Line: 47, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 47, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 47, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 48, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "table\r\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)", Start: ast.Position{ Column: 3, Line: 47, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 48, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z", Start: ast.Position{ Column: 12, Line: 48, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 48, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "start: 2018-12-18T20:50:00Z", Start: ast.Position{ Column: 12, Line: 48, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 48, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 48, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 48, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "2018-12-18T20:50:00Z", Start: ast.Position{ Column: 19, Line: 48, }, }, }, Value: parser.MustParseTime("2018-12-18T20:50:00Z"), }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 48, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "stop: 2018-12-18T20:55:00Z", Start: ast.Position{ Column: 41, Line: 48, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 48, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "stop", Start: ast.Position{ Column: 41, Line: 48, }, }, }, Name: "stop", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 48, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "2018-12-18T20:55:00Z", Start: ast.Position{ Column: 47, Line: 48, }, }, }, Value: parser.MustParseTime("2018-12-18T20:55:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 48, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)", Start: ast.Position{ Column: 6, Line: 48, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 48, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 48, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 49, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "table\r\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)\r\n\t\t|> promql.extrapolatedRate(isCounter: true, isRate: true)", Start: ast.Position{ Column: 3, Line: 47, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 49, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "isCounter: true, isRate: true", Start: ast.Position{ Column: 30, Line: 49, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 49, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "isCounter: true", Start: ast.Position{ Column: 30, Line: 49, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 49, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "isCounter", Start: ast.Position{ Column: 30, Line: 49, }, }, }, Name: "isCounter", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 49, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "true", Start: ast.Position{ Column: 41, Line: 49, }, }, }, Name: "true", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 49, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "isRate: true", Start: ast.Position{ Column: 47, Line: 49, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 49, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "isRate", Start: ast.Position{ Column: 47, Line: 49, }, }, }, Name: "isRate", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 49, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "true", Start: ast.Position{ Column: 55, Line: 49, }, }, }, Name: "true", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 49, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "promql.extrapolatedRate(isCounter: true, isRate: true)", Start: ast.Position{ Column: 6, Line: 49, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 49, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "promql.extrapolatedRate", Start: ast.Position{ Column: 6, Line: 49, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 49, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "promql", Start: ast.Position{ Column: 6, Line: 49, }, }, }, Name: "promql", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 49, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "extrapolatedRate", Start: ast.Position{ Column: 13, Line: 49, }, }, }, Name: "extrapolatedRate", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 46, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "table=<-", Start: ast.Position{ Column: 23, Line: 46, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 46, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "table", Start: ast.Position{ Column: 23, Line: 46, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 46, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "<-", Start: ast.Position{ Column: 29, Line: 46, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 52, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "_extrapolatedRate = () =>\r\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_extrapolatedRate})", Start: ast.Position{ Column: 6, Line: 51, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 51, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "_extrapolatedRate", Start: ast.Position{ Column: 6, Line: 51, }, }, }, Name: "_extrapolatedRate", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 52, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "() =>\r\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_extrapolatedRate})", Start: ast.Position{ Column: 26, Line: 51, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 52, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_extrapolatedRate})", Start: ast.Position{ Column: 2, Line: 52, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 52, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_extrapolatedRate}", Start: ast.Position{ Column: 3, Line: 52, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 52, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 52, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 52, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 52, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 52, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 52, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 52, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 52, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 52, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 52, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 52, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 52, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 52, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 52, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 52, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 52, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 52, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 52, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 52, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 52, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 52, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 52, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 52, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 52, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 52, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 52, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 52, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 52, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 52, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 52, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 52, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 52, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 52, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 52, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 52, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 52, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 52, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 52, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 52, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 52, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 52, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "fn: t_extrapolatedRate", Start: ast.Position{ Column: 82, Line: 52, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 52, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 52, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 52, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "t_extrapolatedRate", Start: ast.Position{ Column: 86, Line: 52, }, }, }, Name: "t_extrapolatedRate", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 52, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "test _extrapolatedRate = () =>\r\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_extrapolatedRate})", Start: ast.Position{ Column: 1, Line: 51, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 4, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "import \"internal/promql\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 4, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "\"internal/promql\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "internal/promql", }, }, &ast.ImportDeclaration{ As: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 5, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "c", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Name: "c", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 5, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "import c \"csv\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 5, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "\"csv\"", Start: ast.Position{ Column: 10, Line: 5, }, }, }, Value: "csv", }, }}, Metadata: "parser-type=rust", Name: "extrapolatedRate_counter_rate_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "package promql_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "extrapolatedRate_counter_rate_test.flux", Source: "promql_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "promql_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 56, }, File: "extrapolatedRate_nocounter_test.flux", Source: "package promql_test\r\n\r\nimport \"testing\"\r\nimport \"internal/promql\"\r\nimport c \"csv\"\r\n\r\noption now = () =>\r\n\t(2030-01-01T00:00:00Z)\r\n// todo(faith): remove overload https://github.com/influxdata/flux/issues/3155\r\noption testing.loadStorage = (csv) => c.from(csv: csv)\r\n |> map(fn: (r) => ({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n }))\r\n\r\ninData = \"\r\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:53Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:03Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:13Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:23Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:53Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:53:03Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:13Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:23Z,metric_name2,100,prometheus\r\n,,2,2018-12-18T20:52:33Z,metric_name3,100,prometheus\r\n,,2,2018-12-18T20:52:43Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:52:53Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:03Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:53:13Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:23Z,metric_name3,400,prometheus\r\n\"\r\noutData = \"\r\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_start,_stop,_field,_value,_measurement\r\n,,0,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name1,0,prometheus\r\n,,1,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name2,0.39599999999999996,prometheus\r\n,,2,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name3,1.2,prometheus\r\n\"\r\nt_extrapolatedRate = (table=<-) =>\r\n\t(table\r\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)\r\n\t\t|> promql.extrapolatedRate(isCounter: false, isRate: true))\r\n\r\ntest _extrapolatedRate = () =>\r\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_extrapolatedRate})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 8, }, File: "extrapolatedRate_nocounter_test.flux", Source: "now = () =>\r\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 7, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 7, }, File: "extrapolatedRate_nocounter_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 7, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 8, }, File: "extrapolatedRate_nocounter_test.flux", Source: "() =>\r\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 8, }, File: "extrapolatedRate_nocounter_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 2, Line: 8, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 8, }, File: "extrapolatedRate_nocounter_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 3, Line: 8, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 8, }, File: "extrapolatedRate_nocounter_test.flux", Source: "option now = () =>\r\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.OptionStatement{ Assignment: &ast.MemberAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 15, }, File: "extrapolatedRate_nocounter_test.flux", Source: "testing.loadStorage = (csv) => c.from(csv: csv)\r\n |> map(fn: (r) => ({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n }))", Start: ast.Position{ Column: 8, Line: 10, }, }, }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 15, }, File: "extrapolatedRate_nocounter_test.flux", Source: "(csv) => c.from(csv: csv)\r\n |> map(fn: (r) => ({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n }))", Start: ast.Position{ Column: 30, Line: 10, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 10, }, File: "extrapolatedRate_nocounter_test.flux", Source: "csv: csv", Start: ast.Position{ Column: 46, Line: 10, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 10, }, File: "extrapolatedRate_nocounter_test.flux", Source: "csv: csv", Start: ast.Position{ Column: 46, Line: 10, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 10, }, File: "extrapolatedRate_nocounter_test.flux", Source: "csv", Start: ast.Position{ Column: 46, Line: 10, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 10, }, File: "extrapolatedRate_nocounter_test.flux", Source: "csv", Start: ast.Position{ Column: 51, Line: 10, }, }, }, Name: "csv", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 55, Line: 10, }, File: "extrapolatedRate_nocounter_test.flux", Source: "c.from(csv: csv)", Start: ast.Position{ Column: 39, Line: 10, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 10, }, File: "extrapolatedRate_nocounter_test.flux", Source: "c.from", Start: ast.Position{ Column: 39, Line: 10, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 10, }, File: "extrapolatedRate_nocounter_test.flux", Source: "c", Start: ast.Position{ Column: 39, Line: 10, }, }, }, Name: "c", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 10, }, File: "extrapolatedRate_nocounter_test.flux", Source: "from", Start: ast.Position{ Column: 41, Line: 10, }, }, }, Name: "from", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 15, }, File: "extrapolatedRate_nocounter_test.flux", Source: "c.from(csv: csv)\r\n |> map(fn: (r) => ({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n }))", Start: ast.Position{ Column: 39, Line: 10, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 15, }, File: "extrapolatedRate_nocounter_test.flux", Source: "fn: (r) => ({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n })", Start: ast.Position{ Column: 12, Line: 11, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 15, }, File: "extrapolatedRate_nocounter_test.flux", Source: "fn: (r) => ({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n })", Start: ast.Position{ Column: 12, Line: 11, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 11, }, File: "extrapolatedRate_nocounter_test.flux", Source: "fn", Start: ast.Position{ Column: 12, Line: 11, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 15, }, File: "extrapolatedRate_nocounter_test.flux", Source: "(r) => ({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n })", Start: ast.Position{ Column: 16, Line: 11, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 15, }, File: "extrapolatedRate_nocounter_test.flux", Source: "({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n })", Start: ast.Position{ Column: 23, Line: 11, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 6, Line: 15, }, File: "extrapolatedRate_nocounter_test.flux", Source: "{r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n }", Start: ast.Position{ Column: 24, Line: 11, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 12, }, File: "extrapolatedRate_nocounter_test.flux", Source: "_field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\")", Start: ast.Position{ Column: 5, Line: 12, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 12, }, File: "extrapolatedRate_nocounter_test.flux", Source: "_field", Start: ast.Position{ Column: 5, Line: 12, }, }, }, Name: "_field", }, Separator: nil, Value: &ast.ConditionalExpression{ Alternate: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 12, }, File: "extrapolatedRate_nocounter_test.flux", Source: "msg: \"test input table does not have _field column\"", Start: ast.Position{ Column: 55, Line: 12, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 12, }, File: "extrapolatedRate_nocounter_test.flux", Source: "msg: \"test input table does not have _field column\"", Start: ast.Position{ Column: 55, Line: 12, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 12, }, File: "extrapolatedRate_nocounter_test.flux", Source: "msg", Start: ast.Position{ Column: 55, Line: 12, }, }, }, Name: "msg", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 12, }, File: "extrapolatedRate_nocounter_test.flux", Source: "\"test input table does not have _field column\"", Start: ast.Position{ Column: 60, Line: 12, }, }, }, Value: "test input table does not have _field column", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 12, }, File: "extrapolatedRate_nocounter_test.flux", Source: "die(msg: \"test input table does not have _field column\")", Start: ast.Position{ Column: 51, Line: 12, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 12, }, File: "extrapolatedRate_nocounter_test.flux", Source: "die", Start: ast.Position{ Column: 51, Line: 12, }, }, }, Name: "die", }, Lparen: nil, Rparen: nil, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 12, }, File: "extrapolatedRate_nocounter_test.flux", Source: "if exists r._field then r._field else die(msg: \"test input table does not have _field column\")", Start: ast.Position{ Column: 13, Line: 12, }, }, }, Consequent: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 12, }, File: "extrapolatedRate_nocounter_test.flux", Source: "r._field", Start: ast.Position{ Column: 37, Line: 12, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 38, Line: 12, }, File: "extrapolatedRate_nocounter_test.flux", Source: "r", Start: ast.Position{ Column: 37, Line: 12, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 12, }, File: "extrapolatedRate_nocounter_test.flux", Source: "_field", Start: ast.Position{ Column: 39, Line: 12, }, }, }, Name: "_field", }, Rbrack: nil, }, Test: &ast.UnaryExpression{ Argument: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 12, }, File: "extrapolatedRate_nocounter_test.flux", Source: "r._field", Start: ast.Position{ Column: 23, Line: 12, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 12, }, File: "extrapolatedRate_nocounter_test.flux", Source: "r", Start: ast.Position{ Column: 23, Line: 12, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 12, }, File: "extrapolatedRate_nocounter_test.flux", Source: "_field", Start: ast.Position{ Column: 25, Line: 12, }, }, }, Name: "_field", }, Rbrack: nil, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 12, }, File: "extrapolatedRate_nocounter_test.flux", Source: "exists r._field", Start: ast.Position{ Column: 16, Line: 12, }, }, }, Operator: 14, }, Tk_else: nil, Tk_if: nil, Tk_then: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 131, Line: 13, }, File: "extrapolatedRate_nocounter_test.flux", Source: "_measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\")", Start: ast.Position{ Column: 5, Line: 13, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 13, }, File: "extrapolatedRate_nocounter_test.flux", Source: "_measurement", Start: ast.Position{ Column: 5, Line: 13, }, }, }, Name: "_measurement", }, Separator: nil, Value: &ast.ConditionalExpression{ Alternate: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 130, Line: 13, }, File: "extrapolatedRate_nocounter_test.flux", Source: "msg: \"test input table does not have _measurement column\"", Start: ast.Position{ Column: 73, Line: 13, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 130, Line: 13, }, File: "extrapolatedRate_nocounter_test.flux", Source: "msg: \"test input table does not have _measurement column\"", Start: ast.Position{ Column: 73, Line: 13, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 13, }, File: "extrapolatedRate_nocounter_test.flux", Source: "msg", Start: ast.Position{ Column: 73, Line: 13, }, }, }, Name: "msg", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 130, Line: 13, }, File: "extrapolatedRate_nocounter_test.flux", Source: "\"test input table does not have _measurement column\"", Start: ast.Position{ Column: 78, Line: 13, }, }, }, Value: "test input table does not have _measurement column", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 131, Line: 13, }, File: "extrapolatedRate_nocounter_test.flux", Source: "die(msg: \"test input table does not have _measurement column\")", Start: ast.Position{ Column: 69, Line: 13, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 13, }, File: "extrapolatedRate_nocounter_test.flux", Source: "die", Start: ast.Position{ Column: 69, Line: 13, }, }, }, Name: "die", }, Lparen: nil, Rparen: nil, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 131, Line: 13, }, File: "extrapolatedRate_nocounter_test.flux", Source: "if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\")", Start: ast.Position{ Column: 19, Line: 13, }, }, }, Consequent: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 13, }, File: "extrapolatedRate_nocounter_test.flux", Source: "r._measurement", Start: ast.Position{ Column: 49, Line: 13, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 13, }, File: "extrapolatedRate_nocounter_test.flux", Source: "r", Start: ast.Position{ Column: 49, Line: 13, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 13, }, File: "extrapolatedRate_nocounter_test.flux", Source: "_measurement", Start: ast.Position{ Column: 51, Line: 13, }, }, }, Name: "_measurement", }, Rbrack: nil, }, Test: &ast.UnaryExpression{ Argument: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 13, }, File: "extrapolatedRate_nocounter_test.flux", Source: "r._measurement", Start: ast.Position{ Column: 29, Line: 13, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 13, }, File: "extrapolatedRate_nocounter_test.flux", Source: "r", Start: ast.Position{ Column: 29, Line: 13, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 13, }, File: "extrapolatedRate_nocounter_test.flux", Source: "_measurement", Start: ast.Position{ Column: 31, Line: 13, }, }, }, Name: "_measurement", }, Rbrack: nil, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 13, }, File: "extrapolatedRate_nocounter_test.flux", Source: "exists r._measurement", Start: ast.Position{ Column: 22, Line: 13, }, }, }, Operator: 14, }, Tk_else: nil, Tk_if: nil, Tk_then: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 14, }, File: "extrapolatedRate_nocounter_test.flux", Source: "_time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")", Start: ast.Position{ Column: 5, Line: 14, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 14, }, File: "extrapolatedRate_nocounter_test.flux", Source: "_time", Start: ast.Position{ Column: 5, Line: 14, }, }, }, Name: "_time", }, Separator: nil, Value: &ast.ConditionalExpression{ Alternate: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 14, }, File: "extrapolatedRate_nocounter_test.flux", Source: "msg: \"test input table does not have _time column\"", Start: ast.Position{ Column: 52, Line: 14, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 14, }, File: "extrapolatedRate_nocounter_test.flux", Source: "msg: \"test input table does not have _time column\"", Start: ast.Position{ Column: 52, Line: 14, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 55, Line: 14, }, File: "extrapolatedRate_nocounter_test.flux", Source: "msg", Start: ast.Position{ Column: 52, Line: 14, }, }, }, Name: "msg", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 14, }, File: "extrapolatedRate_nocounter_test.flux", Source: "\"test input table does not have _time column\"", Start: ast.Position{ Column: 57, Line: 14, }, }, }, Value: "test input table does not have _time column", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 14, }, File: "extrapolatedRate_nocounter_test.flux", Source: "die(msg: \"test input table does not have _time column\")", Start: ast.Position{ Column: 48, Line: 14, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 51, Line: 14, }, File: "extrapolatedRate_nocounter_test.flux", Source: "die", Start: ast.Position{ Column: 48, Line: 14, }, }, }, Name: "die", }, Lparen: nil, Rparen: nil, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 14, }, File: "extrapolatedRate_nocounter_test.flux", Source: "if exists r._time then r._time else die(msg: \"test input table does not have _time column\")", Start: ast.Position{ Column: 12, Line: 14, }, }, }, Consequent: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 14, }, File: "extrapolatedRate_nocounter_test.flux", Source: "r._time", Start: ast.Position{ Column: 35, Line: 14, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 14, }, File: "extrapolatedRate_nocounter_test.flux", Source: "r", Start: ast.Position{ Column: 35, Line: 14, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 14, }, File: "extrapolatedRate_nocounter_test.flux", Source: "_time", Start: ast.Position{ Column: 37, Line: 14, }, }, }, Name: "_time", }, Rbrack: nil, }, Test: &ast.UnaryExpression{ Argument: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 14, }, File: "extrapolatedRate_nocounter_test.flux", Source: "r._time", Start: ast.Position{ Column: 22, Line: 14, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 14, }, File: "extrapolatedRate_nocounter_test.flux", Source: "r", Start: ast.Position{ Column: 22, Line: 14, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 14, }, File: "extrapolatedRate_nocounter_test.flux", Source: "_time", Start: ast.Position{ Column: 24, Line: 14, }, }, }, Name: "_time", }, Rbrack: nil, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 14, }, File: "extrapolatedRate_nocounter_test.flux", Source: "exists r._time", Start: ast.Position{ Column: 15, Line: 14, }, }, }, Operator: 14, }, Tk_else: nil, Tk_if: nil, Tk_then: nil, }, }}, Rbrace: nil, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 26, Line: 11, }, File: "extrapolatedRate_nocounter_test.flux", Source: "r", Start: ast.Position{ Column: 25, Line: 11, }, }, }, Name: "r", }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 11, }, File: "extrapolatedRate_nocounter_test.flux", Source: "r", Start: ast.Position{ Column: 17, Line: 11, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 11, }, File: "extrapolatedRate_nocounter_test.flux", Source: "r", Start: ast.Position{ Column: 17, Line: 11, }, }, }, Name: "r", }, Separator: nil, Value: nil, }}, Rparan: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 15, }, File: "extrapolatedRate_nocounter_test.flux", Source: "map(fn: (r) => ({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n }))", Start: ast.Position{ Column: 8, Line: 11, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 11, }, File: "extrapolatedRate_nocounter_test.flux", Source: "map", Start: ast.Position{ Column: 8, Line: 11, }, }, }, Name: "map", }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 10, }, File: "extrapolatedRate_nocounter_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 10, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 10, }, File: "extrapolatedRate_nocounter_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 10, }, }, }, Name: "csv", }, Separator: nil, Value: nil, }}, Rparan: nil, }, Member: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 10, }, File: "extrapolatedRate_nocounter_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 8, Line: 10, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 10, }, File: "extrapolatedRate_nocounter_test.flux", Source: "testing", Start: ast.Position{ Column: 8, Line: 10, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 10, }, File: "extrapolatedRate_nocounter_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 16, Line: 10, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, }, BaseNode: ast.BaseNode{ Comments: []ast.Comment{ast.Comment{Text: "// todo(faith): remove overload https://github.com/influxdata/flux/issues/3155\r\n"}}, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 15, }, File: "extrapolatedRate_nocounter_test.flux", Source: "option testing.loadStorage = (csv) => c.from(csv: csv)\r\n |> map(fn: (r) => ({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n }))", Start: ast.Position{ Column: 1, Line: 10, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 40, }, File: "extrapolatedRate_nocounter_test.flux", Source: "inData = \"\r\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:53Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:03Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:13Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:23Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:53Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:53:03Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:13Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:23Z,metric_name2,100,prometheus\r\n,,2,2018-12-18T20:52:33Z,metric_name3,100,prometheus\r\n,,2,2018-12-18T20:52:43Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:52:53Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:03Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:53:13Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:23Z,metric_name3,400,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 17, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 17, }, File: "extrapolatedRate_nocounter_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 17, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 40, }, File: "extrapolatedRate_nocounter_test.flux", Source: "\"\r\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:53Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:03Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:13Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:23Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:53Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:53:03Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:13Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:23Z,metric_name2,100,prometheus\r\n,,2,2018-12-18T20:52:33Z,metric_name3,100,prometheus\r\n,,2,2018-12-18T20:52:43Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:52:53Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:03Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:53:13Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:23Z,metric_name3,400,prometheus\r\n\"", Start: ast.Position{ Column: 10, Line: 17, }, }, }, Value: "\r\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:53Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:03Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:13Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:23Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:53Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:53:03Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:13Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:23Z,metric_name2,100,prometheus\r\n,,2,2018-12-18T20:52:33Z,metric_name3,100,prometheus\r\n,,2,2018-12-18T20:52:43Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:52:53Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:03Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:53:13Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:23Z,metric_name3,400,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 49, }, File: "extrapolatedRate_nocounter_test.flux", Source: "outData = \"\r\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_start,_stop,_field,_value,_measurement\r\n,,0,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name1,0,prometheus\r\n,,1,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name2,0.39599999999999996,prometheus\r\n,,2,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name3,1.2,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 41, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 41, }, File: "extrapolatedRate_nocounter_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 41, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 49, }, File: "extrapolatedRate_nocounter_test.flux", Source: "\"\r\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_start,_stop,_field,_value,_measurement\r\n,,0,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name1,0,prometheus\r\n,,1,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name2,0.39599999999999996,prometheus\r\n,,2,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name3,1.2,prometheus\r\n\"", Start: ast.Position{ Column: 11, Line: 41, }, }, }, Value: "\r\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_start,_stop,_field,_value,_measurement\r\n,,0,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name1,0,prometheus\r\n,,1,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name2,0.39599999999999996,prometheus\r\n,,2,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name3,1.2,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 53, }, File: "extrapolatedRate_nocounter_test.flux", Source: "t_extrapolatedRate = (table=<-) =>\r\n\t(table\r\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)\r\n\t\t|> promql.extrapolatedRate(isCounter: false, isRate: true))", Start: ast.Position{ Column: 1, Line: 50, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 50, }, File: "extrapolatedRate_nocounter_test.flux", Source: "t_extrapolatedRate", Start: ast.Position{ Column: 1, Line: 50, }, }, }, Name: "t_extrapolatedRate", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 53, }, File: "extrapolatedRate_nocounter_test.flux", Source: "(table=<-) =>\r\n\t(table\r\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)\r\n\t\t|> promql.extrapolatedRate(isCounter: false, isRate: true))", Start: ast.Position{ Column: 22, Line: 50, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 53, }, File: "extrapolatedRate_nocounter_test.flux", Source: "(table\r\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)\r\n\t\t|> promql.extrapolatedRate(isCounter: false, isRate: true))", Start: ast.Position{ Column: 2, Line: 51, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 51, }, File: "extrapolatedRate_nocounter_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 51, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 52, }, File: "extrapolatedRate_nocounter_test.flux", Source: "table\r\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)", Start: ast.Position{ Column: 3, Line: 51, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 52, }, File: "extrapolatedRate_nocounter_test.flux", Source: "start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z", Start: ast.Position{ Column: 12, Line: 52, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 52, }, File: "extrapolatedRate_nocounter_test.flux", Source: "start: 2018-12-18T20:50:00Z", Start: ast.Position{ Column: 12, Line: 52, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 52, }, File: "extrapolatedRate_nocounter_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 52, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 52, }, File: "extrapolatedRate_nocounter_test.flux", Source: "2018-12-18T20:50:00Z", Start: ast.Position{ Column: 19, Line: 52, }, }, }, Value: parser.MustParseTime("2018-12-18T20:50:00Z"), }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 52, }, File: "extrapolatedRate_nocounter_test.flux", Source: "stop: 2018-12-18T20:55:00Z", Start: ast.Position{ Column: 41, Line: 52, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 52, }, File: "extrapolatedRate_nocounter_test.flux", Source: "stop", Start: ast.Position{ Column: 41, Line: 52, }, }, }, Name: "stop", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 52, }, File: "extrapolatedRate_nocounter_test.flux", Source: "2018-12-18T20:55:00Z", Start: ast.Position{ Column: 47, Line: 52, }, }, }, Value: parser.MustParseTime("2018-12-18T20:55:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 52, }, File: "extrapolatedRate_nocounter_test.flux", Source: "range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)", Start: ast.Position{ Column: 6, Line: 52, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 52, }, File: "extrapolatedRate_nocounter_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 52, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 53, }, File: "extrapolatedRate_nocounter_test.flux", Source: "table\r\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)\r\n\t\t|> promql.extrapolatedRate(isCounter: false, isRate: true)", Start: ast.Position{ Column: 3, Line: 51, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 53, }, File: "extrapolatedRate_nocounter_test.flux", Source: "isCounter: false, isRate: true", Start: ast.Position{ Column: 30, Line: 53, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 53, }, File: "extrapolatedRate_nocounter_test.flux", Source: "isCounter: false", Start: ast.Position{ Column: 30, Line: 53, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 53, }, File: "extrapolatedRate_nocounter_test.flux", Source: "isCounter", Start: ast.Position{ Column: 30, Line: 53, }, }, }, Name: "isCounter", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 53, }, File: "extrapolatedRate_nocounter_test.flux", Source: "false", Start: ast.Position{ Column: 41, Line: 53, }, }, }, Name: "false", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 53, }, File: "extrapolatedRate_nocounter_test.flux", Source: "isRate: true", Start: ast.Position{ Column: 48, Line: 53, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 53, }, File: "extrapolatedRate_nocounter_test.flux", Source: "isRate", Start: ast.Position{ Column: 48, Line: 53, }, }, }, Name: "isRate", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 53, }, File: "extrapolatedRate_nocounter_test.flux", Source: "true", Start: ast.Position{ Column: 56, Line: 53, }, }, }, Name: "true", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 53, }, File: "extrapolatedRate_nocounter_test.flux", Source: "promql.extrapolatedRate(isCounter: false, isRate: true)", Start: ast.Position{ Column: 6, Line: 53, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 53, }, File: "extrapolatedRate_nocounter_test.flux", Source: "promql.extrapolatedRate", Start: ast.Position{ Column: 6, Line: 53, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 53, }, File: "extrapolatedRate_nocounter_test.flux", Source: "promql", Start: ast.Position{ Column: 6, Line: 53, }, }, }, Name: "promql", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 53, }, File: "extrapolatedRate_nocounter_test.flux", Source: "extrapolatedRate", Start: ast.Position{ Column: 13, Line: 53, }, }, }, Name: "extrapolatedRate", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 50, }, File: "extrapolatedRate_nocounter_test.flux", Source: "table=<-", Start: ast.Position{ Column: 23, Line: 50, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 50, }, File: "extrapolatedRate_nocounter_test.flux", Source: "table", Start: ast.Position{ Column: 23, Line: 50, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 50, }, File: "extrapolatedRate_nocounter_test.flux", Source: "<-", Start: ast.Position{ Column: 29, Line: 50, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 56, }, File: "extrapolatedRate_nocounter_test.flux", Source: "_extrapolatedRate = () =>\r\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_extrapolatedRate})", Start: ast.Position{ Column: 6, Line: 55, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 55, }, File: "extrapolatedRate_nocounter_test.flux", Source: "_extrapolatedRate", Start: ast.Position{ Column: 6, Line: 55, }, }, }, Name: "_extrapolatedRate", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 56, }, File: "extrapolatedRate_nocounter_test.flux", Source: "() =>\r\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_extrapolatedRate})", Start: ast.Position{ Column: 26, Line: 55, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 56, }, File: "extrapolatedRate_nocounter_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_extrapolatedRate})", Start: ast.Position{ Column: 2, Line: 56, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 56, }, File: "extrapolatedRate_nocounter_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_extrapolatedRate}", Start: ast.Position{ Column: 3, Line: 56, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 56, }, File: "extrapolatedRate_nocounter_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 56, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 56, }, File: "extrapolatedRate_nocounter_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 56, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 56, }, File: "extrapolatedRate_nocounter_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 56, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 56, }, File: "extrapolatedRate_nocounter_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 56, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 56, }, File: "extrapolatedRate_nocounter_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 56, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 56, }, File: "extrapolatedRate_nocounter_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 56, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 56, }, File: "extrapolatedRate_nocounter_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 56, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 56, }, File: "extrapolatedRate_nocounter_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 56, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 56, }, File: "extrapolatedRate_nocounter_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 56, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 56, }, File: "extrapolatedRate_nocounter_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 56, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 56, }, File: "extrapolatedRate_nocounter_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 56, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 56, }, File: "extrapolatedRate_nocounter_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 56, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 56, }, File: "extrapolatedRate_nocounter_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 56, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 56, }, File: "extrapolatedRate_nocounter_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 56, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 56, }, File: "extrapolatedRate_nocounter_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 56, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 56, }, File: "extrapolatedRate_nocounter_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 56, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 56, }, File: "extrapolatedRate_nocounter_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 56, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 56, }, File: "extrapolatedRate_nocounter_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 56, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 56, }, File: "extrapolatedRate_nocounter_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 56, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 56, }, File: "extrapolatedRate_nocounter_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 56, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 56, }, File: "extrapolatedRate_nocounter_test.flux", Source: "fn: t_extrapolatedRate", Start: ast.Position{ Column: 82, Line: 56, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 56, }, File: "extrapolatedRate_nocounter_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 56, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 56, }, File: "extrapolatedRate_nocounter_test.flux", Source: "t_extrapolatedRate", Start: ast.Position{ Column: 86, Line: 56, }, }, }, Name: "t_extrapolatedRate", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 56, }, File: "extrapolatedRate_nocounter_test.flux", Source: "test _extrapolatedRate = () =>\r\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_extrapolatedRate})", Start: ast.Position{ Column: 1, Line: 55, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "extrapolatedRate_nocounter_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "extrapolatedRate_nocounter_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 4, }, File: "extrapolatedRate_nocounter_test.flux", Source: "import \"internal/promql\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 4, }, File: "extrapolatedRate_nocounter_test.flux", Source: "\"internal/promql\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "internal/promql", }, }, &ast.ImportDeclaration{ As: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 5, }, File: "extrapolatedRate_nocounter_test.flux", Source: "c", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Name: "c", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 5, }, File: "extrapolatedRate_nocounter_test.flux", Source: "import c \"csv\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 5, }, File: "extrapolatedRate_nocounter_test.flux", Source: "\"csv\"", Start: ast.Position{ Column: 10, Line: 5, }, }, }, Value: "csv", }, }}, Metadata: "parser-type=rust", Name: "extrapolatedRate_nocounter_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "extrapolatedRate_nocounter_test.flux", Source: "package promql_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "extrapolatedRate_nocounter_test.flux", Source: "promql_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "promql_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 56, }, File: "extrapolatedRate_norate_test.flux", Source: "package promql_test\r\n\r\nimport \"testing\"\r\nimport \"internal/promql\"\r\nimport c \"csv\"\r\n\r\noption now = () =>\r\n\t(2030-01-01T00:00:00Z)\r\n// todo(faith): remove overload https://github.com/influxdata/flux/issues/3155\r\noption testing.loadStorage = (csv) => c.from(csv: csv)\r\n |> map(fn: (r) => ({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n }))\r\n\r\ninData = \"\r\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:53Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:03Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:13Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:23Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:53Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:53:03Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:13Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:23Z,metric_name2,100,prometheus\r\n,,2,2018-12-18T20:52:33Z,metric_name3,100,prometheus\r\n,,2,2018-12-18T20:52:43Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:52:53Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:03Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:53:13Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:23Z,metric_name3,400,prometheus\r\n\"\r\noutData = \"\r\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_start,_stop,_field,_value,_measurement\r\n,,0,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name1,0,prometheus\r\n,,1,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name2,109.89999999999999,prometheus\r\n,,2,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name3,760,prometheus\r\n\"\r\nt_extrapolatedRate = (table=<-) =>\r\n\t(table\r\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)\r\n\t\t|> promql.extrapolatedRate(isCounter: true, isRate: false))\r\n\r\ntest _extrapolatedRate = () =>\r\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_extrapolatedRate})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 8, }, File: "extrapolatedRate_norate_test.flux", Source: "now = () =>\r\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 7, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 7, }, File: "extrapolatedRate_norate_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 7, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 8, }, File: "extrapolatedRate_norate_test.flux", Source: "() =>\r\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 8, }, File: "extrapolatedRate_norate_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 2, Line: 8, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 8, }, File: "extrapolatedRate_norate_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 3, Line: 8, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 8, }, File: "extrapolatedRate_norate_test.flux", Source: "option now = () =>\r\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.OptionStatement{ Assignment: &ast.MemberAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 15, }, File: "extrapolatedRate_norate_test.flux", Source: "testing.loadStorage = (csv) => c.from(csv: csv)\r\n |> map(fn: (r) => ({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n }))", Start: ast.Position{ Column: 8, Line: 10, }, }, }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 15, }, File: "extrapolatedRate_norate_test.flux", Source: "(csv) => c.from(csv: csv)\r\n |> map(fn: (r) => ({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n }))", Start: ast.Position{ Column: 30, Line: 10, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 10, }, File: "extrapolatedRate_norate_test.flux", Source: "csv: csv", Start: ast.Position{ Column: 46, Line: 10, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 10, }, File: "extrapolatedRate_norate_test.flux", Source: "csv: csv", Start: ast.Position{ Column: 46, Line: 10, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 10, }, File: "extrapolatedRate_norate_test.flux", Source: "csv", Start: ast.Position{ Column: 46, Line: 10, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 10, }, File: "extrapolatedRate_norate_test.flux", Source: "csv", Start: ast.Position{ Column: 51, Line: 10, }, }, }, Name: "csv", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 55, Line: 10, }, File: "extrapolatedRate_norate_test.flux", Source: "c.from(csv: csv)", Start: ast.Position{ Column: 39, Line: 10, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 10, }, File: "extrapolatedRate_norate_test.flux", Source: "c.from", Start: ast.Position{ Column: 39, Line: 10, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 10, }, File: "extrapolatedRate_norate_test.flux", Source: "c", Start: ast.Position{ Column: 39, Line: 10, }, }, }, Name: "c", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 10, }, File: "extrapolatedRate_norate_test.flux", Source: "from", Start: ast.Position{ Column: 41, Line: 10, }, }, }, Name: "from", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 15, }, File: "extrapolatedRate_norate_test.flux", Source: "c.from(csv: csv)\r\n |> map(fn: (r) => ({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n }))", Start: ast.Position{ Column: 39, Line: 10, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 15, }, File: "extrapolatedRate_norate_test.flux", Source: "fn: (r) => ({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n })", Start: ast.Position{ Column: 12, Line: 11, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 15, }, File: "extrapolatedRate_norate_test.flux", Source: "fn: (r) => ({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n })", Start: ast.Position{ Column: 12, Line: 11, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 11, }, File: "extrapolatedRate_norate_test.flux", Source: "fn", Start: ast.Position{ Column: 12, Line: 11, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 15, }, File: "extrapolatedRate_norate_test.flux", Source: "(r) => ({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n })", Start: ast.Position{ Column: 16, Line: 11, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 15, }, File: "extrapolatedRate_norate_test.flux", Source: "({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n })", Start: ast.Position{ Column: 23, Line: 11, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 6, Line: 15, }, File: "extrapolatedRate_norate_test.flux", Source: "{r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n }", Start: ast.Position{ Column: 24, Line: 11, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 12, }, File: "extrapolatedRate_norate_test.flux", Source: "_field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\")", Start: ast.Position{ Column: 5, Line: 12, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 12, }, File: "extrapolatedRate_norate_test.flux", Source: "_field", Start: ast.Position{ Column: 5, Line: 12, }, }, }, Name: "_field", }, Separator: nil, Value: &ast.ConditionalExpression{ Alternate: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 12, }, File: "extrapolatedRate_norate_test.flux", Source: "msg: \"test input table does not have _field column\"", Start: ast.Position{ Column: 55, Line: 12, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 12, }, File: "extrapolatedRate_norate_test.flux", Source: "msg: \"test input table does not have _field column\"", Start: ast.Position{ Column: 55, Line: 12, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 12, }, File: "extrapolatedRate_norate_test.flux", Source: "msg", Start: ast.Position{ Column: 55, Line: 12, }, }, }, Name: "msg", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 12, }, File: "extrapolatedRate_norate_test.flux", Source: "\"test input table does not have _field column\"", Start: ast.Position{ Column: 60, Line: 12, }, }, }, Value: "test input table does not have _field column", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 12, }, File: "extrapolatedRate_norate_test.flux", Source: "die(msg: \"test input table does not have _field column\")", Start: ast.Position{ Column: 51, Line: 12, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 12, }, File: "extrapolatedRate_norate_test.flux", Source: "die", Start: ast.Position{ Column: 51, Line: 12, }, }, }, Name: "die", }, Lparen: nil, Rparen: nil, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 12, }, File: "extrapolatedRate_norate_test.flux", Source: "if exists r._field then r._field else die(msg: \"test input table does not have _field column\")", Start: ast.Position{ Column: 13, Line: 12, }, }, }, Consequent: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 12, }, File: "extrapolatedRate_norate_test.flux", Source: "r._field", Start: ast.Position{ Column: 37, Line: 12, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 38, Line: 12, }, File: "extrapolatedRate_norate_test.flux", Source: "r", Start: ast.Position{ Column: 37, Line: 12, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 12, }, File: "extrapolatedRate_norate_test.flux", Source: "_field", Start: ast.Position{ Column: 39, Line: 12, }, }, }, Name: "_field", }, Rbrack: nil, }, Test: &ast.UnaryExpression{ Argument: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 12, }, File: "extrapolatedRate_norate_test.flux", Source: "r._field", Start: ast.Position{ Column: 23, Line: 12, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 12, }, File: "extrapolatedRate_norate_test.flux", Source: "r", Start: ast.Position{ Column: 23, Line: 12, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 12, }, File: "extrapolatedRate_norate_test.flux", Source: "_field", Start: ast.Position{ Column: 25, Line: 12, }, }, }, Name: "_field", }, Rbrack: nil, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 12, }, File: "extrapolatedRate_norate_test.flux", Source: "exists r._field", Start: ast.Position{ Column: 16, Line: 12, }, }, }, Operator: 14, }, Tk_else: nil, Tk_if: nil, Tk_then: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 131, Line: 13, }, File: "extrapolatedRate_norate_test.flux", Source: "_measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\")", Start: ast.Position{ Column: 5, Line: 13, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 13, }, File: "extrapolatedRate_norate_test.flux", Source: "_measurement", Start: ast.Position{ Column: 5, Line: 13, }, }, }, Name: "_measurement", }, Separator: nil, Value: &ast.ConditionalExpression{ Alternate: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 130, Line: 13, }, File: "extrapolatedRate_norate_test.flux", Source: "msg: \"test input table does not have _measurement column\"", Start: ast.Position{ Column: 73, Line: 13, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 130, Line: 13, }, File: "extrapolatedRate_norate_test.flux", Source: "msg: \"test input table does not have _measurement column\"", Start: ast.Position{ Column: 73, Line: 13, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 13, }, File: "extrapolatedRate_norate_test.flux", Source: "msg", Start: ast.Position{ Column: 73, Line: 13, }, }, }, Name: "msg", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 130, Line: 13, }, File: "extrapolatedRate_norate_test.flux", Source: "\"test input table does not have _measurement column\"", Start: ast.Position{ Column: 78, Line: 13, }, }, }, Value: "test input table does not have _measurement column", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 131, Line: 13, }, File: "extrapolatedRate_norate_test.flux", Source: "die(msg: \"test input table does not have _measurement column\")", Start: ast.Position{ Column: 69, Line: 13, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 13, }, File: "extrapolatedRate_norate_test.flux", Source: "die", Start: ast.Position{ Column: 69, Line: 13, }, }, }, Name: "die", }, Lparen: nil, Rparen: nil, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 131, Line: 13, }, File: "extrapolatedRate_norate_test.flux", Source: "if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\")", Start: ast.Position{ Column: 19, Line: 13, }, }, }, Consequent: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 13, }, File: "extrapolatedRate_norate_test.flux", Source: "r._measurement", Start: ast.Position{ Column: 49, Line: 13, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 13, }, File: "extrapolatedRate_norate_test.flux", Source: "r", Start: ast.Position{ Column: 49, Line: 13, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 13, }, File: "extrapolatedRate_norate_test.flux", Source: "_measurement", Start: ast.Position{ Column: 51, Line: 13, }, }, }, Name: "_measurement", }, Rbrack: nil, }, Test: &ast.UnaryExpression{ Argument: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 13, }, File: "extrapolatedRate_norate_test.flux", Source: "r._measurement", Start: ast.Position{ Column: 29, Line: 13, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 13, }, File: "extrapolatedRate_norate_test.flux", Source: "r", Start: ast.Position{ Column: 29, Line: 13, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 13, }, File: "extrapolatedRate_norate_test.flux", Source: "_measurement", Start: ast.Position{ Column: 31, Line: 13, }, }, }, Name: "_measurement", }, Rbrack: nil, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 13, }, File: "extrapolatedRate_norate_test.flux", Source: "exists r._measurement", Start: ast.Position{ Column: 22, Line: 13, }, }, }, Operator: 14, }, Tk_else: nil, Tk_if: nil, Tk_then: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 14, }, File: "extrapolatedRate_norate_test.flux", Source: "_time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")", Start: ast.Position{ Column: 5, Line: 14, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 14, }, File: "extrapolatedRate_norate_test.flux", Source: "_time", Start: ast.Position{ Column: 5, Line: 14, }, }, }, Name: "_time", }, Separator: nil, Value: &ast.ConditionalExpression{ Alternate: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 14, }, File: "extrapolatedRate_norate_test.flux", Source: "msg: \"test input table does not have _time column\"", Start: ast.Position{ Column: 52, Line: 14, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 14, }, File: "extrapolatedRate_norate_test.flux", Source: "msg: \"test input table does not have _time column\"", Start: ast.Position{ Column: 52, Line: 14, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 55, Line: 14, }, File: "extrapolatedRate_norate_test.flux", Source: "msg", Start: ast.Position{ Column: 52, Line: 14, }, }, }, Name: "msg", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 14, }, File: "extrapolatedRate_norate_test.flux", Source: "\"test input table does not have _time column\"", Start: ast.Position{ Column: 57, Line: 14, }, }, }, Value: "test input table does not have _time column", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 14, }, File: "extrapolatedRate_norate_test.flux", Source: "die(msg: \"test input table does not have _time column\")", Start: ast.Position{ Column: 48, Line: 14, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 51, Line: 14, }, File: "extrapolatedRate_norate_test.flux", Source: "die", Start: ast.Position{ Column: 48, Line: 14, }, }, }, Name: "die", }, Lparen: nil, Rparen: nil, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 14, }, File: "extrapolatedRate_norate_test.flux", Source: "if exists r._time then r._time else die(msg: \"test input table does not have _time column\")", Start: ast.Position{ Column: 12, Line: 14, }, }, }, Consequent: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 14, }, File: "extrapolatedRate_norate_test.flux", Source: "r._time", Start: ast.Position{ Column: 35, Line: 14, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 14, }, File: "extrapolatedRate_norate_test.flux", Source: "r", Start: ast.Position{ Column: 35, Line: 14, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 14, }, File: "extrapolatedRate_norate_test.flux", Source: "_time", Start: ast.Position{ Column: 37, Line: 14, }, }, }, Name: "_time", }, Rbrack: nil, }, Test: &ast.UnaryExpression{ Argument: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 14, }, File: "extrapolatedRate_norate_test.flux", Source: "r._time", Start: ast.Position{ Column: 22, Line: 14, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 14, }, File: "extrapolatedRate_norate_test.flux", Source: "r", Start: ast.Position{ Column: 22, Line: 14, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 14, }, File: "extrapolatedRate_norate_test.flux", Source: "_time", Start: ast.Position{ Column: 24, Line: 14, }, }, }, Name: "_time", }, Rbrack: nil, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 14, }, File: "extrapolatedRate_norate_test.flux", Source: "exists r._time", Start: ast.Position{ Column: 15, Line: 14, }, }, }, Operator: 14, }, Tk_else: nil, Tk_if: nil, Tk_then: nil, }, }}, Rbrace: nil, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 26, Line: 11, }, File: "extrapolatedRate_norate_test.flux", Source: "r", Start: ast.Position{ Column: 25, Line: 11, }, }, }, Name: "r", }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 11, }, File: "extrapolatedRate_norate_test.flux", Source: "r", Start: ast.Position{ Column: 17, Line: 11, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 11, }, File: "extrapolatedRate_norate_test.flux", Source: "r", Start: ast.Position{ Column: 17, Line: 11, }, }, }, Name: "r", }, Separator: nil, Value: nil, }}, Rparan: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 15, }, File: "extrapolatedRate_norate_test.flux", Source: "map(fn: (r) => ({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n }))", Start: ast.Position{ Column: 8, Line: 11, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 11, }, File: "extrapolatedRate_norate_test.flux", Source: "map", Start: ast.Position{ Column: 8, Line: 11, }, }, }, Name: "map", }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 10, }, File: "extrapolatedRate_norate_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 10, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 10, }, File: "extrapolatedRate_norate_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 10, }, }, }, Name: "csv", }, Separator: nil, Value: nil, }}, Rparan: nil, }, Member: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 10, }, File: "extrapolatedRate_norate_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 8, Line: 10, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 10, }, File: "extrapolatedRate_norate_test.flux", Source: "testing", Start: ast.Position{ Column: 8, Line: 10, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 10, }, File: "extrapolatedRate_norate_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 16, Line: 10, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, }, BaseNode: ast.BaseNode{ Comments: []ast.Comment{ast.Comment{Text: "// todo(faith): remove overload https://github.com/influxdata/flux/issues/3155\r\n"}}, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 15, }, File: "extrapolatedRate_norate_test.flux", Source: "option testing.loadStorage = (csv) => c.from(csv: csv)\r\n |> map(fn: (r) => ({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n }))", Start: ast.Position{ Column: 1, Line: 10, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 40, }, File: "extrapolatedRate_norate_test.flux", Source: "inData = \"\r\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:53Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:03Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:13Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:23Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:53Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:53:03Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:13Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:23Z,metric_name2,100,prometheus\r\n,,2,2018-12-18T20:52:33Z,metric_name3,100,prometheus\r\n,,2,2018-12-18T20:52:43Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:52:53Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:03Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:53:13Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:23Z,metric_name3,400,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 17, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 17, }, File: "extrapolatedRate_norate_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 17, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 40, }, File: "extrapolatedRate_norate_test.flux", Source: "\"\r\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:53Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:03Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:13Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:23Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:53Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:53:03Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:13Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:23Z,metric_name2,100,prometheus\r\n,,2,2018-12-18T20:52:33Z,metric_name3,100,prometheus\r\n,,2,2018-12-18T20:52:43Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:52:53Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:03Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:53:13Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:23Z,metric_name3,400,prometheus\r\n\"", Start: ast.Position{ Column: 10, Line: 17, }, }, }, Value: "\r\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:53Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:03Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:13Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:23Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:53Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:53:03Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:13Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:23Z,metric_name2,100,prometheus\r\n,,2,2018-12-18T20:52:33Z,metric_name3,100,prometheus\r\n,,2,2018-12-18T20:52:43Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:52:53Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:03Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:53:13Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:23Z,metric_name3,400,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 49, }, File: "extrapolatedRate_norate_test.flux", Source: "outData = \"\r\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_start,_stop,_field,_value,_measurement\r\n,,0,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name1,0,prometheus\r\n,,1,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name2,109.89999999999999,prometheus\r\n,,2,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name3,760,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 41, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 41, }, File: "extrapolatedRate_norate_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 41, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 49, }, File: "extrapolatedRate_norate_test.flux", Source: "\"\r\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_start,_stop,_field,_value,_measurement\r\n,,0,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name1,0,prometheus\r\n,,1,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name2,109.89999999999999,prometheus\r\n,,2,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name3,760,prometheus\r\n\"", Start: ast.Position{ Column: 11, Line: 41, }, }, }, Value: "\r\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_start,_stop,_field,_value,_measurement\r\n,,0,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name1,0,prometheus\r\n,,1,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name2,109.89999999999999,prometheus\r\n,,2,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name3,760,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 53, }, File: "extrapolatedRate_norate_test.flux", Source: "t_extrapolatedRate = (table=<-) =>\r\n\t(table\r\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)\r\n\t\t|> promql.extrapolatedRate(isCounter: true, isRate: false))", Start: ast.Position{ Column: 1, Line: 50, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 50, }, File: "extrapolatedRate_norate_test.flux", Source: "t_extrapolatedRate", Start: ast.Position{ Column: 1, Line: 50, }, }, }, Name: "t_extrapolatedRate", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 53, }, File: "extrapolatedRate_norate_test.flux", Source: "(table=<-) =>\r\n\t(table\r\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)\r\n\t\t|> promql.extrapolatedRate(isCounter: true, isRate: false))", Start: ast.Position{ Column: 22, Line: 50, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 53, }, File: "extrapolatedRate_norate_test.flux", Source: "(table\r\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)\r\n\t\t|> promql.extrapolatedRate(isCounter: true, isRate: false))", Start: ast.Position{ Column: 2, Line: 51, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 51, }, File: "extrapolatedRate_norate_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 51, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 52, }, File: "extrapolatedRate_norate_test.flux", Source: "table\r\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)", Start: ast.Position{ Column: 3, Line: 51, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 52, }, File: "extrapolatedRate_norate_test.flux", Source: "start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z", Start: ast.Position{ Column: 12, Line: 52, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 52, }, File: "extrapolatedRate_norate_test.flux", Source: "start: 2018-12-18T20:50:00Z", Start: ast.Position{ Column: 12, Line: 52, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 52, }, File: "extrapolatedRate_norate_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 52, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 52, }, File: "extrapolatedRate_norate_test.flux", Source: "2018-12-18T20:50:00Z", Start: ast.Position{ Column: 19, Line: 52, }, }, }, Value: parser.MustParseTime("2018-12-18T20:50:00Z"), }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 52, }, File: "extrapolatedRate_norate_test.flux", Source: "stop: 2018-12-18T20:55:00Z", Start: ast.Position{ Column: 41, Line: 52, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 52, }, File: "extrapolatedRate_norate_test.flux", Source: "stop", Start: ast.Position{ Column: 41, Line: 52, }, }, }, Name: "stop", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 52, }, File: "extrapolatedRate_norate_test.flux", Source: "2018-12-18T20:55:00Z", Start: ast.Position{ Column: 47, Line: 52, }, }, }, Value: parser.MustParseTime("2018-12-18T20:55:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 52, }, File: "extrapolatedRate_norate_test.flux", Source: "range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)", Start: ast.Position{ Column: 6, Line: 52, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 52, }, File: "extrapolatedRate_norate_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 52, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 53, }, File: "extrapolatedRate_norate_test.flux", Source: "table\r\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)\r\n\t\t|> promql.extrapolatedRate(isCounter: true, isRate: false)", Start: ast.Position{ Column: 3, Line: 51, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 53, }, File: "extrapolatedRate_norate_test.flux", Source: "isCounter: true, isRate: false", Start: ast.Position{ Column: 30, Line: 53, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 53, }, File: "extrapolatedRate_norate_test.flux", Source: "isCounter: true", Start: ast.Position{ Column: 30, Line: 53, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 53, }, File: "extrapolatedRate_norate_test.flux", Source: "isCounter", Start: ast.Position{ Column: 30, Line: 53, }, }, }, Name: "isCounter", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 53, }, File: "extrapolatedRate_norate_test.flux", Source: "true", Start: ast.Position{ Column: 41, Line: 53, }, }, }, Name: "true", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 53, }, File: "extrapolatedRate_norate_test.flux", Source: "isRate: false", Start: ast.Position{ Column: 47, Line: 53, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 53, }, File: "extrapolatedRate_norate_test.flux", Source: "isRate", Start: ast.Position{ Column: 47, Line: 53, }, }, }, Name: "isRate", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 53, }, File: "extrapolatedRate_norate_test.flux", Source: "false", Start: ast.Position{ Column: 55, Line: 53, }, }, }, Name: "false", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 53, }, File: "extrapolatedRate_norate_test.flux", Source: "promql.extrapolatedRate(isCounter: true, isRate: false)", Start: ast.Position{ Column: 6, Line: 53, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 53, }, File: "extrapolatedRate_norate_test.flux", Source: "promql.extrapolatedRate", Start: ast.Position{ Column: 6, Line: 53, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 53, }, File: "extrapolatedRate_norate_test.flux", Source: "promql", Start: ast.Position{ Column: 6, Line: 53, }, }, }, Name: "promql", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 53, }, File: "extrapolatedRate_norate_test.flux", Source: "extrapolatedRate", Start: ast.Position{ Column: 13, Line: 53, }, }, }, Name: "extrapolatedRate", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 50, }, File: "extrapolatedRate_norate_test.flux", Source: "table=<-", Start: ast.Position{ Column: 23, Line: 50, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 50, }, File: "extrapolatedRate_norate_test.flux", Source: "table", Start: ast.Position{ Column: 23, Line: 50, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 50, }, File: "extrapolatedRate_norate_test.flux", Source: "<-", Start: ast.Position{ Column: 29, Line: 50, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 56, }, File: "extrapolatedRate_norate_test.flux", Source: "_extrapolatedRate = () =>\r\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_extrapolatedRate})", Start: ast.Position{ Column: 6, Line: 55, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 55, }, File: "extrapolatedRate_norate_test.flux", Source: "_extrapolatedRate", Start: ast.Position{ Column: 6, Line: 55, }, }, }, Name: "_extrapolatedRate", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 56, }, File: "extrapolatedRate_norate_test.flux", Source: "() =>\r\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_extrapolatedRate})", Start: ast.Position{ Column: 26, Line: 55, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 56, }, File: "extrapolatedRate_norate_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_extrapolatedRate})", Start: ast.Position{ Column: 2, Line: 56, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 56, }, File: "extrapolatedRate_norate_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_extrapolatedRate}", Start: ast.Position{ Column: 3, Line: 56, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 56, }, File: "extrapolatedRate_norate_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 56, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 56, }, File: "extrapolatedRate_norate_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 56, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 56, }, File: "extrapolatedRate_norate_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 56, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 56, }, File: "extrapolatedRate_norate_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 56, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 56, }, File: "extrapolatedRate_norate_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 56, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 56, }, File: "extrapolatedRate_norate_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 56, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 56, }, File: "extrapolatedRate_norate_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 56, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 56, }, File: "extrapolatedRate_norate_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 56, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 56, }, File: "extrapolatedRate_norate_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 56, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 56, }, File: "extrapolatedRate_norate_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 56, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 56, }, File: "extrapolatedRate_norate_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 56, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 56, }, File: "extrapolatedRate_norate_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 56, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 56, }, File: "extrapolatedRate_norate_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 56, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 56, }, File: "extrapolatedRate_norate_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 56, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 56, }, File: "extrapolatedRate_norate_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 56, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 56, }, File: "extrapolatedRate_norate_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 56, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 56, }, File: "extrapolatedRate_norate_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 56, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 56, }, File: "extrapolatedRate_norate_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 56, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 56, }, File: "extrapolatedRate_norate_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 56, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 56, }, File: "extrapolatedRate_norate_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 56, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 56, }, File: "extrapolatedRate_norate_test.flux", Source: "fn: t_extrapolatedRate", Start: ast.Position{ Column: 82, Line: 56, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 56, }, File: "extrapolatedRate_norate_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 56, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 56, }, File: "extrapolatedRate_norate_test.flux", Source: "t_extrapolatedRate", Start: ast.Position{ Column: 86, Line: 56, }, }, }, Name: "t_extrapolatedRate", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 56, }, File: "extrapolatedRate_norate_test.flux", Source: "test _extrapolatedRate = () =>\r\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_extrapolatedRate})", Start: ast.Position{ Column: 1, Line: 55, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "extrapolatedRate_norate_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "extrapolatedRate_norate_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 4, }, File: "extrapolatedRate_norate_test.flux", Source: "import \"internal/promql\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 4, }, File: "extrapolatedRate_norate_test.flux", Source: "\"internal/promql\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "internal/promql", }, }, &ast.ImportDeclaration{ As: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 5, }, File: "extrapolatedRate_norate_test.flux", Source: "c", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Name: "c", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 5, }, File: "extrapolatedRate_norate_test.flux", Source: "import c \"csv\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 5, }, File: "extrapolatedRate_norate_test.flux", Source: "\"csv\"", Start: ast.Position{ Column: 10, Line: 5, }, }, }, Value: "csv", }, }}, Metadata: "parser-type=rust", Name: "extrapolatedRate_norate_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "extrapolatedRate_norate_test.flux", Source: "package promql_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "extrapolatedRate_norate_test.flux", Source: "promql_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "promql_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 45, }, File: "histogramQuantile_test.flux", Source: "package promql_test\r\nimport \"experimental\"\r\nimport \"internal/promql\"\r\nimport \"testing\"\r\n\r\noption now = () =>\r\n\t(2030-01-01T00:00:00Z)\r\n\r\ninData = \"#datatype,string,long,dateTime:RFC3339,string,double,string,string\r\n#group,false,false,false,true,false,true,true\r\n#default,inData,,,,,,\r\n,result,table,_time,_field,_value,le,_measurement\r\n,,0,2018-05-22T19:53:00Z,x_duration_seconds,1,0.1,prometheus\r\n,,1,2018-05-22T19:53:00Z,x_duration_seconds,2,0.2,prometheus\r\n,,2,2018-05-22T19:53:00Z,x_duration_seconds,2,0.3,prometheus\r\n,,3,2018-05-22T19:53:00Z,x_duration_seconds,2,0.4,prometheus\r\n,,4,2018-05-22T19:53:00Z,x_duration_seconds,2,0.5,prometheus\r\n,,5,2018-05-22T19:53:00Z,x_duration_seconds,2,0.6,prometheus\r\n,,6,2018-05-22T19:53:00Z,x_duration_seconds,2,0.7,prometheus\r\n,,7,2018-05-22T19:53:00Z,x_duration_seconds,8,0.8,prometheus\r\n,,8,2018-05-22T19:53:00Z,x_duration_seconds,10,0.9,prometheus\r\n,,9,2018-05-22T19:53:00Z,x_duration_seconds,10,+Inf,prometheus\r\n,,10,2018-05-22T19:53:00Z,y_duration_seconds,10,0.2,prometheus\r\n,,11,2018-05-22T19:53:00Z,y_duration_seconds,15,0.4,prometheus\r\n,,12,2018-05-22T19:53:00Z,y_duration_seconds,25,0.6,prometheus\r\n,,13,2018-05-22T19:53:00Z,y_duration_seconds,35,0.8,prometheus\r\n,,14,2018-05-22T19:53:00Z,y_duration_seconds,45,1,prometheus\r\n,,15,2018-05-22T19:53:00Z,y_duration_seconds,45,+Inf,prometheus\r\n\"\r\noutData = \"\r\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,double\r\n#group,false,false,true,true,true,true,false\r\n#default,_result,,,,,,\r\n,result,table,_start,_stop,_field,_measurement,_value\r\n,,0,2018-05-22T19:53:00Z,2030-01-01T00:00:00Z,x_duration_seconds,prometheus,0.8500000000000001\r\n,,1,2018-05-22T19:53:00Z,2030-01-01T00:00:00Z,y_duration_seconds,prometheus,0.91\r\n\"\r\nt_histogram_quantile = (table=<-) =>\r\n\t(table\r\n\t\t|> range(start: 2018-05-22T19:53:00Z)\r\n\t\t|> group(mode: \"except\", columns: [\"le\", \"_time\", \"_value\"])\r\n\t\t|> promql.promHistogramQuantile(quantile: 0.9))\r\n\r\ntest _histogram_quantile = () =>\r\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_histogram_quantile})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 7, }, File: "histogramQuantile_test.flux", Source: "now = () =>\r\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 6, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 6, }, File: "histogramQuantile_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 7, }, File: "histogramQuantile_test.flux", Source: "() =>\r\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 6, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 7, }, File: "histogramQuantile_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 2, Line: 7, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 7, }, File: "histogramQuantile_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 3, Line: 7, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 7, }, File: "histogramQuantile_test.flux", Source: "option now = () =>\r\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 6, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 29, }, File: "histogramQuantile_test.flux", Source: "inData = \"#datatype,string,long,dateTime:RFC3339,string,double,string,string\r\n#group,false,false,false,true,false,true,true\r\n#default,inData,,,,,,\r\n,result,table,_time,_field,_value,le,_measurement\r\n,,0,2018-05-22T19:53:00Z,x_duration_seconds,1,0.1,prometheus\r\n,,1,2018-05-22T19:53:00Z,x_duration_seconds,2,0.2,prometheus\r\n,,2,2018-05-22T19:53:00Z,x_duration_seconds,2,0.3,prometheus\r\n,,3,2018-05-22T19:53:00Z,x_duration_seconds,2,0.4,prometheus\r\n,,4,2018-05-22T19:53:00Z,x_duration_seconds,2,0.5,prometheus\r\n,,5,2018-05-22T19:53:00Z,x_duration_seconds,2,0.6,prometheus\r\n,,6,2018-05-22T19:53:00Z,x_duration_seconds,2,0.7,prometheus\r\n,,7,2018-05-22T19:53:00Z,x_duration_seconds,8,0.8,prometheus\r\n,,8,2018-05-22T19:53:00Z,x_duration_seconds,10,0.9,prometheus\r\n,,9,2018-05-22T19:53:00Z,x_duration_seconds,10,+Inf,prometheus\r\n,,10,2018-05-22T19:53:00Z,y_duration_seconds,10,0.2,prometheus\r\n,,11,2018-05-22T19:53:00Z,y_duration_seconds,15,0.4,prometheus\r\n,,12,2018-05-22T19:53:00Z,y_duration_seconds,25,0.6,prometheus\r\n,,13,2018-05-22T19:53:00Z,y_duration_seconds,35,0.8,prometheus\r\n,,14,2018-05-22T19:53:00Z,y_duration_seconds,45,1,prometheus\r\n,,15,2018-05-22T19:53:00Z,y_duration_seconds,45,+Inf,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 9, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 9, }, File: "histogramQuantile_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 9, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 29, }, File: "histogramQuantile_test.flux", Source: "\"#datatype,string,long,dateTime:RFC3339,string,double,string,string\r\n#group,false,false,false,true,false,true,true\r\n#default,inData,,,,,,\r\n,result,table,_time,_field,_value,le,_measurement\r\n,,0,2018-05-22T19:53:00Z,x_duration_seconds,1,0.1,prometheus\r\n,,1,2018-05-22T19:53:00Z,x_duration_seconds,2,0.2,prometheus\r\n,,2,2018-05-22T19:53:00Z,x_duration_seconds,2,0.3,prometheus\r\n,,3,2018-05-22T19:53:00Z,x_duration_seconds,2,0.4,prometheus\r\n,,4,2018-05-22T19:53:00Z,x_duration_seconds,2,0.5,prometheus\r\n,,5,2018-05-22T19:53:00Z,x_duration_seconds,2,0.6,prometheus\r\n,,6,2018-05-22T19:53:00Z,x_duration_seconds,2,0.7,prometheus\r\n,,7,2018-05-22T19:53:00Z,x_duration_seconds,8,0.8,prometheus\r\n,,8,2018-05-22T19:53:00Z,x_duration_seconds,10,0.9,prometheus\r\n,,9,2018-05-22T19:53:00Z,x_duration_seconds,10,+Inf,prometheus\r\n,,10,2018-05-22T19:53:00Z,y_duration_seconds,10,0.2,prometheus\r\n,,11,2018-05-22T19:53:00Z,y_duration_seconds,15,0.4,prometheus\r\n,,12,2018-05-22T19:53:00Z,y_duration_seconds,25,0.6,prometheus\r\n,,13,2018-05-22T19:53:00Z,y_duration_seconds,35,0.8,prometheus\r\n,,14,2018-05-22T19:53:00Z,y_duration_seconds,45,1,prometheus\r\n,,15,2018-05-22T19:53:00Z,y_duration_seconds,45,+Inf,prometheus\r\n\"", Start: ast.Position{ Column: 10, Line: 9, }, }, }, Value: "#datatype,string,long,dateTime:RFC3339,string,double,string,string\r\n#group,false,false,false,true,false,true,true\r\n#default,inData,,,,,,\r\n,result,table,_time,_field,_value,le,_measurement\r\n,,0,2018-05-22T19:53:00Z,x_duration_seconds,1,0.1,prometheus\r\n,,1,2018-05-22T19:53:00Z,x_duration_seconds,2,0.2,prometheus\r\n,,2,2018-05-22T19:53:00Z,x_duration_seconds,2,0.3,prometheus\r\n,,3,2018-05-22T19:53:00Z,x_duration_seconds,2,0.4,prometheus\r\n,,4,2018-05-22T19:53:00Z,x_duration_seconds,2,0.5,prometheus\r\n,,5,2018-05-22T19:53:00Z,x_duration_seconds,2,0.6,prometheus\r\n,,6,2018-05-22T19:53:00Z,x_duration_seconds,2,0.7,prometheus\r\n,,7,2018-05-22T19:53:00Z,x_duration_seconds,8,0.8,prometheus\r\n,,8,2018-05-22T19:53:00Z,x_duration_seconds,10,0.9,prometheus\r\n,,9,2018-05-22T19:53:00Z,x_duration_seconds,10,+Inf,prometheus\r\n,,10,2018-05-22T19:53:00Z,y_duration_seconds,10,0.2,prometheus\r\n,,11,2018-05-22T19:53:00Z,y_duration_seconds,15,0.4,prometheus\r\n,,12,2018-05-22T19:53:00Z,y_duration_seconds,25,0.6,prometheus\r\n,,13,2018-05-22T19:53:00Z,y_duration_seconds,35,0.8,prometheus\r\n,,14,2018-05-22T19:53:00Z,y_duration_seconds,45,1,prometheus\r\n,,15,2018-05-22T19:53:00Z,y_duration_seconds,45,+Inf,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 37, }, File: "histogramQuantile_test.flux", Source: "outData = \"\r\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,double\r\n#group,false,false,true,true,true,true,false\r\n#default,_result,,,,,,\r\n,result,table,_start,_stop,_field,_measurement,_value\r\n,,0,2018-05-22T19:53:00Z,2030-01-01T00:00:00Z,x_duration_seconds,prometheus,0.8500000000000001\r\n,,1,2018-05-22T19:53:00Z,2030-01-01T00:00:00Z,y_duration_seconds,prometheus,0.91\r\n\"", Start: ast.Position{ Column: 1, Line: 30, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 30, }, File: "histogramQuantile_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 30, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 37, }, File: "histogramQuantile_test.flux", Source: "\"\r\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,double\r\n#group,false,false,true,true,true,true,false\r\n#default,_result,,,,,,\r\n,result,table,_start,_stop,_field,_measurement,_value\r\n,,0,2018-05-22T19:53:00Z,2030-01-01T00:00:00Z,x_duration_seconds,prometheus,0.8500000000000001\r\n,,1,2018-05-22T19:53:00Z,2030-01-01T00:00:00Z,y_duration_seconds,prometheus,0.91\r\n\"", Start: ast.Position{ Column: 11, Line: 30, }, }, }, Value: "\r\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,double\r\n#group,false,false,true,true,true,true,false\r\n#default,_result,,,,,,\r\n,result,table,_start,_stop,_field,_measurement,_value\r\n,,0,2018-05-22T19:53:00Z,2030-01-01T00:00:00Z,x_duration_seconds,prometheus,0.8500000000000001\r\n,,1,2018-05-22T19:53:00Z,2030-01-01T00:00:00Z,y_duration_seconds,prometheus,0.91\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 42, }, File: "histogramQuantile_test.flux", Source: "t_histogram_quantile = (table=<-) =>\r\n\t(table\r\n\t\t|> range(start: 2018-05-22T19:53:00Z)\r\n\t\t|> group(mode: \"except\", columns: [\"le\", \"_time\", \"_value\"])\r\n\t\t|> promql.promHistogramQuantile(quantile: 0.9))", Start: ast.Position{ Column: 1, Line: 38, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 38, }, File: "histogramQuantile_test.flux", Source: "t_histogram_quantile", Start: ast.Position{ Column: 1, Line: 38, }, }, }, Name: "t_histogram_quantile", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 42, }, File: "histogramQuantile_test.flux", Source: "(table=<-) =>\r\n\t(table\r\n\t\t|> range(start: 2018-05-22T19:53:00Z)\r\n\t\t|> group(mode: \"except\", columns: [\"le\", \"_time\", \"_value\"])\r\n\t\t|> promql.promHistogramQuantile(quantile: 0.9))", Start: ast.Position{ Column: 24, Line: 38, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 42, }, File: "histogramQuantile_test.flux", Source: "(table\r\n\t\t|> range(start: 2018-05-22T19:53:00Z)\r\n\t\t|> group(mode: \"except\", columns: [\"le\", \"_time\", \"_value\"])\r\n\t\t|> promql.promHistogramQuantile(quantile: 0.9))", Start: ast.Position{ Column: 2, Line: 39, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 39, }, File: "histogramQuantile_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 39, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 40, }, File: "histogramQuantile_test.flux", Source: "table\r\n\t\t|> range(start: 2018-05-22T19:53:00Z)", Start: ast.Position{ Column: 3, Line: 39, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 40, }, File: "histogramQuantile_test.flux", Source: "start: 2018-05-22T19:53:00Z", Start: ast.Position{ Column: 12, Line: 40, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 40, }, File: "histogramQuantile_test.flux", Source: "start: 2018-05-22T19:53:00Z", Start: ast.Position{ Column: 12, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 40, }, File: "histogramQuantile_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 40, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 40, }, File: "histogramQuantile_test.flux", Source: "2018-05-22T19:53:00Z", Start: ast.Position{ Column: 19, Line: 40, }, }, }, Value: parser.MustParseTime("2018-05-22T19:53:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 40, }, File: "histogramQuantile_test.flux", Source: "range(start: 2018-05-22T19:53:00Z)", Start: ast.Position{ Column: 6, Line: 40, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 40, }, File: "histogramQuantile_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 40, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 41, }, File: "histogramQuantile_test.flux", Source: "table\r\n\t\t|> range(start: 2018-05-22T19:53:00Z)\r\n\t\t|> group(mode: \"except\", columns: [\"le\", \"_time\", \"_value\"])", Start: ast.Position{ Column: 3, Line: 39, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 41, }, File: "histogramQuantile_test.flux", Source: "mode: \"except\", columns: [\"le\", \"_time\", \"_value\"]", Start: ast.Position{ Column: 12, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 26, Line: 41, }, File: "histogramQuantile_test.flux", Source: "mode: \"except\"", Start: ast.Position{ Column: 12, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 41, }, File: "histogramQuantile_test.flux", Source: "mode", Start: ast.Position{ Column: 12, Line: 41, }, }, }, Name: "mode", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 26, Line: 41, }, File: "histogramQuantile_test.flux", Source: "\"except\"", Start: ast.Position{ Column: 18, Line: 41, }, }, }, Value: "except", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 41, }, File: "histogramQuantile_test.flux", Source: "columns: [\"le\", \"_time\", \"_value\"]", Start: ast.Position{ Column: 28, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 41, }, File: "histogramQuantile_test.flux", Source: "columns", Start: ast.Position{ Column: 28, Line: 41, }, }, }, Name: "columns", }, Separator: nil, Value: &ast.ArrayExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 41, }, File: "histogramQuantile_test.flux", Source: "[\"le\", \"_time\", \"_value\"]", Start: ast.Position{ Column: 37, Line: 41, }, }, }, Elements: []ast.Expression{&ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 41, }, File: "histogramQuantile_test.flux", Source: "\"le\"", Start: ast.Position{ Column: 38, Line: 41, }, }, }, Value: "le", }, &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 51, Line: 41, }, File: "histogramQuantile_test.flux", Source: "\"_time\"", Start: ast.Position{ Column: 44, Line: 41, }, }, }, Value: "_time", }, &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 41, }, File: "histogramQuantile_test.flux", Source: "\"_value\"", Start: ast.Position{ Column: 53, Line: 41, }, }, }, Value: "_value", }}, Lbrack: nil, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 41, }, File: "histogramQuantile_test.flux", Source: "group(mode: \"except\", columns: [\"le\", \"_time\", \"_value\"])", Start: ast.Position{ Column: 6, Line: 41, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 41, }, File: "histogramQuantile_test.flux", Source: "group", Start: ast.Position{ Column: 6, Line: 41, }, }, }, Name: "group", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 42, }, File: "histogramQuantile_test.flux", Source: "table\r\n\t\t|> range(start: 2018-05-22T19:53:00Z)\r\n\t\t|> group(mode: \"except\", columns: [\"le\", \"_time\", \"_value\"])\r\n\t\t|> promql.promHistogramQuantile(quantile: 0.9)", Start: ast.Position{ Column: 3, Line: 39, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 42, }, File: "histogramQuantile_test.flux", Source: "quantile: 0.9", Start: ast.Position{ Column: 35, Line: 42, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 42, }, File: "histogramQuantile_test.flux", Source: "quantile: 0.9", Start: ast.Position{ Column: 35, Line: 42, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 42, }, File: "histogramQuantile_test.flux", Source: "quantile", Start: ast.Position{ Column: 35, Line: 42, }, }, }, Name: "quantile", }, Separator: nil, Value: &ast.FloatLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 42, }, File: "histogramQuantile_test.flux", Source: "0.9", Start: ast.Position{ Column: 45, Line: 42, }, }, }, Value: 0.9, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 42, }, File: "histogramQuantile_test.flux", Source: "promql.promHistogramQuantile(quantile: 0.9)", Start: ast.Position{ Column: 6, Line: 42, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 42, }, File: "histogramQuantile_test.flux", Source: "promql.promHistogramQuantile", Start: ast.Position{ Column: 6, Line: 42, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 42, }, File: "histogramQuantile_test.flux", Source: "promql", Start: ast.Position{ Column: 6, Line: 42, }, }, }, Name: "promql", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 42, }, File: "histogramQuantile_test.flux", Source: "promHistogramQuantile", Start: ast.Position{ Column: 13, Line: 42, }, }, }, Name: "promHistogramQuantile", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 38, }, File: "histogramQuantile_test.flux", Source: "table=<-", Start: ast.Position{ Column: 25, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 38, }, File: "histogramQuantile_test.flux", Source: "table", Start: ast.Position{ Column: 25, Line: 38, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 38, }, File: "histogramQuantile_test.flux", Source: "<-", Start: ast.Position{ Column: 31, Line: 38, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 45, }, File: "histogramQuantile_test.flux", Source: "_histogram_quantile = () =>\r\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_histogram_quantile})", Start: ast.Position{ Column: 6, Line: 44, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 44, }, File: "histogramQuantile_test.flux", Source: "_histogram_quantile", Start: ast.Position{ Column: 6, Line: 44, }, }, }, Name: "_histogram_quantile", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 45, }, File: "histogramQuantile_test.flux", Source: "() =>\r\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_histogram_quantile})", Start: ast.Position{ Column: 28, Line: 44, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 45, }, File: "histogramQuantile_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_histogram_quantile})", Start: ast.Position{ Column: 2, Line: 45, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 45, }, File: "histogramQuantile_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_histogram_quantile}", Start: ast.Position{ Column: 3, Line: 45, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 45, }, File: "histogramQuantile_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 45, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 45, }, File: "histogramQuantile_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 45, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 45, }, File: "histogramQuantile_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 45, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 45, }, File: "histogramQuantile_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 45, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 45, }, File: "histogramQuantile_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 45, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 45, }, File: "histogramQuantile_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 45, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 45, }, File: "histogramQuantile_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 45, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 45, }, File: "histogramQuantile_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 45, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 45, }, File: "histogramQuantile_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 45, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 45, }, File: "histogramQuantile_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 45, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 45, }, File: "histogramQuantile_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 45, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 45, }, File: "histogramQuantile_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 45, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 45, }, File: "histogramQuantile_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 45, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 45, }, File: "histogramQuantile_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 45, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 45, }, File: "histogramQuantile_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 45, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 45, }, File: "histogramQuantile_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 45, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 45, }, File: "histogramQuantile_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 45, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 45, }, File: "histogramQuantile_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 45, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 45, }, File: "histogramQuantile_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 45, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 45, }, File: "histogramQuantile_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 45, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 45, }, File: "histogramQuantile_test.flux", Source: "fn: t_histogram_quantile", Start: ast.Position{ Column: 82, Line: 45, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 45, }, File: "histogramQuantile_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 45, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 45, }, File: "histogramQuantile_test.flux", Source: "t_histogram_quantile", Start: ast.Position{ Column: 86, Line: 45, }, }, }, Name: "t_histogram_quantile", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 45, }, File: "histogramQuantile_test.flux", Source: "test _histogram_quantile = () =>\r\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_histogram_quantile})", Start: ast.Position{ Column: 1, Line: 44, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 2, }, File: "histogramQuantile_test.flux", Source: "import \"experimental\"", Start: ast.Position{ Column: 1, Line: 2, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 2, }, File: "histogramQuantile_test.flux", Source: "\"experimental\"", Start: ast.Position{ Column: 8, Line: 2, }, }, }, Value: "experimental", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "histogramQuantile_test.flux", Source: "import \"internal/promql\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "histogramQuantile_test.flux", Source: "\"internal/promql\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "internal/promql", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 4, }, File: "histogramQuantile_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 4, }, File: "histogramQuantile_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }}, Metadata: "parser-type=rust", Name: "histogramQuantile_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "histogramQuantile_test.flux", Source: "package promql_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "histogramQuantile_test.flux", Source: "promql_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "promql_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 48, }, File: "holtWinters_test.flux", Source: "package promql_test\nimport \"testing\"\nimport \"internal/promql\"\n\noption now = () =>\n\t(2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:53Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:03Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:13Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:23Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:53Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:53:03Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:13Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:23Z,metric_name2,100,prometheus\r\n,,2,2018-12-18T20:52:33Z,metric_name3,100,prometheus\r\n,,2,2018-12-18T20:52:43Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:52:53Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:03Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:53:13Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:23Z,metric_name3,400,prometheus\r\n,,3,2018-12-18T20:52:33Z,metric_name4,100,prometheus\r\n\"\noutData = \"\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_start,_stop,_field,_value,_measurement\r\n,,0,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name2,32.78296,prometheus\r\n,,2,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name3,535.7920000000001,prometheus\r\n\"\nt_holtWinters = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)\n\t\t|> promql.holtWinters(smoothingFactor: 0.1, trendFactor: 0.2))\n\ntest _holtWinters = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_holtWinters})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "holtWinters_test.flux", Source: "now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 5, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 5, }, File: "holtWinters_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "holtWinters_test.flux", Source: "() =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 5, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "holtWinters_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 2, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 6, }, File: "holtWinters_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 3, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "holtWinters_test.flux", Source: "option now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 5, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 32, }, File: "holtWinters_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:53Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:03Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:13Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:23Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:53Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:53:03Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:13Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:23Z,metric_name2,100,prometheus\r\n,,2,2018-12-18T20:52:33Z,metric_name3,100,prometheus\r\n,,2,2018-12-18T20:52:43Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:52:53Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:03Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:53:13Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:23Z,metric_name3,400,prometheus\r\n,,3,2018-12-18T20:52:33Z,metric_name4,100,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "holtWinters_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 32, }, File: "holtWinters_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:53Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:03Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:13Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:23Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:53Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:53:03Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:13Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:23Z,metric_name2,100,prometheus\r\n,,2,2018-12-18T20:52:33Z,metric_name3,100,prometheus\r\n,,2,2018-12-18T20:52:43Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:52:53Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:03Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:53:13Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:23Z,metric_name3,400,prometheus\r\n,,3,2018-12-18T20:52:33Z,metric_name4,100,prometheus\r\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:53Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:03Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:13Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:23Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:53Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:53:03Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:13Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:23Z,metric_name2,100,prometheus\r\n,,2,2018-12-18T20:52:33Z,metric_name3,100,prometheus\r\n,,2,2018-12-18T20:52:43Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:52:53Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:03Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:53:13Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:23Z,metric_name3,400,prometheus\r\n,,3,2018-12-18T20:52:33Z,metric_name4,100,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 41, }, File: "holtWinters_test.flux", Source: "outData = \"\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_start,_stop,_field,_value,_measurement\r\n,,0,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name2,32.78296,prometheus\r\n,,2,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name3,535.7920000000001,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 33, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 33, }, File: "holtWinters_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 33, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 41, }, File: "holtWinters_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_start,_stop,_field,_value,_measurement\r\n,,0,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name2,32.78296,prometheus\r\n,,2,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name3,535.7920000000001,prometheus\r\n\"", Start: ast.Position{ Column: 11, Line: 33, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_start,_stop,_field,_value,_measurement\r\n,,0,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name2,32.78296,prometheus\r\n,,2,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name3,535.7920000000001,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 45, }, File: "holtWinters_test.flux", Source: "t_holtWinters = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)\n\t\t|> promql.holtWinters(smoothingFactor: 0.1, trendFactor: 0.2))", Start: ast.Position{ Column: 1, Line: 42, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 42, }, File: "holtWinters_test.flux", Source: "t_holtWinters", Start: ast.Position{ Column: 1, Line: 42, }, }, }, Name: "t_holtWinters", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 45, }, File: "holtWinters_test.flux", Source: "(table=<-) =>\n\t(table\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)\n\t\t|> promql.holtWinters(smoothingFactor: 0.1, trendFactor: 0.2))", Start: ast.Position{ Column: 17, Line: 42, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 45, }, File: "holtWinters_test.flux", Source: "(table\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)\n\t\t|> promql.holtWinters(smoothingFactor: 0.1, trendFactor: 0.2))", Start: ast.Position{ Column: 2, Line: 43, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 43, }, File: "holtWinters_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 43, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 44, }, File: "holtWinters_test.flux", Source: "table\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)", Start: ast.Position{ Column: 3, Line: 43, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 44, }, File: "holtWinters_test.flux", Source: "start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z", Start: ast.Position{ Column: 12, Line: 44, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 44, }, File: "holtWinters_test.flux", Source: "start: 2018-12-18T20:50:00Z", Start: ast.Position{ Column: 12, Line: 44, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 44, }, File: "holtWinters_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 44, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 44, }, File: "holtWinters_test.flux", Source: "2018-12-18T20:50:00Z", Start: ast.Position{ Column: 19, Line: 44, }, }, }, Value: parser.MustParseTime("2018-12-18T20:50:00Z"), }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 44, }, File: "holtWinters_test.flux", Source: "stop: 2018-12-18T20:55:00Z", Start: ast.Position{ Column: 41, Line: 44, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 44, }, File: "holtWinters_test.flux", Source: "stop", Start: ast.Position{ Column: 41, Line: 44, }, }, }, Name: "stop", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 44, }, File: "holtWinters_test.flux", Source: "2018-12-18T20:55:00Z", Start: ast.Position{ Column: 47, Line: 44, }, }, }, Value: parser.MustParseTime("2018-12-18T20:55:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 44, }, File: "holtWinters_test.flux", Source: "range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)", Start: ast.Position{ Column: 6, Line: 44, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 44, }, File: "holtWinters_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 44, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 45, }, File: "holtWinters_test.flux", Source: "table\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)\n\t\t|> promql.holtWinters(smoothingFactor: 0.1, trendFactor: 0.2)", Start: ast.Position{ Column: 3, Line: 43, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 45, }, File: "holtWinters_test.flux", Source: "smoothingFactor: 0.1, trendFactor: 0.2", Start: ast.Position{ Column: 25, Line: 45, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 45, }, File: "holtWinters_test.flux", Source: "smoothingFactor: 0.1", Start: ast.Position{ Column: 25, Line: 45, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 45, }, File: "holtWinters_test.flux", Source: "smoothingFactor", Start: ast.Position{ Column: 25, Line: 45, }, }, }, Name: "smoothingFactor", }, Separator: nil, Value: &ast.FloatLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 45, }, File: "holtWinters_test.flux", Source: "0.1", Start: ast.Position{ Column: 42, Line: 45, }, }, }, Value: 0.1, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 45, }, File: "holtWinters_test.flux", Source: "trendFactor: 0.2", Start: ast.Position{ Column: 47, Line: 45, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 45, }, File: "holtWinters_test.flux", Source: "trendFactor", Start: ast.Position{ Column: 47, Line: 45, }, }, }, Name: "trendFactor", }, Separator: nil, Value: &ast.FloatLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 45, }, File: "holtWinters_test.flux", Source: "0.2", Start: ast.Position{ Column: 60, Line: 45, }, }, }, Value: 0.2, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 45, }, File: "holtWinters_test.flux", Source: "promql.holtWinters(smoothingFactor: 0.1, trendFactor: 0.2)", Start: ast.Position{ Column: 6, Line: 45, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 45, }, File: "holtWinters_test.flux", Source: "promql.holtWinters", Start: ast.Position{ Column: 6, Line: 45, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 45, }, File: "holtWinters_test.flux", Source: "promql", Start: ast.Position{ Column: 6, Line: 45, }, }, }, Name: "promql", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 45, }, File: "holtWinters_test.flux", Source: "holtWinters", Start: ast.Position{ Column: 13, Line: 45, }, }, }, Name: "holtWinters", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 26, Line: 42, }, File: "holtWinters_test.flux", Source: "table=<-", Start: ast.Position{ Column: 18, Line: 42, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 42, }, File: "holtWinters_test.flux", Source: "table", Start: ast.Position{ Column: 18, Line: 42, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 26, Line: 42, }, File: "holtWinters_test.flux", Source: "<-", Start: ast.Position{ Column: 24, Line: 42, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 48, }, File: "holtWinters_test.flux", Source: "_holtWinters = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_holtWinters})", Start: ast.Position{ Column: 6, Line: 47, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 47, }, File: "holtWinters_test.flux", Source: "_holtWinters", Start: ast.Position{ Column: 6, Line: 47, }, }, }, Name: "_holtWinters", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 48, }, File: "holtWinters_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_holtWinters})", Start: ast.Position{ Column: 21, Line: 47, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 48, }, File: "holtWinters_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_holtWinters})", Start: ast.Position{ Column: 2, Line: 48, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 48, }, File: "holtWinters_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_holtWinters}", Start: ast.Position{ Column: 3, Line: 48, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 48, }, File: "holtWinters_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 48, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 48, }, File: "holtWinters_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 48, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 48, }, File: "holtWinters_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 48, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 48, }, File: "holtWinters_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 48, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 48, }, File: "holtWinters_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 48, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 48, }, File: "holtWinters_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 48, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 48, }, File: "holtWinters_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 48, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 48, }, File: "holtWinters_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 48, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 48, }, File: "holtWinters_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 48, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 48, }, File: "holtWinters_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 48, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 48, }, File: "holtWinters_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 48, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 48, }, File: "holtWinters_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 48, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 48, }, File: "holtWinters_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 48, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 48, }, File: "holtWinters_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 48, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 48, }, File: "holtWinters_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 48, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 48, }, File: "holtWinters_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 48, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 48, }, File: "holtWinters_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 48, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 48, }, File: "holtWinters_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 48, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 48, }, File: "holtWinters_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 48, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 48, }, File: "holtWinters_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 48, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 48, }, File: "holtWinters_test.flux", Source: "fn: t_holtWinters", Start: ast.Position{ Column: 82, Line: 48, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 48, }, File: "holtWinters_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 48, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 48, }, File: "holtWinters_test.flux", Source: "t_holtWinters", Start: ast.Position{ Column: 86, Line: 48, }, }, }, Name: "t_holtWinters", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 48, }, File: "holtWinters_test.flux", Source: "test _holtWinters = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_holtWinters})", Start: ast.Position{ Column: 1, Line: 47, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "holtWinters_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 2, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "holtWinters_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 2, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "holtWinters_test.flux", Source: "import \"internal/promql\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "holtWinters_test.flux", Source: "\"internal/promql\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "internal/promql", }, }}, Metadata: "parser-type=rust", Name: "holtWinters_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "holtWinters_test.flux", Source: "package promql_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "holtWinters_test.flux", Source: "promql_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "promql_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 41, }, File: "hour_test.flux", Source: "package promql_test\nimport \"testing\"\nimport \"internal/promql\"\n\noption now = () =>\n\t(2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T00:00:00Z,metric_name,0,prometheus\r\n,,0,2018-02-04T01:00:00Z,metric_name,0,prometheus\r\n,,0,2018-03-05T02:00:00Z,metric_name,0,prometheus\r\n,,0,2018-10-06T21:00:00Z,metric_name,0,prometheus\r\n,,0,2018-11-07T22:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-08T23:00:00Z,metric_name,0,prometheus\r\n\"\noutData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,outData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T00:00:00Z,metric_name,0,prometheus\r\n,,0,2018-02-04T01:00:00Z,metric_name,1,prometheus\r\n,,0,2018-03-05T02:00:00Z,metric_name,2,prometheus\r\n,,0,2018-10-06T21:00:00Z,metric_name,21,prometheus\r\n,,0,2018-11-07T22:00:00Z,metric_name,22,prometheus\r\n,,0,2018-12-08T23:00:00Z,metric_name,23,prometheus\r\n\"\nt_promqlHour = (table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()\n\t\t|> map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlHour(timestamp: r._value)})))\n\ntest _promqlHour = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlHour})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "hour_test.flux", Source: "now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 5, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 5, }, File: "hour_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "hour_test.flux", Source: "() =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 5, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "hour_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 2, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 6, }, File: "hour_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 3, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "hour_test.flux", Source: "option now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 5, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "hour_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T00:00:00Z,metric_name,0,prometheus\r\n,,0,2018-02-04T01:00:00Z,metric_name,0,prometheus\r\n,,0,2018-03-05T02:00:00Z,metric_name,0,prometheus\r\n,,0,2018-10-06T21:00:00Z,metric_name,0,prometheus\r\n,,0,2018-11-07T22:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-08T23:00:00Z,metric_name,0,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "hour_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "hour_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T00:00:00Z,metric_name,0,prometheus\r\n,,0,2018-02-04T01:00:00Z,metric_name,0,prometheus\r\n,,0,2018-03-05T02:00:00Z,metric_name,0,prometheus\r\n,,0,2018-10-06T21:00:00Z,metric_name,0,prometheus\r\n,,0,2018-11-07T22:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-08T23:00:00Z,metric_name,0,prometheus\r\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T00:00:00Z,metric_name,0,prometheus\r\n,,0,2018-02-04T01:00:00Z,metric_name,0,prometheus\r\n,,0,2018-03-05T02:00:00Z,metric_name,0,prometheus\r\n,,0,2018-10-06T21:00:00Z,metric_name,0,prometheus\r\n,,0,2018-11-07T22:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-08T23:00:00Z,metric_name,0,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 31, }, File: "hour_test.flux", Source: "outData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,outData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T00:00:00Z,metric_name,0,prometheus\r\n,,0,2018-02-04T01:00:00Z,metric_name,1,prometheus\r\n,,0,2018-03-05T02:00:00Z,metric_name,2,prometheus\r\n,,0,2018-10-06T21:00:00Z,metric_name,21,prometheus\r\n,,0,2018-11-07T22:00:00Z,metric_name,22,prometheus\r\n,,0,2018-12-08T23:00:00Z,metric_name,23,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 20, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 20, }, File: "hour_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 20, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 31, }, File: "hour_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,outData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T00:00:00Z,metric_name,0,prometheus\r\n,,0,2018-02-04T01:00:00Z,metric_name,1,prometheus\r\n,,0,2018-03-05T02:00:00Z,metric_name,2,prometheus\r\n,,0,2018-10-06T21:00:00Z,metric_name,21,prometheus\r\n,,0,2018-11-07T22:00:00Z,metric_name,22,prometheus\r\n,,0,2018-12-08T23:00:00Z,metric_name,23,prometheus\r\n\"", Start: ast.Position{ Column: 11, Line: 20, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,outData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T00:00:00Z,metric_name,0,prometheus\r\n,,0,2018-02-04T01:00:00Z,metric_name,1,prometheus\r\n,,0,2018-03-05T02:00:00Z,metric_name,2,prometheus\r\n,,0,2018-10-06T21:00:00Z,metric_name,21,prometheus\r\n,,0,2018-11-07T22:00:00Z,metric_name,22,prometheus\r\n,,0,2018-12-08T23:00:00Z,metric_name,23,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 38, }, File: "hour_test.flux", Source: "t_promqlHour = (table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()\n\t\t|> map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlHour(timestamp: r._value)})))", Start: ast.Position{ Column: 1, Line: 32, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 13, Line: 32, }, File: "hour_test.flux", Source: "t_promqlHour", Start: ast.Position{ Column: 1, Line: 32, }, }, }, Name: "t_promqlHour", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 38, }, File: "hour_test.flux", Source: "(table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()\n\t\t|> map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlHour(timestamp: r._value)})))", Start: ast.Position{ Column: 16, Line: 32, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 38, }, File: "hour_test.flux", Source: "(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()\n\t\t|> map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlHour(timestamp: r._value)})))", Start: ast.Position{ Column: 2, Line: 33, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 33, }, File: "hour_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 33, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 34, }, File: "hour_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 33, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 34, }, File: "hour_test.flux", Source: "start: 1980-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 34, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 34, }, File: "hour_test.flux", Source: "start: 1980-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 34, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 34, }, File: "hour_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 34, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 34, }, File: "hour_test.flux", Source: "1980-01-01T00:00:00Z", Start: ast.Position{ Column: 19, Line: 34, }, }, }, Value: parser.MustParseTime("1980-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 34, }, File: "hour_test.flux", Source: "range(start: 1980-01-01T00:00:00Z)", Start: ast.Position{ Column: 6, Line: 34, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 34, }, File: "hour_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 34, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 35, }, File: "hour_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 3, Line: 33, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 35, }, File: "hour_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 11, Line: 35, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 35, }, File: "hour_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 11, Line: 35, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 35, }, File: "hour_test.flux", Source: "columns", Start: ast.Position{ Column: 11, Line: 35, }, }, }, Name: "columns", }, Separator: nil, Value: &ast.ArrayExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 35, }, File: "hour_test.flux", Source: "[\"_start\", \"_stop\"]", Start: ast.Position{ Column: 20, Line: 35, }, }, }, Elements: []ast.Expression{&ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 35, }, File: "hour_test.flux", Source: "\"_start\"", Start: ast.Position{ Column: 21, Line: 35, }, }, }, Value: "_start", }, &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 38, Line: 35, }, File: "hour_test.flux", Source: "\"_stop\"", Start: ast.Position{ Column: 31, Line: 35, }, }, }, Value: "_stop", }}, Lbrack: nil, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 35, }, File: "hour_test.flux", Source: "drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 6, Line: 35, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 35, }, File: "hour_test.flux", Source: "drop", Start: ast.Position{ Column: 6, Line: 35, }, }, }, Name: "drop", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 36, }, File: "hour_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()", Start: ast.Position{ Column: 3, Line: 33, }, }, }, Call: &ast.CallExpression{ Arguments: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 36, }, File: "hour_test.flux", Source: "promql.timestamp()", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 36, }, File: "hour_test.flux", Source: "promql.timestamp", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 36, }, File: "hour_test.flux", Source: "promql", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Name: "promql", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 36, }, File: "hour_test.flux", Source: "timestamp", Start: ast.Position{ Column: 13, Line: 36, }, }, }, Name: "timestamp", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 38, }, File: "hour_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()\n\t\t|> map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlHour(timestamp: r._value)}))", Start: ast.Position{ Column: 3, Line: 33, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 38, }, File: "hour_test.flux", Source: "fn: (r) =>\n\t\t\t({r with _value: promql.promqlHour(timestamp: r._value)})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 38, }, File: "hour_test.flux", Source: "fn: (r) =>\n\t\t\t({r with _value: promql.promqlHour(timestamp: r._value)})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 37, }, File: "hour_test.flux", Source: "fn", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 38, }, File: "hour_test.flux", Source: "(r) =>\n\t\t\t({r with _value: promql.promqlHour(timestamp: r._value)})", Start: ast.Position{ Column: 14, Line: 37, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 38, }, File: "hour_test.flux", Source: "({r with _value: promql.promqlHour(timestamp: r._value)})", Start: ast.Position{ Column: 4, Line: 38, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 38, }, File: "hour_test.flux", Source: "{r with _value: promql.promqlHour(timestamp: r._value)}", Start: ast.Position{ Column: 5, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 38, }, File: "hour_test.flux", Source: "_value: promql.promqlHour(timestamp: r._value)", Start: ast.Position{ Column: 13, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 38, }, File: "hour_test.flux", Source: "_value", Start: ast.Position{ Column: 13, Line: 38, }, }, }, Name: "_value", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 38, }, File: "hour_test.flux", Source: "timestamp: r._value", Start: ast.Position{ Column: 39, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 38, }, File: "hour_test.flux", Source: "timestamp: r._value", Start: ast.Position{ Column: 39, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 38, }, File: "hour_test.flux", Source: "timestamp", Start: ast.Position{ Column: 39, Line: 38, }, }, }, Name: "timestamp", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 38, }, File: "hour_test.flux", Source: "r._value", Start: ast.Position{ Column: 50, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 51, Line: 38, }, File: "hour_test.flux", Source: "r", Start: ast.Position{ Column: 50, Line: 38, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 38, }, File: "hour_test.flux", Source: "_value", Start: ast.Position{ Column: 52, Line: 38, }, }, }, Name: "_value", }, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 38, }, File: "hour_test.flux", Source: "promql.promqlHour(timestamp: r._value)", Start: ast.Position{ Column: 21, Line: 38, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 38, Line: 38, }, File: "hour_test.flux", Source: "promql.promqlHour", Start: ast.Position{ Column: 21, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 38, }, File: "hour_test.flux", Source: "promql", Start: ast.Position{ Column: 21, Line: 38, }, }, }, Name: "promql", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 38, Line: 38, }, File: "hour_test.flux", Source: "promqlHour", Start: ast.Position{ Column: 28, Line: 38, }, }, }, Name: "promqlHour", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }}, Rbrace: nil, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 38, }, File: "hour_test.flux", Source: "r", Start: ast.Position{ Column: 6, Line: 38, }, }, }, Name: "r", }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "hour_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "hour_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Name: "r", }, Separator: nil, Value: nil, }}, Rparan: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 38, }, File: "hour_test.flux", Source: "map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlHour(timestamp: r._value)}))", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 37, }, File: "hour_test.flux", Source: "map", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Name: "map", }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 32, }, File: "hour_test.flux", Source: "table=<-", Start: ast.Position{ Column: 17, Line: 32, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 32, }, File: "hour_test.flux", Source: "table", Start: ast.Position{ Column: 17, Line: 32, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 32, }, File: "hour_test.flux", Source: "<-", Start: ast.Position{ Column: 23, Line: 32, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 41, }, File: "hour_test.flux", Source: "_promqlHour = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlHour})", Start: ast.Position{ Column: 6, Line: 40, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 40, }, File: "hour_test.flux", Source: "_promqlHour", Start: ast.Position{ Column: 6, Line: 40, }, }, }, Name: "_promqlHour", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 41, }, File: "hour_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlHour})", Start: ast.Position{ Column: 20, Line: 40, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 41, }, File: "hour_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlHour})", Start: ast.Position{ Column: 2, Line: 41, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 41, }, File: "hour_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlHour}", Start: ast.Position{ Column: 3, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 41, }, File: "hour_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 41, }, File: "hour_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 41, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 41, }, File: "hour_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 41, }, File: "hour_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 41, }, File: "hour_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 41, }, File: "hour_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 41, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 41, }, File: "hour_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 41, }, File: "hour_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 41, }, File: "hour_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 41, }, File: "hour_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 41, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 41, }, File: "hour_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 41, }, File: "hour_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 41, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 41, }, File: "hour_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 41, }, File: "hour_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 41, }, File: "hour_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 41, }, File: "hour_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 41, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 41, }, File: "hour_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 41, }, File: "hour_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 41, }, File: "hour_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 41, }, File: "hour_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 41, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 41, }, File: "hour_test.flux", Source: "fn: t_promqlHour", Start: ast.Position{ Column: 82, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 41, }, File: "hour_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 41, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 41, }, File: "hour_test.flux", Source: "t_promqlHour", Start: ast.Position{ Column: 86, Line: 41, }, }, }, Name: "t_promqlHour", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 41, }, File: "hour_test.flux", Source: "test _promqlHour = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlHour})", Start: ast.Position{ Column: 1, Line: 40, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "hour_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 2, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "hour_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 2, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "hour_test.flux", Source: "import \"internal/promql\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "hour_test.flux", Source: "\"internal/promql\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "internal/promql", }, }}, Metadata: "parser-type=rust", Name: "hour_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "hour_test.flux", Source: "package promql_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "hour_test.flux", Source: "promql_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "promql_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 48, }, File: "instantRate_test.flux", Source: "package promql_test\nimport \"testing\"\nimport \"internal/promql\"\n\noption now = () =>\n\t(2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:53Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:03Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:13Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:23Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:53Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:53:03Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:13Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:23Z,metric_name2,100,prometheus\r\n,,2,2018-12-18T20:52:33Z,metric_name3,100,prometheus\r\n,,2,2018-12-18T20:52:43Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:52:53Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:03Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:53:13Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:23Z,metric_name3,400,prometheus\r\n,,3,2018-12-18T20:52:33Z,metric_name4,100,prometheus\r\n\"\noutData = \"\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_start,_stop,_field,_value,_measurement\r\n,,0,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name1,0,prometheus\r\n,,1,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name2,0,prometheus\r\n,,2,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name3,10,prometheus\r\n\"\nt_instantRate = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)\n\t\t|> promql.instantRate(isRate: true))\n\ntest _instantRate = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_instantRate})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "instantRate_test.flux", Source: "now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 5, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 5, }, File: "instantRate_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "instantRate_test.flux", Source: "() =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 5, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "instantRate_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 2, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 6, }, File: "instantRate_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 3, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "instantRate_test.flux", Source: "option now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 5, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 32, }, File: "instantRate_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:53Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:03Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:13Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:23Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:53Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:53:03Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:13Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:23Z,metric_name2,100,prometheus\r\n,,2,2018-12-18T20:52:33Z,metric_name3,100,prometheus\r\n,,2,2018-12-18T20:52:43Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:52:53Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:03Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:53:13Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:23Z,metric_name3,400,prometheus\r\n,,3,2018-12-18T20:52:33Z,metric_name4,100,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "instantRate_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 32, }, File: "instantRate_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:53Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:03Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:13Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:23Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:53Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:53:03Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:13Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:23Z,metric_name2,100,prometheus\r\n,,2,2018-12-18T20:52:33Z,metric_name3,100,prometheus\r\n,,2,2018-12-18T20:52:43Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:52:53Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:03Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:53:13Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:23Z,metric_name3,400,prometheus\r\n,,3,2018-12-18T20:52:33Z,metric_name4,100,prometheus\r\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:53Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:03Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:13Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:23Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:53Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:53:03Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:13Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:23Z,metric_name2,100,prometheus\r\n,,2,2018-12-18T20:52:33Z,metric_name3,100,prometheus\r\n,,2,2018-12-18T20:52:43Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:52:53Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:03Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:53:13Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:23Z,metric_name3,400,prometheus\r\n,,3,2018-12-18T20:52:33Z,metric_name4,100,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 41, }, File: "instantRate_test.flux", Source: "outData = \"\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_start,_stop,_field,_value,_measurement\r\n,,0,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name1,0,prometheus\r\n,,1,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name2,0,prometheus\r\n,,2,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name3,10,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 33, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 33, }, File: "instantRate_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 33, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 41, }, File: "instantRate_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_start,_stop,_field,_value,_measurement\r\n,,0,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name1,0,prometheus\r\n,,1,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name2,0,prometheus\r\n,,2,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name3,10,prometheus\r\n\"", Start: ast.Position{ Column: 11, Line: 33, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_start,_stop,_field,_value,_measurement\r\n,,0,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name1,0,prometheus\r\n,,1,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name2,0,prometheus\r\n,,2,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name3,10,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 45, }, File: "instantRate_test.flux", Source: "t_instantRate = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)\n\t\t|> promql.instantRate(isRate: true))", Start: ast.Position{ Column: 1, Line: 42, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 42, }, File: "instantRate_test.flux", Source: "t_instantRate", Start: ast.Position{ Column: 1, Line: 42, }, }, }, Name: "t_instantRate", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 45, }, File: "instantRate_test.flux", Source: "(table=<-) =>\n\t(table\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)\n\t\t|> promql.instantRate(isRate: true))", Start: ast.Position{ Column: 17, Line: 42, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 45, }, File: "instantRate_test.flux", Source: "(table\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)\n\t\t|> promql.instantRate(isRate: true))", Start: ast.Position{ Column: 2, Line: 43, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 43, }, File: "instantRate_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 43, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 44, }, File: "instantRate_test.flux", Source: "table\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)", Start: ast.Position{ Column: 3, Line: 43, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 44, }, File: "instantRate_test.flux", Source: "start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z", Start: ast.Position{ Column: 12, Line: 44, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 44, }, File: "instantRate_test.flux", Source: "start: 2018-12-18T20:50:00Z", Start: ast.Position{ Column: 12, Line: 44, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 44, }, File: "instantRate_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 44, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 44, }, File: "instantRate_test.flux", Source: "2018-12-18T20:50:00Z", Start: ast.Position{ Column: 19, Line: 44, }, }, }, Value: parser.MustParseTime("2018-12-18T20:50:00Z"), }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 44, }, File: "instantRate_test.flux", Source: "stop: 2018-12-18T20:55:00Z", Start: ast.Position{ Column: 41, Line: 44, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 44, }, File: "instantRate_test.flux", Source: "stop", Start: ast.Position{ Column: 41, Line: 44, }, }, }, Name: "stop", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 44, }, File: "instantRate_test.flux", Source: "2018-12-18T20:55:00Z", Start: ast.Position{ Column: 47, Line: 44, }, }, }, Value: parser.MustParseTime("2018-12-18T20:55:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 44, }, File: "instantRate_test.flux", Source: "range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)", Start: ast.Position{ Column: 6, Line: 44, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 44, }, File: "instantRate_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 44, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 38, Line: 45, }, File: "instantRate_test.flux", Source: "table\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)\n\t\t|> promql.instantRate(isRate: true)", Start: ast.Position{ Column: 3, Line: 43, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 45, }, File: "instantRate_test.flux", Source: "isRate: true", Start: ast.Position{ Column: 25, Line: 45, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 45, }, File: "instantRate_test.flux", Source: "isRate: true", Start: ast.Position{ Column: 25, Line: 45, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 45, }, File: "instantRate_test.flux", Source: "isRate", Start: ast.Position{ Column: 25, Line: 45, }, }, }, Name: "isRate", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 45, }, File: "instantRate_test.flux", Source: "true", Start: ast.Position{ Column: 33, Line: 45, }, }, }, Name: "true", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 38, Line: 45, }, File: "instantRate_test.flux", Source: "promql.instantRate(isRate: true)", Start: ast.Position{ Column: 6, Line: 45, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 45, }, File: "instantRate_test.flux", Source: "promql.instantRate", Start: ast.Position{ Column: 6, Line: 45, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 45, }, File: "instantRate_test.flux", Source: "promql", Start: ast.Position{ Column: 6, Line: 45, }, }, }, Name: "promql", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 45, }, File: "instantRate_test.flux", Source: "instantRate", Start: ast.Position{ Column: 13, Line: 45, }, }, }, Name: "instantRate", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 26, Line: 42, }, File: "instantRate_test.flux", Source: "table=<-", Start: ast.Position{ Column: 18, Line: 42, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 42, }, File: "instantRate_test.flux", Source: "table", Start: ast.Position{ Column: 18, Line: 42, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 26, Line: 42, }, File: "instantRate_test.flux", Source: "<-", Start: ast.Position{ Column: 24, Line: 42, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 48, }, File: "instantRate_test.flux", Source: "_instantRate = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_instantRate})", Start: ast.Position{ Column: 6, Line: 47, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 47, }, File: "instantRate_test.flux", Source: "_instantRate", Start: ast.Position{ Column: 6, Line: 47, }, }, }, Name: "_instantRate", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 48, }, File: "instantRate_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_instantRate})", Start: ast.Position{ Column: 21, Line: 47, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 48, }, File: "instantRate_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_instantRate})", Start: ast.Position{ Column: 2, Line: 48, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 48, }, File: "instantRate_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_instantRate}", Start: ast.Position{ Column: 3, Line: 48, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 48, }, File: "instantRate_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 48, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 48, }, File: "instantRate_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 48, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 48, }, File: "instantRate_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 48, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 48, }, File: "instantRate_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 48, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 48, }, File: "instantRate_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 48, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 48, }, File: "instantRate_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 48, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 48, }, File: "instantRate_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 48, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 48, }, File: "instantRate_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 48, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 48, }, File: "instantRate_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 48, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 48, }, File: "instantRate_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 48, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 48, }, File: "instantRate_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 48, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 48, }, File: "instantRate_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 48, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 48, }, File: "instantRate_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 48, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 48, }, File: "instantRate_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 48, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 48, }, File: "instantRate_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 48, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 48, }, File: "instantRate_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 48, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 48, }, File: "instantRate_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 48, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 48, }, File: "instantRate_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 48, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 48, }, File: "instantRate_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 48, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 48, }, File: "instantRate_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 48, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 48, }, File: "instantRate_test.flux", Source: "fn: t_instantRate", Start: ast.Position{ Column: 82, Line: 48, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 48, }, File: "instantRate_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 48, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 48, }, File: "instantRate_test.flux", Source: "t_instantRate", Start: ast.Position{ Column: 86, Line: 48, }, }, }, Name: "t_instantRate", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 48, }, File: "instantRate_test.flux", Source: "test _instantRate = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_instantRate})", Start: ast.Position{ Column: 1, Line: 47, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "instantRate_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 2, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "instantRate_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 2, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "instantRate_test.flux", Source: "import \"internal/promql\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "instantRate_test.flux", Source: "\"internal/promql\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "internal/promql", }, }}, Metadata: "parser-type=rust", Name: "instantRate_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "instantRate_test.flux", Source: "package promql_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "instantRate_test.flux", Source: "promql_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "promql_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "labelReplace_empty_dst_test.flux", Source: "package promql_test\nimport \"testing\"\nimport \"internal/promql\"\n\noption now = () =>\n\t(2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,string,double,string\r\n#group,false,false,false,true,true,true,false,true\r\n#default,inData,,,,,,,\r\n,result,table,_time,_field,src,dst,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name,source-value-20,original-destination-value,4,prometheus\r\n\"\noutData = \"\n#datatype,string,long,string,string,double,string\r\n#group,false,false,true,true,false,true\r\n#default,outData,,,,,\r\n,result,table,_field,src,_value,_measurement\r\n,,0,metric_name,source-value-10,1,prometheus\r\n,,0,metric_name,source-value-10,2,prometheus\r\n,,1,metric_name,source-value-20,3,prometheus\r\n,,1,metric_name,source-value-20,4,prometheus\r\n\"\nt_labelReplace = (table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.labelReplace(\n\t\t\tsource: \"src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \".*\",\n\t\t\treplacement: \"\",\n\t\t))\n\ntest _labelReplace = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "labelReplace_empty_dst_test.flux", Source: "now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 5, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 5, }, File: "labelReplace_empty_dst_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "labelReplace_empty_dst_test.flux", Source: "() =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 5, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "labelReplace_empty_dst_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 2, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 6, }, File: "labelReplace_empty_dst_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 3, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "labelReplace_empty_dst_test.flux", Source: "option now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 5, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 17, }, File: "labelReplace_empty_dst_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,string,double,string\r\n#group,false,false,false,true,true,true,false,true\r\n#default,inData,,,,,,,\r\n,result,table,_time,_field,src,dst,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name,source-value-20,original-destination-value,4,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "labelReplace_empty_dst_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 17, }, File: "labelReplace_empty_dst_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,string,double,string\r\n#group,false,false,false,true,true,true,false,true\r\n#default,inData,,,,,,,\r\n,result,table,_time,_field,src,dst,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name,source-value-20,original-destination-value,4,prometheus\r\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,string,double,string\r\n#group,false,false,false,true,true,true,false,true\r\n#default,inData,,,,,,,\r\n,result,table,_time,_field,src,dst,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name,source-value-20,original-destination-value,4,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 27, }, File: "labelReplace_empty_dst_test.flux", Source: "outData = \"\n#datatype,string,long,string,string,double,string\r\n#group,false,false,true,true,false,true\r\n#default,outData,,,,,\r\n,result,table,_field,src,_value,_measurement\r\n,,0,metric_name,source-value-10,1,prometheus\r\n,,0,metric_name,source-value-10,2,prometheus\r\n,,1,metric_name,source-value-20,3,prometheus\r\n,,1,metric_name,source-value-20,4,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 18, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 18, }, File: "labelReplace_empty_dst_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 18, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 27, }, File: "labelReplace_empty_dst_test.flux", Source: "\"\n#datatype,string,long,string,string,double,string\r\n#group,false,false,true,true,false,true\r\n#default,outData,,,,,\r\n,result,table,_field,src,_value,_measurement\r\n,,0,metric_name,source-value-10,1,prometheus\r\n,,0,metric_name,source-value-10,2,prometheus\r\n,,1,metric_name,source-value-20,3,prometheus\r\n,,1,metric_name,source-value-20,4,prometheus\r\n\"", Start: ast.Position{ Column: 11, Line: 18, }, }, }, Value: "\n#datatype,string,long,string,string,double,string\r\n#group,false,false,true,true,false,true\r\n#default,outData,,,,,\r\n,result,table,_field,src,_value,_measurement\r\n,,0,metric_name,source-value-10,1,prometheus\r\n,,0,metric_name,source-value-10,2,prometheus\r\n,,1,metric_name,source-value-20,3,prometheus\r\n,,1,metric_name,source-value-20,4,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 5, Line: 37, }, File: "labelReplace_empty_dst_test.flux", Source: "t_labelReplace = (table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.labelReplace(\n\t\t\tsource: \"src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \".*\",\n\t\t\treplacement: \"\",\n\t\t))", Start: ast.Position{ Column: 1, Line: 28, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 28, }, File: "labelReplace_empty_dst_test.flux", Source: "t_labelReplace", Start: ast.Position{ Column: 1, Line: 28, }, }, }, Name: "t_labelReplace", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 5, Line: 37, }, File: "labelReplace_empty_dst_test.flux", Source: "(table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.labelReplace(\n\t\t\tsource: \"src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \".*\",\n\t\t\treplacement: \"\",\n\t\t))", Start: ast.Position{ Column: 18, Line: 28, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 5, Line: 37, }, File: "labelReplace_empty_dst_test.flux", Source: "(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.labelReplace(\n\t\t\tsource: \"src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \".*\",\n\t\t\treplacement: \"\",\n\t\t))", Start: ast.Position{ Column: 2, Line: 29, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 29, }, File: "labelReplace_empty_dst_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 29, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 30, }, File: "labelReplace_empty_dst_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 29, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 30, }, File: "labelReplace_empty_dst_test.flux", Source: "start: 1980-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 30, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 30, }, File: "labelReplace_empty_dst_test.flux", Source: "start: 1980-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 30, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 30, }, File: "labelReplace_empty_dst_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 30, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 30, }, File: "labelReplace_empty_dst_test.flux", Source: "1980-01-01T00:00:00Z", Start: ast.Position{ Column: 19, Line: 30, }, }, }, Value: parser.MustParseTime("1980-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 30, }, File: "labelReplace_empty_dst_test.flux", Source: "range(start: 1980-01-01T00:00:00Z)", Start: ast.Position{ Column: 6, Line: 30, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 30, }, File: "labelReplace_empty_dst_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 30, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 31, }, File: "labelReplace_empty_dst_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 3, Line: 29, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 31, }, File: "labelReplace_empty_dst_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 11, Line: 31, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 31, }, File: "labelReplace_empty_dst_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 11, Line: 31, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 31, }, File: "labelReplace_empty_dst_test.flux", Source: "columns", Start: ast.Position{ Column: 11, Line: 31, }, }, }, Name: "columns", }, Separator: nil, Value: &ast.ArrayExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 31, }, File: "labelReplace_empty_dst_test.flux", Source: "[\"_start\", \"_stop\"]", Start: ast.Position{ Column: 20, Line: 31, }, }, }, Elements: []ast.Expression{&ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 31, }, File: "labelReplace_empty_dst_test.flux", Source: "\"_start\"", Start: ast.Position{ Column: 21, Line: 31, }, }, }, Value: "_start", }, &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 38, Line: 31, }, File: "labelReplace_empty_dst_test.flux", Source: "\"_stop\"", Start: ast.Position{ Column: 31, Line: 31, }, }, }, Value: "_stop", }}, Lbrack: nil, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 31, }, File: "labelReplace_empty_dst_test.flux", Source: "drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 6, Line: 31, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 31, }, File: "labelReplace_empty_dst_test.flux", Source: "drop", Start: ast.Position{ Column: 6, Line: 31, }, }, }, Name: "drop", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 4, Line: 37, }, File: "labelReplace_empty_dst_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.labelReplace(\n\t\t\tsource: \"src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \".*\",\n\t\t\treplacement: \"\",\n\t\t)", Start: ast.Position{ Column: 3, Line: 29, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 36, }, File: "labelReplace_empty_dst_test.flux", Source: "source: \"src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \".*\",\n\t\t\treplacement: \"\"", Start: ast.Position{ Column: 4, Line: 33, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 33, }, File: "labelReplace_empty_dst_test.flux", Source: "source: \"src\"", Start: ast.Position{ Column: 4, Line: 33, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 33, }, File: "labelReplace_empty_dst_test.flux", Source: "source", Start: ast.Position{ Column: 4, Line: 33, }, }, }, Name: "source", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 33, }, File: "labelReplace_empty_dst_test.flux", Source: "\"src\"", Start: ast.Position{ Column: 12, Line: 33, }, }, }, Value: "src", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 34, }, File: "labelReplace_empty_dst_test.flux", Source: "destination: \"dst\"", Start: ast.Position{ Column: 4, Line: 34, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 34, }, File: "labelReplace_empty_dst_test.flux", Source: "destination", Start: ast.Position{ Column: 4, Line: 34, }, }, }, Name: "destination", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 34, }, File: "labelReplace_empty_dst_test.flux", Source: "\"dst\"", Start: ast.Position{ Column: 17, Line: 34, }, }, }, Value: "dst", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 35, }, File: "labelReplace_empty_dst_test.flux", Source: "regex: \".*\"", Start: ast.Position{ Column: 4, Line: 35, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 35, }, File: "labelReplace_empty_dst_test.flux", Source: "regex", Start: ast.Position{ Column: 4, Line: 35, }, }, }, Name: "regex", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 35, }, File: "labelReplace_empty_dst_test.flux", Source: "\".*\"", Start: ast.Position{ Column: 11, Line: 35, }, }, }, Value: ".*", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 36, }, File: "labelReplace_empty_dst_test.flux", Source: "replacement: \"\"", Start: ast.Position{ Column: 4, Line: 36, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 36, }, File: "labelReplace_empty_dst_test.flux", Source: "replacement", Start: ast.Position{ Column: 4, Line: 36, }, }, }, Name: "replacement", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 36, }, File: "labelReplace_empty_dst_test.flux", Source: "\"\"", Start: ast.Position{ Column: 17, Line: 36, }, }, }, Value: "", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 4, Line: 37, }, File: "labelReplace_empty_dst_test.flux", Source: "promql.labelReplace(\n\t\t\tsource: \"src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \".*\",\n\t\t\treplacement: \"\",\n\t\t)", Start: ast.Position{ Column: 6, Line: 32, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 32, }, File: "labelReplace_empty_dst_test.flux", Source: "promql.labelReplace", Start: ast.Position{ Column: 6, Line: 32, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 32, }, File: "labelReplace_empty_dst_test.flux", Source: "promql", Start: ast.Position{ Column: 6, Line: 32, }, }, }, Name: "promql", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 32, }, File: "labelReplace_empty_dst_test.flux", Source: "labelReplace", Start: ast.Position{ Column: 13, Line: 32, }, }, }, Name: "labelReplace", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 28, }, File: "labelReplace_empty_dst_test.flux", Source: "table=<-", Start: ast.Position{ Column: 19, Line: 28, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 28, }, File: "labelReplace_empty_dst_test.flux", Source: "table", Start: ast.Position{ Column: 19, Line: 28, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 28, }, File: "labelReplace_empty_dst_test.flux", Source: "<-", Start: ast.Position{ Column: 25, Line: 28, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "labelReplace_empty_dst_test.flux", Source: "_labelReplace = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace})", Start: ast.Position{ Column: 6, Line: 39, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 39, }, File: "labelReplace_empty_dst_test.flux", Source: "_labelReplace", Start: ast.Position{ Column: 6, Line: 39, }, }, }, Name: "_labelReplace", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "labelReplace_empty_dst_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace})", Start: ast.Position{ Column: 22, Line: 39, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "labelReplace_empty_dst_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace})", Start: ast.Position{ Column: 2, Line: 40, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 40, }, File: "labelReplace_empty_dst_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace}", Start: ast.Position{ Column: 3, Line: 40, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "labelReplace_empty_dst_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 40, }, File: "labelReplace_empty_dst_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "labelReplace_empty_dst_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "labelReplace_empty_dst_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 40, }, File: "labelReplace_empty_dst_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "labelReplace_empty_dst_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 40, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "labelReplace_empty_dst_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "labelReplace_empty_dst_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 40, }, File: "labelReplace_empty_dst_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "labelReplace_empty_dst_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 40, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "labelReplace_empty_dst_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 40, }, File: "labelReplace_empty_dst_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "labelReplace_empty_dst_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "labelReplace_empty_dst_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 40, }, File: "labelReplace_empty_dst_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "labelReplace_empty_dst_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 40, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "labelReplace_empty_dst_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "labelReplace_empty_dst_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 40, }, File: "labelReplace_empty_dst_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "labelReplace_empty_dst_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 40, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 40, }, File: "labelReplace_empty_dst_test.flux", Source: "fn: t_labelReplace", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 40, }, File: "labelReplace_empty_dst_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 40, }, File: "labelReplace_empty_dst_test.flux", Source: "t_labelReplace", Start: ast.Position{ Column: 86, Line: 40, }, }, }, Name: "t_labelReplace", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "labelReplace_empty_dst_test.flux", Source: "test _labelReplace = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace})", Start: ast.Position{ Column: 1, Line: 39, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "labelReplace_empty_dst_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 2, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "labelReplace_empty_dst_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 2, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "labelReplace_empty_dst_test.flux", Source: "import \"internal/promql\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "labelReplace_empty_dst_test.flux", Source: "\"internal/promql\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "internal/promql", }, }}, Metadata: "parser-type=rust", Name: "labelReplace_empty_dst_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "labelReplace_empty_dst_test.flux", Source: "package promql_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "labelReplace_empty_dst_test.flux", Source: "promql_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "promql_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "labelReplace_full_string_match_test.flux", Source: "package promql_test\nimport \"testing\"\nimport \"internal/promql\"\n\noption now = () =>\n\t(2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,string,double,string\r\n#group,false,false,false,true,true,true,false,true\r\n#default,inData,,,,,,,\r\n,result,table,_time,_field,src,dst,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name,source-value-20,original-destination-value,4,prometheus\r\n\"\noutData = \"\n#datatype,string,long,string,string,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_field,src,dst,_value,_measurement\r\n,,0,metric_name,source-value-10,destination-value-10,1,prometheus\r\n,,0,metric_name,source-value-10,destination-value-10,2,prometheus\r\n,,1,metric_name,source-value-20,destination-value-20,3,prometheus\r\n,,1,metric_name,source-value-20,destination-value-20,4,prometheus\r\n\"\nt_labelReplace = (table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.labelReplace(\n\t\t\tsource: \"src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"source-value-(.*)\",\n\t\t\treplacement: \"destination-value-$1\",\n\t\t))\n\ntest _labelReplace = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "labelReplace_full_string_match_test.flux", Source: "now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 5, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 5, }, File: "labelReplace_full_string_match_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "labelReplace_full_string_match_test.flux", Source: "() =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 5, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "labelReplace_full_string_match_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 2, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 6, }, File: "labelReplace_full_string_match_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 3, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "labelReplace_full_string_match_test.flux", Source: "option now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 5, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 17, }, File: "labelReplace_full_string_match_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,string,double,string\r\n#group,false,false,false,true,true,true,false,true\r\n#default,inData,,,,,,,\r\n,result,table,_time,_field,src,dst,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name,source-value-20,original-destination-value,4,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "labelReplace_full_string_match_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 17, }, File: "labelReplace_full_string_match_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,string,double,string\r\n#group,false,false,false,true,true,true,false,true\r\n#default,inData,,,,,,,\r\n,result,table,_time,_field,src,dst,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name,source-value-20,original-destination-value,4,prometheus\r\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,string,double,string\r\n#group,false,false,false,true,true,true,false,true\r\n#default,inData,,,,,,,\r\n,result,table,_time,_field,src,dst,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name,source-value-20,original-destination-value,4,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 27, }, File: "labelReplace_full_string_match_test.flux", Source: "outData = \"\n#datatype,string,long,string,string,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_field,src,dst,_value,_measurement\r\n,,0,metric_name,source-value-10,destination-value-10,1,prometheus\r\n,,0,metric_name,source-value-10,destination-value-10,2,prometheus\r\n,,1,metric_name,source-value-20,destination-value-20,3,prometheus\r\n,,1,metric_name,source-value-20,destination-value-20,4,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 18, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 18, }, File: "labelReplace_full_string_match_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 18, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 27, }, File: "labelReplace_full_string_match_test.flux", Source: "\"\n#datatype,string,long,string,string,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_field,src,dst,_value,_measurement\r\n,,0,metric_name,source-value-10,destination-value-10,1,prometheus\r\n,,0,metric_name,source-value-10,destination-value-10,2,prometheus\r\n,,1,metric_name,source-value-20,destination-value-20,3,prometheus\r\n,,1,metric_name,source-value-20,destination-value-20,4,prometheus\r\n\"", Start: ast.Position{ Column: 11, Line: 18, }, }, }, Value: "\n#datatype,string,long,string,string,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_field,src,dst,_value,_measurement\r\n,,0,metric_name,source-value-10,destination-value-10,1,prometheus\r\n,,0,metric_name,source-value-10,destination-value-10,2,prometheus\r\n,,1,metric_name,source-value-20,destination-value-20,3,prometheus\r\n,,1,metric_name,source-value-20,destination-value-20,4,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 5, Line: 37, }, File: "labelReplace_full_string_match_test.flux", Source: "t_labelReplace = (table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.labelReplace(\n\t\t\tsource: \"src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"source-value-(.*)\",\n\t\t\treplacement: \"destination-value-$1\",\n\t\t))", Start: ast.Position{ Column: 1, Line: 28, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 28, }, File: "labelReplace_full_string_match_test.flux", Source: "t_labelReplace", Start: ast.Position{ Column: 1, Line: 28, }, }, }, Name: "t_labelReplace", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 5, Line: 37, }, File: "labelReplace_full_string_match_test.flux", Source: "(table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.labelReplace(\n\t\t\tsource: \"src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"source-value-(.*)\",\n\t\t\treplacement: \"destination-value-$1\",\n\t\t))", Start: ast.Position{ Column: 18, Line: 28, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 5, Line: 37, }, File: "labelReplace_full_string_match_test.flux", Source: "(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.labelReplace(\n\t\t\tsource: \"src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"source-value-(.*)\",\n\t\t\treplacement: \"destination-value-$1\",\n\t\t))", Start: ast.Position{ Column: 2, Line: 29, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 29, }, File: "labelReplace_full_string_match_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 29, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 30, }, File: "labelReplace_full_string_match_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 29, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 30, }, File: "labelReplace_full_string_match_test.flux", Source: "start: 1980-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 30, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 30, }, File: "labelReplace_full_string_match_test.flux", Source: "start: 1980-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 30, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 30, }, File: "labelReplace_full_string_match_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 30, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 30, }, File: "labelReplace_full_string_match_test.flux", Source: "1980-01-01T00:00:00Z", Start: ast.Position{ Column: 19, Line: 30, }, }, }, Value: parser.MustParseTime("1980-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 30, }, File: "labelReplace_full_string_match_test.flux", Source: "range(start: 1980-01-01T00:00:00Z)", Start: ast.Position{ Column: 6, Line: 30, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 30, }, File: "labelReplace_full_string_match_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 30, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 31, }, File: "labelReplace_full_string_match_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 3, Line: 29, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 31, }, File: "labelReplace_full_string_match_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 11, Line: 31, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 31, }, File: "labelReplace_full_string_match_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 11, Line: 31, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 31, }, File: "labelReplace_full_string_match_test.flux", Source: "columns", Start: ast.Position{ Column: 11, Line: 31, }, }, }, Name: "columns", }, Separator: nil, Value: &ast.ArrayExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 31, }, File: "labelReplace_full_string_match_test.flux", Source: "[\"_start\", \"_stop\"]", Start: ast.Position{ Column: 20, Line: 31, }, }, }, Elements: []ast.Expression{&ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 31, }, File: "labelReplace_full_string_match_test.flux", Source: "\"_start\"", Start: ast.Position{ Column: 21, Line: 31, }, }, }, Value: "_start", }, &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 38, Line: 31, }, File: "labelReplace_full_string_match_test.flux", Source: "\"_stop\"", Start: ast.Position{ Column: 31, Line: 31, }, }, }, Value: "_stop", }}, Lbrack: nil, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 31, }, File: "labelReplace_full_string_match_test.flux", Source: "drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 6, Line: 31, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 31, }, File: "labelReplace_full_string_match_test.flux", Source: "drop", Start: ast.Position{ Column: 6, Line: 31, }, }, }, Name: "drop", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 4, Line: 37, }, File: "labelReplace_full_string_match_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.labelReplace(\n\t\t\tsource: \"src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"source-value-(.*)\",\n\t\t\treplacement: \"destination-value-$1\",\n\t\t)", Start: ast.Position{ Column: 3, Line: 29, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "labelReplace_full_string_match_test.flux", Source: "source: \"src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"source-value-(.*)\",\n\t\t\treplacement: \"destination-value-$1\"", Start: ast.Position{ Column: 4, Line: 33, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 33, }, File: "labelReplace_full_string_match_test.flux", Source: "source: \"src\"", Start: ast.Position{ Column: 4, Line: 33, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 33, }, File: "labelReplace_full_string_match_test.flux", Source: "source", Start: ast.Position{ Column: 4, Line: 33, }, }, }, Name: "source", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 33, }, File: "labelReplace_full_string_match_test.flux", Source: "\"src\"", Start: ast.Position{ Column: 12, Line: 33, }, }, }, Value: "src", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 34, }, File: "labelReplace_full_string_match_test.flux", Source: "destination: \"dst\"", Start: ast.Position{ Column: 4, Line: 34, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 34, }, File: "labelReplace_full_string_match_test.flux", Source: "destination", Start: ast.Position{ Column: 4, Line: 34, }, }, }, Name: "destination", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 34, }, File: "labelReplace_full_string_match_test.flux", Source: "\"dst\"", Start: ast.Position{ Column: 17, Line: 34, }, }, }, Value: "dst", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 35, }, File: "labelReplace_full_string_match_test.flux", Source: "regex: \"source-value-(.*)\"", Start: ast.Position{ Column: 4, Line: 35, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 35, }, File: "labelReplace_full_string_match_test.flux", Source: "regex", Start: ast.Position{ Column: 4, Line: 35, }, }, }, Name: "regex", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 35, }, File: "labelReplace_full_string_match_test.flux", Source: "\"source-value-(.*)\"", Start: ast.Position{ Column: 11, Line: 35, }, }, }, Value: "source-value-(.*)", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "labelReplace_full_string_match_test.flux", Source: "replacement: \"destination-value-$1\"", Start: ast.Position{ Column: 4, Line: 36, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 36, }, File: "labelReplace_full_string_match_test.flux", Source: "replacement", Start: ast.Position{ Column: 4, Line: 36, }, }, }, Name: "replacement", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "labelReplace_full_string_match_test.flux", Source: "\"destination-value-$1\"", Start: ast.Position{ Column: 17, Line: 36, }, }, }, Value: "destination-value-$1", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 4, Line: 37, }, File: "labelReplace_full_string_match_test.flux", Source: "promql.labelReplace(\n\t\t\tsource: \"src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"source-value-(.*)\",\n\t\t\treplacement: \"destination-value-$1\",\n\t\t)", Start: ast.Position{ Column: 6, Line: 32, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 32, }, File: "labelReplace_full_string_match_test.flux", Source: "promql.labelReplace", Start: ast.Position{ Column: 6, Line: 32, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 32, }, File: "labelReplace_full_string_match_test.flux", Source: "promql", Start: ast.Position{ Column: 6, Line: 32, }, }, }, Name: "promql", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 32, }, File: "labelReplace_full_string_match_test.flux", Source: "labelReplace", Start: ast.Position{ Column: 13, Line: 32, }, }, }, Name: "labelReplace", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 28, }, File: "labelReplace_full_string_match_test.flux", Source: "table=<-", Start: ast.Position{ Column: 19, Line: 28, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 28, }, File: "labelReplace_full_string_match_test.flux", Source: "table", Start: ast.Position{ Column: 19, Line: 28, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 28, }, File: "labelReplace_full_string_match_test.flux", Source: "<-", Start: ast.Position{ Column: 25, Line: 28, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "labelReplace_full_string_match_test.flux", Source: "_labelReplace = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace})", Start: ast.Position{ Column: 6, Line: 39, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 39, }, File: "labelReplace_full_string_match_test.flux", Source: "_labelReplace", Start: ast.Position{ Column: 6, Line: 39, }, }, }, Name: "_labelReplace", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "labelReplace_full_string_match_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace})", Start: ast.Position{ Column: 22, Line: 39, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "labelReplace_full_string_match_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace})", Start: ast.Position{ Column: 2, Line: 40, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 40, }, File: "labelReplace_full_string_match_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace}", Start: ast.Position{ Column: 3, Line: 40, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "labelReplace_full_string_match_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 40, }, File: "labelReplace_full_string_match_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "labelReplace_full_string_match_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "labelReplace_full_string_match_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 40, }, File: "labelReplace_full_string_match_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "labelReplace_full_string_match_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 40, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "labelReplace_full_string_match_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "labelReplace_full_string_match_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 40, }, File: "labelReplace_full_string_match_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "labelReplace_full_string_match_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 40, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "labelReplace_full_string_match_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 40, }, File: "labelReplace_full_string_match_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "labelReplace_full_string_match_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "labelReplace_full_string_match_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 40, }, File: "labelReplace_full_string_match_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "labelReplace_full_string_match_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 40, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "labelReplace_full_string_match_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "labelReplace_full_string_match_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 40, }, File: "labelReplace_full_string_match_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "labelReplace_full_string_match_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 40, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 40, }, File: "labelReplace_full_string_match_test.flux", Source: "fn: t_labelReplace", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 40, }, File: "labelReplace_full_string_match_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 40, }, File: "labelReplace_full_string_match_test.flux", Source: "t_labelReplace", Start: ast.Position{ Column: 86, Line: 40, }, }, }, Name: "t_labelReplace", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "labelReplace_full_string_match_test.flux", Source: "test _labelReplace = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace})", Start: ast.Position{ Column: 1, Line: 39, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "labelReplace_full_string_match_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 2, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "labelReplace_full_string_match_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 2, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "labelReplace_full_string_match_test.flux", Source: "import \"internal/promql\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "labelReplace_full_string_match_test.flux", Source: "\"internal/promql\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "internal/promql", }, }}, Metadata: "parser-type=rust", Name: "labelReplace_full_string_match_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "labelReplace_full_string_match_test.flux", Source: "package promql_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "labelReplace_full_string_match_test.flux", Source: "promql_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "promql_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "labelReplace_multiple_groups_test.flux", Source: "package promql_test\nimport \"testing\"\nimport \"internal/promql\"\n\noption now = () =>\n\t(2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,string,double,string\r\n#group,false,false,false,true,true,true,false,true\r\n#default,inData,,,,,,,\r\n,result,table,_time,_field,src,dst,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name,source-value-20,original-destination-value,4,prometheus\r\n\"\noutData = \"\n#datatype,string,long,string,string,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_field,src,dst,_value,_measurement\r\n,,0,metric_name,source-value-10,source-value-10,1,prometheus\r\n,,0,metric_name,source-value-10,source-value-10,2,prometheus\r\n,,1,metric_name,source-value-20,source-value-20,3,prometheus\r\n,,1,metric_name,source-value-20,source-value-20,4,prometheus\r\n\"\nt_labelReplace = (table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.labelReplace(\n\t\t\tsource: \"src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"(.*)-value-(.*)\",\n\t\t\treplacement: \"$1-value-$2\",\n\t\t))\n\ntest _labelReplace = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "labelReplace_multiple_groups_test.flux", Source: "now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 5, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 5, }, File: "labelReplace_multiple_groups_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "labelReplace_multiple_groups_test.flux", Source: "() =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 5, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "labelReplace_multiple_groups_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 2, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 6, }, File: "labelReplace_multiple_groups_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 3, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "labelReplace_multiple_groups_test.flux", Source: "option now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 5, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 17, }, File: "labelReplace_multiple_groups_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,string,double,string\r\n#group,false,false,false,true,true,true,false,true\r\n#default,inData,,,,,,,\r\n,result,table,_time,_field,src,dst,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name,source-value-20,original-destination-value,4,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "labelReplace_multiple_groups_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 17, }, File: "labelReplace_multiple_groups_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,string,double,string\r\n#group,false,false,false,true,true,true,false,true\r\n#default,inData,,,,,,,\r\n,result,table,_time,_field,src,dst,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name,source-value-20,original-destination-value,4,prometheus\r\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,string,double,string\r\n#group,false,false,false,true,true,true,false,true\r\n#default,inData,,,,,,,\r\n,result,table,_time,_field,src,dst,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name,source-value-20,original-destination-value,4,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 27, }, File: "labelReplace_multiple_groups_test.flux", Source: "outData = \"\n#datatype,string,long,string,string,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_field,src,dst,_value,_measurement\r\n,,0,metric_name,source-value-10,source-value-10,1,prometheus\r\n,,0,metric_name,source-value-10,source-value-10,2,prometheus\r\n,,1,metric_name,source-value-20,source-value-20,3,prometheus\r\n,,1,metric_name,source-value-20,source-value-20,4,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 18, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 18, }, File: "labelReplace_multiple_groups_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 18, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 27, }, File: "labelReplace_multiple_groups_test.flux", Source: "\"\n#datatype,string,long,string,string,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_field,src,dst,_value,_measurement\r\n,,0,metric_name,source-value-10,source-value-10,1,prometheus\r\n,,0,metric_name,source-value-10,source-value-10,2,prometheus\r\n,,1,metric_name,source-value-20,source-value-20,3,prometheus\r\n,,1,metric_name,source-value-20,source-value-20,4,prometheus\r\n\"", Start: ast.Position{ Column: 11, Line: 18, }, }, }, Value: "\n#datatype,string,long,string,string,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_field,src,dst,_value,_measurement\r\n,,0,metric_name,source-value-10,source-value-10,1,prometheus\r\n,,0,metric_name,source-value-10,source-value-10,2,prometheus\r\n,,1,metric_name,source-value-20,source-value-20,3,prometheus\r\n,,1,metric_name,source-value-20,source-value-20,4,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 5, Line: 37, }, File: "labelReplace_multiple_groups_test.flux", Source: "t_labelReplace = (table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.labelReplace(\n\t\t\tsource: \"src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"(.*)-value-(.*)\",\n\t\t\treplacement: \"$1-value-$2\",\n\t\t))", Start: ast.Position{ Column: 1, Line: 28, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 28, }, File: "labelReplace_multiple_groups_test.flux", Source: "t_labelReplace", Start: ast.Position{ Column: 1, Line: 28, }, }, }, Name: "t_labelReplace", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 5, Line: 37, }, File: "labelReplace_multiple_groups_test.flux", Source: "(table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.labelReplace(\n\t\t\tsource: \"src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"(.*)-value-(.*)\",\n\t\t\treplacement: \"$1-value-$2\",\n\t\t))", Start: ast.Position{ Column: 18, Line: 28, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 5, Line: 37, }, File: "labelReplace_multiple_groups_test.flux", Source: "(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.labelReplace(\n\t\t\tsource: \"src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"(.*)-value-(.*)\",\n\t\t\treplacement: \"$1-value-$2\",\n\t\t))", Start: ast.Position{ Column: 2, Line: 29, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 29, }, File: "labelReplace_multiple_groups_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 29, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 30, }, File: "labelReplace_multiple_groups_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 29, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 30, }, File: "labelReplace_multiple_groups_test.flux", Source: "start: 1980-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 30, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 30, }, File: "labelReplace_multiple_groups_test.flux", Source: "start: 1980-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 30, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 30, }, File: "labelReplace_multiple_groups_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 30, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 30, }, File: "labelReplace_multiple_groups_test.flux", Source: "1980-01-01T00:00:00Z", Start: ast.Position{ Column: 19, Line: 30, }, }, }, Value: parser.MustParseTime("1980-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 30, }, File: "labelReplace_multiple_groups_test.flux", Source: "range(start: 1980-01-01T00:00:00Z)", Start: ast.Position{ Column: 6, Line: 30, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 30, }, File: "labelReplace_multiple_groups_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 30, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 31, }, File: "labelReplace_multiple_groups_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 3, Line: 29, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 31, }, File: "labelReplace_multiple_groups_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 11, Line: 31, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 31, }, File: "labelReplace_multiple_groups_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 11, Line: 31, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 31, }, File: "labelReplace_multiple_groups_test.flux", Source: "columns", Start: ast.Position{ Column: 11, Line: 31, }, }, }, Name: "columns", }, Separator: nil, Value: &ast.ArrayExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 31, }, File: "labelReplace_multiple_groups_test.flux", Source: "[\"_start\", \"_stop\"]", Start: ast.Position{ Column: 20, Line: 31, }, }, }, Elements: []ast.Expression{&ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 31, }, File: "labelReplace_multiple_groups_test.flux", Source: "\"_start\"", Start: ast.Position{ Column: 21, Line: 31, }, }, }, Value: "_start", }, &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 38, Line: 31, }, File: "labelReplace_multiple_groups_test.flux", Source: "\"_stop\"", Start: ast.Position{ Column: 31, Line: 31, }, }, }, Value: "_stop", }}, Lbrack: nil, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 31, }, File: "labelReplace_multiple_groups_test.flux", Source: "drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 6, Line: 31, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 31, }, File: "labelReplace_multiple_groups_test.flux", Source: "drop", Start: ast.Position{ Column: 6, Line: 31, }, }, }, Name: "drop", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 4, Line: 37, }, File: "labelReplace_multiple_groups_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.labelReplace(\n\t\t\tsource: \"src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"(.*)-value-(.*)\",\n\t\t\treplacement: \"$1-value-$2\",\n\t\t)", Start: ast.Position{ Column: 3, Line: 29, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 36, }, File: "labelReplace_multiple_groups_test.flux", Source: "source: \"src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"(.*)-value-(.*)\",\n\t\t\treplacement: \"$1-value-$2\"", Start: ast.Position{ Column: 4, Line: 33, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 33, }, File: "labelReplace_multiple_groups_test.flux", Source: "source: \"src\"", Start: ast.Position{ Column: 4, Line: 33, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 33, }, File: "labelReplace_multiple_groups_test.flux", Source: "source", Start: ast.Position{ Column: 4, Line: 33, }, }, }, Name: "source", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 33, }, File: "labelReplace_multiple_groups_test.flux", Source: "\"src\"", Start: ast.Position{ Column: 12, Line: 33, }, }, }, Value: "src", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 34, }, File: "labelReplace_multiple_groups_test.flux", Source: "destination: \"dst\"", Start: ast.Position{ Column: 4, Line: 34, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 34, }, File: "labelReplace_multiple_groups_test.flux", Source: "destination", Start: ast.Position{ Column: 4, Line: 34, }, }, }, Name: "destination", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 34, }, File: "labelReplace_multiple_groups_test.flux", Source: "\"dst\"", Start: ast.Position{ Column: 17, Line: 34, }, }, }, Value: "dst", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 35, }, File: "labelReplace_multiple_groups_test.flux", Source: "regex: \"(.*)-value-(.*)\"", Start: ast.Position{ Column: 4, Line: 35, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 35, }, File: "labelReplace_multiple_groups_test.flux", Source: "regex", Start: ast.Position{ Column: 4, Line: 35, }, }, }, Name: "regex", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 35, }, File: "labelReplace_multiple_groups_test.flux", Source: "\"(.*)-value-(.*)\"", Start: ast.Position{ Column: 11, Line: 35, }, }, }, Value: "(.*)-value-(.*)", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 36, }, File: "labelReplace_multiple_groups_test.flux", Source: "replacement: \"$1-value-$2\"", Start: ast.Position{ Column: 4, Line: 36, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 36, }, File: "labelReplace_multiple_groups_test.flux", Source: "replacement", Start: ast.Position{ Column: 4, Line: 36, }, }, }, Name: "replacement", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 36, }, File: "labelReplace_multiple_groups_test.flux", Source: "\"$1-value-$2\"", Start: ast.Position{ Column: 17, Line: 36, }, }, }, Value: "$1-value-$2", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 4, Line: 37, }, File: "labelReplace_multiple_groups_test.flux", Source: "promql.labelReplace(\n\t\t\tsource: \"src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"(.*)-value-(.*)\",\n\t\t\treplacement: \"$1-value-$2\",\n\t\t)", Start: ast.Position{ Column: 6, Line: 32, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 32, }, File: "labelReplace_multiple_groups_test.flux", Source: "promql.labelReplace", Start: ast.Position{ Column: 6, Line: 32, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 32, }, File: "labelReplace_multiple_groups_test.flux", Source: "promql", Start: ast.Position{ Column: 6, Line: 32, }, }, }, Name: "promql", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 32, }, File: "labelReplace_multiple_groups_test.flux", Source: "labelReplace", Start: ast.Position{ Column: 13, Line: 32, }, }, }, Name: "labelReplace", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 28, }, File: "labelReplace_multiple_groups_test.flux", Source: "table=<-", Start: ast.Position{ Column: 19, Line: 28, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 28, }, File: "labelReplace_multiple_groups_test.flux", Source: "table", Start: ast.Position{ Column: 19, Line: 28, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 28, }, File: "labelReplace_multiple_groups_test.flux", Source: "<-", Start: ast.Position{ Column: 25, Line: 28, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "labelReplace_multiple_groups_test.flux", Source: "_labelReplace = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace})", Start: ast.Position{ Column: 6, Line: 39, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 39, }, File: "labelReplace_multiple_groups_test.flux", Source: "_labelReplace", Start: ast.Position{ Column: 6, Line: 39, }, }, }, Name: "_labelReplace", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "labelReplace_multiple_groups_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace})", Start: ast.Position{ Column: 22, Line: 39, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "labelReplace_multiple_groups_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace})", Start: ast.Position{ Column: 2, Line: 40, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 40, }, File: "labelReplace_multiple_groups_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace}", Start: ast.Position{ Column: 3, Line: 40, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "labelReplace_multiple_groups_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 40, }, File: "labelReplace_multiple_groups_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "labelReplace_multiple_groups_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "labelReplace_multiple_groups_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 40, }, File: "labelReplace_multiple_groups_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "labelReplace_multiple_groups_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 40, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "labelReplace_multiple_groups_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "labelReplace_multiple_groups_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 40, }, File: "labelReplace_multiple_groups_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "labelReplace_multiple_groups_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 40, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "labelReplace_multiple_groups_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 40, }, File: "labelReplace_multiple_groups_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "labelReplace_multiple_groups_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "labelReplace_multiple_groups_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 40, }, File: "labelReplace_multiple_groups_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "labelReplace_multiple_groups_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 40, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "labelReplace_multiple_groups_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "labelReplace_multiple_groups_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 40, }, File: "labelReplace_multiple_groups_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "labelReplace_multiple_groups_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 40, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 40, }, File: "labelReplace_multiple_groups_test.flux", Source: "fn: t_labelReplace", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 40, }, File: "labelReplace_multiple_groups_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 40, }, File: "labelReplace_multiple_groups_test.flux", Source: "t_labelReplace", Start: ast.Position{ Column: 86, Line: 40, }, }, }, Name: "t_labelReplace", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "labelReplace_multiple_groups_test.flux", Source: "test _labelReplace = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace})", Start: ast.Position{ Column: 1, Line: 39, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "labelReplace_multiple_groups_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 2, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "labelReplace_multiple_groups_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 2, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "labelReplace_multiple_groups_test.flux", Source: "import \"internal/promql\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "labelReplace_multiple_groups_test.flux", Source: "\"internal/promql\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "internal/promql", }, }}, Metadata: "parser-type=rust", Name: "labelReplace_multiple_groups_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "labelReplace_multiple_groups_test.flux", Source: "package promql_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "labelReplace_multiple_groups_test.flux", Source: "promql_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "promql_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "labelReplace_src_empty_test.flux", Source: "package promql_test\nimport \"testing\"\nimport \"internal/promql\"\n\noption now = () =>\n\t(2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,string,double,string\r\n#group,false,false,false,true,true,true,false,true\r\n#default,inData,,,,,,,\r\n,result,table,_time,_field,src,dst,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name,source-value-20,original-destination-value,4,prometheus\r\n\"\noutData = \"\n#datatype,string,long,string,string,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_field,src,dst,_value,_measurement\r\n,,0,metric_name,source-value-10,value-,1,prometheus\r\n,,0,metric_name,source-value-10,value-,2,prometheus\r\n,,1,metric_name,source-value-20,value-,3,prometheus\r\n,,1,metric_name,source-value-20,value-,4,prometheus\r\n\"\nt_labelReplace = (table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.labelReplace(\n\t\t\tsource: \"nonexistent-src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"(.*)\",\n\t\t\treplacement: \"value-$1\",\n\t\t))\n\ntest _labelReplace = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "labelReplace_src_empty_test.flux", Source: "now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 5, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 5, }, File: "labelReplace_src_empty_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "labelReplace_src_empty_test.flux", Source: "() =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 5, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "labelReplace_src_empty_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 2, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 6, }, File: "labelReplace_src_empty_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 3, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "labelReplace_src_empty_test.flux", Source: "option now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 5, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 17, }, File: "labelReplace_src_empty_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,string,double,string\r\n#group,false,false,false,true,true,true,false,true\r\n#default,inData,,,,,,,\r\n,result,table,_time,_field,src,dst,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name,source-value-20,original-destination-value,4,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "labelReplace_src_empty_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 17, }, File: "labelReplace_src_empty_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,string,double,string\r\n#group,false,false,false,true,true,true,false,true\r\n#default,inData,,,,,,,\r\n,result,table,_time,_field,src,dst,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name,source-value-20,original-destination-value,4,prometheus\r\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,string,double,string\r\n#group,false,false,false,true,true,true,false,true\r\n#default,inData,,,,,,,\r\n,result,table,_time,_field,src,dst,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name,source-value-20,original-destination-value,4,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 27, }, File: "labelReplace_src_empty_test.flux", Source: "outData = \"\n#datatype,string,long,string,string,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_field,src,dst,_value,_measurement\r\n,,0,metric_name,source-value-10,value-,1,prometheus\r\n,,0,metric_name,source-value-10,value-,2,prometheus\r\n,,1,metric_name,source-value-20,value-,3,prometheus\r\n,,1,metric_name,source-value-20,value-,4,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 18, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 18, }, File: "labelReplace_src_empty_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 18, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 27, }, File: "labelReplace_src_empty_test.flux", Source: "\"\n#datatype,string,long,string,string,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_field,src,dst,_value,_measurement\r\n,,0,metric_name,source-value-10,value-,1,prometheus\r\n,,0,metric_name,source-value-10,value-,2,prometheus\r\n,,1,metric_name,source-value-20,value-,3,prometheus\r\n,,1,metric_name,source-value-20,value-,4,prometheus\r\n\"", Start: ast.Position{ Column: 11, Line: 18, }, }, }, Value: "\n#datatype,string,long,string,string,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_field,src,dst,_value,_measurement\r\n,,0,metric_name,source-value-10,value-,1,prometheus\r\n,,0,metric_name,source-value-10,value-,2,prometheus\r\n,,1,metric_name,source-value-20,value-,3,prometheus\r\n,,1,metric_name,source-value-20,value-,4,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 5, Line: 37, }, File: "labelReplace_src_empty_test.flux", Source: "t_labelReplace = (table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.labelReplace(\n\t\t\tsource: \"nonexistent-src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"(.*)\",\n\t\t\treplacement: \"value-$1\",\n\t\t))", Start: ast.Position{ Column: 1, Line: 28, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 28, }, File: "labelReplace_src_empty_test.flux", Source: "t_labelReplace", Start: ast.Position{ Column: 1, Line: 28, }, }, }, Name: "t_labelReplace", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 5, Line: 37, }, File: "labelReplace_src_empty_test.flux", Source: "(table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.labelReplace(\n\t\t\tsource: \"nonexistent-src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"(.*)\",\n\t\t\treplacement: \"value-$1\",\n\t\t))", Start: ast.Position{ Column: 18, Line: 28, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 5, Line: 37, }, File: "labelReplace_src_empty_test.flux", Source: "(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.labelReplace(\n\t\t\tsource: \"nonexistent-src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"(.*)\",\n\t\t\treplacement: \"value-$1\",\n\t\t))", Start: ast.Position{ Column: 2, Line: 29, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 29, }, File: "labelReplace_src_empty_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 29, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 30, }, File: "labelReplace_src_empty_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 29, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 30, }, File: "labelReplace_src_empty_test.flux", Source: "start: 1980-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 30, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 30, }, File: "labelReplace_src_empty_test.flux", Source: "start: 1980-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 30, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 30, }, File: "labelReplace_src_empty_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 30, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 30, }, File: "labelReplace_src_empty_test.flux", Source: "1980-01-01T00:00:00Z", Start: ast.Position{ Column: 19, Line: 30, }, }, }, Value: parser.MustParseTime("1980-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 30, }, File: "labelReplace_src_empty_test.flux", Source: "range(start: 1980-01-01T00:00:00Z)", Start: ast.Position{ Column: 6, Line: 30, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 30, }, File: "labelReplace_src_empty_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 30, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 31, }, File: "labelReplace_src_empty_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 3, Line: 29, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 31, }, File: "labelReplace_src_empty_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 11, Line: 31, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 31, }, File: "labelReplace_src_empty_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 11, Line: 31, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 31, }, File: "labelReplace_src_empty_test.flux", Source: "columns", Start: ast.Position{ Column: 11, Line: 31, }, }, }, Name: "columns", }, Separator: nil, Value: &ast.ArrayExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 31, }, File: "labelReplace_src_empty_test.flux", Source: "[\"_start\", \"_stop\"]", Start: ast.Position{ Column: 20, Line: 31, }, }, }, Elements: []ast.Expression{&ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 31, }, File: "labelReplace_src_empty_test.flux", Source: "\"_start\"", Start: ast.Position{ Column: 21, Line: 31, }, }, }, Value: "_start", }, &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 38, Line: 31, }, File: "labelReplace_src_empty_test.flux", Source: "\"_stop\"", Start: ast.Position{ Column: 31, Line: 31, }, }, }, Value: "_stop", }}, Lbrack: nil, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 31, }, File: "labelReplace_src_empty_test.flux", Source: "drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 6, Line: 31, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 31, }, File: "labelReplace_src_empty_test.flux", Source: "drop", Start: ast.Position{ Column: 6, Line: 31, }, }, }, Name: "drop", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 4, Line: 37, }, File: "labelReplace_src_empty_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.labelReplace(\n\t\t\tsource: \"nonexistent-src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"(.*)\",\n\t\t\treplacement: \"value-$1\",\n\t\t)", Start: ast.Position{ Column: 3, Line: 29, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 36, }, File: "labelReplace_src_empty_test.flux", Source: "source: \"nonexistent-src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"(.*)\",\n\t\t\treplacement: \"value-$1\"", Start: ast.Position{ Column: 4, Line: 33, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 33, }, File: "labelReplace_src_empty_test.flux", Source: "source: \"nonexistent-src\"", Start: ast.Position{ Column: 4, Line: 33, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 33, }, File: "labelReplace_src_empty_test.flux", Source: "source", Start: ast.Position{ Column: 4, Line: 33, }, }, }, Name: "source", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 33, }, File: "labelReplace_src_empty_test.flux", Source: "\"nonexistent-src\"", Start: ast.Position{ Column: 12, Line: 33, }, }, }, Value: "nonexistent-src", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 34, }, File: "labelReplace_src_empty_test.flux", Source: "destination: \"dst\"", Start: ast.Position{ Column: 4, Line: 34, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 34, }, File: "labelReplace_src_empty_test.flux", Source: "destination", Start: ast.Position{ Column: 4, Line: 34, }, }, }, Name: "destination", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 34, }, File: "labelReplace_src_empty_test.flux", Source: "\"dst\"", Start: ast.Position{ Column: 17, Line: 34, }, }, }, Value: "dst", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 35, }, File: "labelReplace_src_empty_test.flux", Source: "regex: \"(.*)\"", Start: ast.Position{ Column: 4, Line: 35, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 35, }, File: "labelReplace_src_empty_test.flux", Source: "regex", Start: ast.Position{ Column: 4, Line: 35, }, }, }, Name: "regex", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 35, }, File: "labelReplace_src_empty_test.flux", Source: "\"(.*)\"", Start: ast.Position{ Column: 11, Line: 35, }, }, }, Value: "(.*)", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 36, }, File: "labelReplace_src_empty_test.flux", Source: "replacement: \"value-$1\"", Start: ast.Position{ Column: 4, Line: 36, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 36, }, File: "labelReplace_src_empty_test.flux", Source: "replacement", Start: ast.Position{ Column: 4, Line: 36, }, }, }, Name: "replacement", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 36, }, File: "labelReplace_src_empty_test.flux", Source: "\"value-$1\"", Start: ast.Position{ Column: 17, Line: 36, }, }, }, Value: "value-$1", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 4, Line: 37, }, File: "labelReplace_src_empty_test.flux", Source: "promql.labelReplace(\n\t\t\tsource: \"nonexistent-src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"(.*)\",\n\t\t\treplacement: \"value-$1\",\n\t\t)", Start: ast.Position{ Column: 6, Line: 32, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 32, }, File: "labelReplace_src_empty_test.flux", Source: "promql.labelReplace", Start: ast.Position{ Column: 6, Line: 32, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 32, }, File: "labelReplace_src_empty_test.flux", Source: "promql", Start: ast.Position{ Column: 6, Line: 32, }, }, }, Name: "promql", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 32, }, File: "labelReplace_src_empty_test.flux", Source: "labelReplace", Start: ast.Position{ Column: 13, Line: 32, }, }, }, Name: "labelReplace", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 28, }, File: "labelReplace_src_empty_test.flux", Source: "table=<-", Start: ast.Position{ Column: 19, Line: 28, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 28, }, File: "labelReplace_src_empty_test.flux", Source: "table", Start: ast.Position{ Column: 19, Line: 28, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 28, }, File: "labelReplace_src_empty_test.flux", Source: "<-", Start: ast.Position{ Column: 25, Line: 28, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "labelReplace_src_empty_test.flux", Source: "_labelReplace = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace})", Start: ast.Position{ Column: 6, Line: 39, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 39, }, File: "labelReplace_src_empty_test.flux", Source: "_labelReplace", Start: ast.Position{ Column: 6, Line: 39, }, }, }, Name: "_labelReplace", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "labelReplace_src_empty_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace})", Start: ast.Position{ Column: 22, Line: 39, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "labelReplace_src_empty_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace})", Start: ast.Position{ Column: 2, Line: 40, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 40, }, File: "labelReplace_src_empty_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace}", Start: ast.Position{ Column: 3, Line: 40, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "labelReplace_src_empty_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 40, }, File: "labelReplace_src_empty_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "labelReplace_src_empty_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "labelReplace_src_empty_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 40, }, File: "labelReplace_src_empty_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "labelReplace_src_empty_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 40, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "labelReplace_src_empty_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "labelReplace_src_empty_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 40, }, File: "labelReplace_src_empty_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "labelReplace_src_empty_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 40, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "labelReplace_src_empty_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 40, }, File: "labelReplace_src_empty_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "labelReplace_src_empty_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "labelReplace_src_empty_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 40, }, File: "labelReplace_src_empty_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "labelReplace_src_empty_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 40, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "labelReplace_src_empty_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "labelReplace_src_empty_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 40, }, File: "labelReplace_src_empty_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "labelReplace_src_empty_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 40, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 40, }, File: "labelReplace_src_empty_test.flux", Source: "fn: t_labelReplace", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 40, }, File: "labelReplace_src_empty_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 40, }, File: "labelReplace_src_empty_test.flux", Source: "t_labelReplace", Start: ast.Position{ Column: 86, Line: 40, }, }, }, Name: "t_labelReplace", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "labelReplace_src_empty_test.flux", Source: "test _labelReplace = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace})", Start: ast.Position{ Column: 1, Line: 39, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "labelReplace_src_empty_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 2, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "labelReplace_src_empty_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 2, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "labelReplace_src_empty_test.flux", Source: "import \"internal/promql\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "labelReplace_src_empty_test.flux", Source: "\"internal/promql\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "internal/promql", }, }}, Metadata: "parser-type=rust", Name: "labelReplace_src_empty_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "labelReplace_src_empty_test.flux", Source: "package promql_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "labelReplace_src_empty_test.flux", Source: "promql_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "promql_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "labelReplace_src_nonexistent_test.flux", Source: "package promql_test\nimport \"testing\"\nimport \"internal/promql\"\n\noption now = () =>\n\t(2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,string,double,string\r\n#group,false,false,false,true,true,true,false,true\r\n#default,inData,,,,,,,\r\n,result,table,_time,_field,src,dst,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name,source-value-20,original-destination-value,4,prometheus\r\n\"\noutData = \"\n#datatype,string,long,string,string,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_field,src,dst,_value,_measurement\r\n,,0,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,metric_name,source-value-20,original-destination-value,4,prometheus\r\n\"\nt_labelReplace = (table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.labelReplace(\n\t\t\tsource: \"nonexistent-src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"source-value-(.*)\",\n\t\t\treplacement: \"value-$1\",\n\t\t))\n\ntest _labelReplace = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "labelReplace_src_nonexistent_test.flux", Source: "now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 5, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 5, }, File: "labelReplace_src_nonexistent_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "labelReplace_src_nonexistent_test.flux", Source: "() =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 5, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "labelReplace_src_nonexistent_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 2, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 6, }, File: "labelReplace_src_nonexistent_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 3, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "labelReplace_src_nonexistent_test.flux", Source: "option now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 5, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 17, }, File: "labelReplace_src_nonexistent_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,string,double,string\r\n#group,false,false,false,true,true,true,false,true\r\n#default,inData,,,,,,,\r\n,result,table,_time,_field,src,dst,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name,source-value-20,original-destination-value,4,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "labelReplace_src_nonexistent_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 17, }, File: "labelReplace_src_nonexistent_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,string,double,string\r\n#group,false,false,false,true,true,true,false,true\r\n#default,inData,,,,,,,\r\n,result,table,_time,_field,src,dst,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name,source-value-20,original-destination-value,4,prometheus\r\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,string,double,string\r\n#group,false,false,false,true,true,true,false,true\r\n#default,inData,,,,,,,\r\n,result,table,_time,_field,src,dst,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name,source-value-20,original-destination-value,4,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 27, }, File: "labelReplace_src_nonexistent_test.flux", Source: "outData = \"\n#datatype,string,long,string,string,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_field,src,dst,_value,_measurement\r\n,,0,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,metric_name,source-value-20,original-destination-value,4,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 18, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 18, }, File: "labelReplace_src_nonexistent_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 18, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 27, }, File: "labelReplace_src_nonexistent_test.flux", Source: "\"\n#datatype,string,long,string,string,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_field,src,dst,_value,_measurement\r\n,,0,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,metric_name,source-value-20,original-destination-value,4,prometheus\r\n\"", Start: ast.Position{ Column: 11, Line: 18, }, }, }, Value: "\n#datatype,string,long,string,string,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_field,src,dst,_value,_measurement\r\n,,0,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,metric_name,source-value-20,original-destination-value,4,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 5, Line: 37, }, File: "labelReplace_src_nonexistent_test.flux", Source: "t_labelReplace = (table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.labelReplace(\n\t\t\tsource: \"nonexistent-src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"source-value-(.*)\",\n\t\t\treplacement: \"value-$1\",\n\t\t))", Start: ast.Position{ Column: 1, Line: 28, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 28, }, File: "labelReplace_src_nonexistent_test.flux", Source: "t_labelReplace", Start: ast.Position{ Column: 1, Line: 28, }, }, }, Name: "t_labelReplace", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 5, Line: 37, }, File: "labelReplace_src_nonexistent_test.flux", Source: "(table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.labelReplace(\n\t\t\tsource: \"nonexistent-src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"source-value-(.*)\",\n\t\t\treplacement: \"value-$1\",\n\t\t))", Start: ast.Position{ Column: 18, Line: 28, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 5, Line: 37, }, File: "labelReplace_src_nonexistent_test.flux", Source: "(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.labelReplace(\n\t\t\tsource: \"nonexistent-src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"source-value-(.*)\",\n\t\t\treplacement: \"value-$1\",\n\t\t))", Start: ast.Position{ Column: 2, Line: 29, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 29, }, File: "labelReplace_src_nonexistent_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 29, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 30, }, File: "labelReplace_src_nonexistent_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 29, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 30, }, File: "labelReplace_src_nonexistent_test.flux", Source: "start: 1980-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 30, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 30, }, File: "labelReplace_src_nonexistent_test.flux", Source: "start: 1980-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 30, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 30, }, File: "labelReplace_src_nonexistent_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 30, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 30, }, File: "labelReplace_src_nonexistent_test.flux", Source: "1980-01-01T00:00:00Z", Start: ast.Position{ Column: 19, Line: 30, }, }, }, Value: parser.MustParseTime("1980-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 30, }, File: "labelReplace_src_nonexistent_test.flux", Source: "range(start: 1980-01-01T00:00:00Z)", Start: ast.Position{ Column: 6, Line: 30, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 30, }, File: "labelReplace_src_nonexistent_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 30, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 31, }, File: "labelReplace_src_nonexistent_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 3, Line: 29, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 31, }, File: "labelReplace_src_nonexistent_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 11, Line: 31, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 31, }, File: "labelReplace_src_nonexistent_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 11, Line: 31, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 31, }, File: "labelReplace_src_nonexistent_test.flux", Source: "columns", Start: ast.Position{ Column: 11, Line: 31, }, }, }, Name: "columns", }, Separator: nil, Value: &ast.ArrayExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 31, }, File: "labelReplace_src_nonexistent_test.flux", Source: "[\"_start\", \"_stop\"]", Start: ast.Position{ Column: 20, Line: 31, }, }, }, Elements: []ast.Expression{&ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 31, }, File: "labelReplace_src_nonexistent_test.flux", Source: "\"_start\"", Start: ast.Position{ Column: 21, Line: 31, }, }, }, Value: "_start", }, &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 38, Line: 31, }, File: "labelReplace_src_nonexistent_test.flux", Source: "\"_stop\"", Start: ast.Position{ Column: 31, Line: 31, }, }, }, Value: "_stop", }}, Lbrack: nil, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 31, }, File: "labelReplace_src_nonexistent_test.flux", Source: "drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 6, Line: 31, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 31, }, File: "labelReplace_src_nonexistent_test.flux", Source: "drop", Start: ast.Position{ Column: 6, Line: 31, }, }, }, Name: "drop", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 4, Line: 37, }, File: "labelReplace_src_nonexistent_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.labelReplace(\n\t\t\tsource: \"nonexistent-src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"source-value-(.*)\",\n\t\t\treplacement: \"value-$1\",\n\t\t)", Start: ast.Position{ Column: 3, Line: 29, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 36, }, File: "labelReplace_src_nonexistent_test.flux", Source: "source: \"nonexistent-src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"source-value-(.*)\",\n\t\t\treplacement: \"value-$1\"", Start: ast.Position{ Column: 4, Line: 33, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 33, }, File: "labelReplace_src_nonexistent_test.flux", Source: "source: \"nonexistent-src\"", Start: ast.Position{ Column: 4, Line: 33, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 33, }, File: "labelReplace_src_nonexistent_test.flux", Source: "source", Start: ast.Position{ Column: 4, Line: 33, }, }, }, Name: "source", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 33, }, File: "labelReplace_src_nonexistent_test.flux", Source: "\"nonexistent-src\"", Start: ast.Position{ Column: 12, Line: 33, }, }, }, Value: "nonexistent-src", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 34, }, File: "labelReplace_src_nonexistent_test.flux", Source: "destination: \"dst\"", Start: ast.Position{ Column: 4, Line: 34, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 34, }, File: "labelReplace_src_nonexistent_test.flux", Source: "destination", Start: ast.Position{ Column: 4, Line: 34, }, }, }, Name: "destination", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 34, }, File: "labelReplace_src_nonexistent_test.flux", Source: "\"dst\"", Start: ast.Position{ Column: 17, Line: 34, }, }, }, Value: "dst", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 35, }, File: "labelReplace_src_nonexistent_test.flux", Source: "regex: \"source-value-(.*)\"", Start: ast.Position{ Column: 4, Line: 35, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 35, }, File: "labelReplace_src_nonexistent_test.flux", Source: "regex", Start: ast.Position{ Column: 4, Line: 35, }, }, }, Name: "regex", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 35, }, File: "labelReplace_src_nonexistent_test.flux", Source: "\"source-value-(.*)\"", Start: ast.Position{ Column: 11, Line: 35, }, }, }, Value: "source-value-(.*)", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 36, }, File: "labelReplace_src_nonexistent_test.flux", Source: "replacement: \"value-$1\"", Start: ast.Position{ Column: 4, Line: 36, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 36, }, File: "labelReplace_src_nonexistent_test.flux", Source: "replacement", Start: ast.Position{ Column: 4, Line: 36, }, }, }, Name: "replacement", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 36, }, File: "labelReplace_src_nonexistent_test.flux", Source: "\"value-$1\"", Start: ast.Position{ Column: 17, Line: 36, }, }, }, Value: "value-$1", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 4, Line: 37, }, File: "labelReplace_src_nonexistent_test.flux", Source: "promql.labelReplace(\n\t\t\tsource: \"nonexistent-src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"source-value-(.*)\",\n\t\t\treplacement: \"value-$1\",\n\t\t)", Start: ast.Position{ Column: 6, Line: 32, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 32, }, File: "labelReplace_src_nonexistent_test.flux", Source: "promql.labelReplace", Start: ast.Position{ Column: 6, Line: 32, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 32, }, File: "labelReplace_src_nonexistent_test.flux", Source: "promql", Start: ast.Position{ Column: 6, Line: 32, }, }, }, Name: "promql", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 32, }, File: "labelReplace_src_nonexistent_test.flux", Source: "labelReplace", Start: ast.Position{ Column: 13, Line: 32, }, }, }, Name: "labelReplace", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 28, }, File: "labelReplace_src_nonexistent_test.flux", Source: "table=<-", Start: ast.Position{ Column: 19, Line: 28, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 28, }, File: "labelReplace_src_nonexistent_test.flux", Source: "table", Start: ast.Position{ Column: 19, Line: 28, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 28, }, File: "labelReplace_src_nonexistent_test.flux", Source: "<-", Start: ast.Position{ Column: 25, Line: 28, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "labelReplace_src_nonexistent_test.flux", Source: "_labelReplace = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace})", Start: ast.Position{ Column: 6, Line: 39, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 39, }, File: "labelReplace_src_nonexistent_test.flux", Source: "_labelReplace", Start: ast.Position{ Column: 6, Line: 39, }, }, }, Name: "_labelReplace", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "labelReplace_src_nonexistent_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace})", Start: ast.Position{ Column: 22, Line: 39, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "labelReplace_src_nonexistent_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace})", Start: ast.Position{ Column: 2, Line: 40, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 40, }, File: "labelReplace_src_nonexistent_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace}", Start: ast.Position{ Column: 3, Line: 40, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "labelReplace_src_nonexistent_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 40, }, File: "labelReplace_src_nonexistent_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "labelReplace_src_nonexistent_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "labelReplace_src_nonexistent_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 40, }, File: "labelReplace_src_nonexistent_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "labelReplace_src_nonexistent_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 40, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "labelReplace_src_nonexistent_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "labelReplace_src_nonexistent_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 40, }, File: "labelReplace_src_nonexistent_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "labelReplace_src_nonexistent_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 40, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "labelReplace_src_nonexistent_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 40, }, File: "labelReplace_src_nonexistent_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "labelReplace_src_nonexistent_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "labelReplace_src_nonexistent_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 40, }, File: "labelReplace_src_nonexistent_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "labelReplace_src_nonexistent_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 40, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "labelReplace_src_nonexistent_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "labelReplace_src_nonexistent_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 40, }, File: "labelReplace_src_nonexistent_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "labelReplace_src_nonexistent_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 40, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 40, }, File: "labelReplace_src_nonexistent_test.flux", Source: "fn: t_labelReplace", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 40, }, File: "labelReplace_src_nonexistent_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 40, }, File: "labelReplace_src_nonexistent_test.flux", Source: "t_labelReplace", Start: ast.Position{ Column: 86, Line: 40, }, }, }, Name: "t_labelReplace", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "labelReplace_src_nonexistent_test.flux", Source: "test _labelReplace = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace})", Start: ast.Position{ Column: 1, Line: 39, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "labelReplace_src_nonexistent_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 2, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "labelReplace_src_nonexistent_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 2, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "labelReplace_src_nonexistent_test.flux", Source: "import \"internal/promql\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "labelReplace_src_nonexistent_test.flux", Source: "\"internal/promql\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "internal/promql", }, }}, Metadata: "parser-type=rust", Name: "labelReplace_src_nonexistent_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "labelReplace_src_nonexistent_test.flux", Source: "package promql_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "labelReplace_src_nonexistent_test.flux", Source: "promql_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "promql_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "labelReplace_src_not_matched_test.flux", Source: "package promql_test\nimport \"testing\"\nimport \"internal/promql\"\n\noption now = () =>\n\t(2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,string,double,string\r\n#group,false,false,false,true,true,true,false,true\r\n#default,inData,,,,,,,\r\n,result,table,_time,_field,src,dst,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name,source-value-20,original-destination-value,4,prometheus\r\n\"\noutData = \"\n#datatype,string,long,string,string,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_field,src,dst,_value,_measurement\r\n,,0,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,metric_name,source-value-20,original-destination-value,4,prometheus\r\n\"\nt_labelReplace = (table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.labelReplace(\n\t\t\tsource: \"src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"non-matching-regex\",\n\t\t\treplacement: \"value-$1\",\n\t\t))\n\ntest _labelReplace = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "labelReplace_src_not_matched_test.flux", Source: "now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 5, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 5, }, File: "labelReplace_src_not_matched_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "labelReplace_src_not_matched_test.flux", Source: "() =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 5, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "labelReplace_src_not_matched_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 2, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 6, }, File: "labelReplace_src_not_matched_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 3, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "labelReplace_src_not_matched_test.flux", Source: "option now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 5, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 17, }, File: "labelReplace_src_not_matched_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,string,double,string\r\n#group,false,false,false,true,true,true,false,true\r\n#default,inData,,,,,,,\r\n,result,table,_time,_field,src,dst,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name,source-value-20,original-destination-value,4,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "labelReplace_src_not_matched_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 17, }, File: "labelReplace_src_not_matched_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,string,double,string\r\n#group,false,false,false,true,true,true,false,true\r\n#default,inData,,,,,,,\r\n,result,table,_time,_field,src,dst,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name,source-value-20,original-destination-value,4,prometheus\r\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,string,double,string\r\n#group,false,false,false,true,true,true,false,true\r\n#default,inData,,,,,,,\r\n,result,table,_time,_field,src,dst,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name,source-value-20,original-destination-value,4,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 27, }, File: "labelReplace_src_not_matched_test.flux", Source: "outData = \"\n#datatype,string,long,string,string,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_field,src,dst,_value,_measurement\r\n,,0,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,metric_name,source-value-20,original-destination-value,4,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 18, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 18, }, File: "labelReplace_src_not_matched_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 18, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 27, }, File: "labelReplace_src_not_matched_test.flux", Source: "\"\n#datatype,string,long,string,string,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_field,src,dst,_value,_measurement\r\n,,0,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,metric_name,source-value-20,original-destination-value,4,prometheus\r\n\"", Start: ast.Position{ Column: 11, Line: 18, }, }, }, Value: "\n#datatype,string,long,string,string,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_field,src,dst,_value,_measurement\r\n,,0,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,metric_name,source-value-20,original-destination-value,4,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 5, Line: 37, }, File: "labelReplace_src_not_matched_test.flux", Source: "t_labelReplace = (table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.labelReplace(\n\t\t\tsource: \"src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"non-matching-regex\",\n\t\t\treplacement: \"value-$1\",\n\t\t))", Start: ast.Position{ Column: 1, Line: 28, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 28, }, File: "labelReplace_src_not_matched_test.flux", Source: "t_labelReplace", Start: ast.Position{ Column: 1, Line: 28, }, }, }, Name: "t_labelReplace", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 5, Line: 37, }, File: "labelReplace_src_not_matched_test.flux", Source: "(table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.labelReplace(\n\t\t\tsource: \"src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"non-matching-regex\",\n\t\t\treplacement: \"value-$1\",\n\t\t))", Start: ast.Position{ Column: 18, Line: 28, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 5, Line: 37, }, File: "labelReplace_src_not_matched_test.flux", Source: "(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.labelReplace(\n\t\t\tsource: \"src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"non-matching-regex\",\n\t\t\treplacement: \"value-$1\",\n\t\t))", Start: ast.Position{ Column: 2, Line: 29, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 29, }, File: "labelReplace_src_not_matched_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 29, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 30, }, File: "labelReplace_src_not_matched_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 29, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 30, }, File: "labelReplace_src_not_matched_test.flux", Source: "start: 1980-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 30, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 30, }, File: "labelReplace_src_not_matched_test.flux", Source: "start: 1980-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 30, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 30, }, File: "labelReplace_src_not_matched_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 30, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 30, }, File: "labelReplace_src_not_matched_test.flux", Source: "1980-01-01T00:00:00Z", Start: ast.Position{ Column: 19, Line: 30, }, }, }, Value: parser.MustParseTime("1980-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 30, }, File: "labelReplace_src_not_matched_test.flux", Source: "range(start: 1980-01-01T00:00:00Z)", Start: ast.Position{ Column: 6, Line: 30, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 30, }, File: "labelReplace_src_not_matched_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 30, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 31, }, File: "labelReplace_src_not_matched_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 3, Line: 29, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 31, }, File: "labelReplace_src_not_matched_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 11, Line: 31, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 31, }, File: "labelReplace_src_not_matched_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 11, Line: 31, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 31, }, File: "labelReplace_src_not_matched_test.flux", Source: "columns", Start: ast.Position{ Column: 11, Line: 31, }, }, }, Name: "columns", }, Separator: nil, Value: &ast.ArrayExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 31, }, File: "labelReplace_src_not_matched_test.flux", Source: "[\"_start\", \"_stop\"]", Start: ast.Position{ Column: 20, Line: 31, }, }, }, Elements: []ast.Expression{&ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 31, }, File: "labelReplace_src_not_matched_test.flux", Source: "\"_start\"", Start: ast.Position{ Column: 21, Line: 31, }, }, }, Value: "_start", }, &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 38, Line: 31, }, File: "labelReplace_src_not_matched_test.flux", Source: "\"_stop\"", Start: ast.Position{ Column: 31, Line: 31, }, }, }, Value: "_stop", }}, Lbrack: nil, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 31, }, File: "labelReplace_src_not_matched_test.flux", Source: "drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 6, Line: 31, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 31, }, File: "labelReplace_src_not_matched_test.flux", Source: "drop", Start: ast.Position{ Column: 6, Line: 31, }, }, }, Name: "drop", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 4, Line: 37, }, File: "labelReplace_src_not_matched_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.labelReplace(\n\t\t\tsource: \"src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"non-matching-regex\",\n\t\t\treplacement: \"value-$1\",\n\t\t)", Start: ast.Position{ Column: 3, Line: 29, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 36, }, File: "labelReplace_src_not_matched_test.flux", Source: "source: \"src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"non-matching-regex\",\n\t\t\treplacement: \"value-$1\"", Start: ast.Position{ Column: 4, Line: 33, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 33, }, File: "labelReplace_src_not_matched_test.flux", Source: "source: \"src\"", Start: ast.Position{ Column: 4, Line: 33, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 33, }, File: "labelReplace_src_not_matched_test.flux", Source: "source", Start: ast.Position{ Column: 4, Line: 33, }, }, }, Name: "source", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 33, }, File: "labelReplace_src_not_matched_test.flux", Source: "\"src\"", Start: ast.Position{ Column: 12, Line: 33, }, }, }, Value: "src", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 34, }, File: "labelReplace_src_not_matched_test.flux", Source: "destination: \"dst\"", Start: ast.Position{ Column: 4, Line: 34, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 34, }, File: "labelReplace_src_not_matched_test.flux", Source: "destination", Start: ast.Position{ Column: 4, Line: 34, }, }, }, Name: "destination", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 34, }, File: "labelReplace_src_not_matched_test.flux", Source: "\"dst\"", Start: ast.Position{ Column: 17, Line: 34, }, }, }, Value: "dst", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 35, }, File: "labelReplace_src_not_matched_test.flux", Source: "regex: \"non-matching-regex\"", Start: ast.Position{ Column: 4, Line: 35, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 35, }, File: "labelReplace_src_not_matched_test.flux", Source: "regex", Start: ast.Position{ Column: 4, Line: 35, }, }, }, Name: "regex", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 35, }, File: "labelReplace_src_not_matched_test.flux", Source: "\"non-matching-regex\"", Start: ast.Position{ Column: 11, Line: 35, }, }, }, Value: "non-matching-regex", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 36, }, File: "labelReplace_src_not_matched_test.flux", Source: "replacement: \"value-$1\"", Start: ast.Position{ Column: 4, Line: 36, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 36, }, File: "labelReplace_src_not_matched_test.flux", Source: "replacement", Start: ast.Position{ Column: 4, Line: 36, }, }, }, Name: "replacement", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 36, }, File: "labelReplace_src_not_matched_test.flux", Source: "\"value-$1\"", Start: ast.Position{ Column: 17, Line: 36, }, }, }, Value: "value-$1", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 4, Line: 37, }, File: "labelReplace_src_not_matched_test.flux", Source: "promql.labelReplace(\n\t\t\tsource: \"src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"non-matching-regex\",\n\t\t\treplacement: \"value-$1\",\n\t\t)", Start: ast.Position{ Column: 6, Line: 32, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 32, }, File: "labelReplace_src_not_matched_test.flux", Source: "promql.labelReplace", Start: ast.Position{ Column: 6, Line: 32, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 32, }, File: "labelReplace_src_not_matched_test.flux", Source: "promql", Start: ast.Position{ Column: 6, Line: 32, }, }, }, Name: "promql", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 32, }, File: "labelReplace_src_not_matched_test.flux", Source: "labelReplace", Start: ast.Position{ Column: 13, Line: 32, }, }, }, Name: "labelReplace", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 28, }, File: "labelReplace_src_not_matched_test.flux", Source: "table=<-", Start: ast.Position{ Column: 19, Line: 28, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 28, }, File: "labelReplace_src_not_matched_test.flux", Source: "table", Start: ast.Position{ Column: 19, Line: 28, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 28, }, File: "labelReplace_src_not_matched_test.flux", Source: "<-", Start: ast.Position{ Column: 25, Line: 28, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "labelReplace_src_not_matched_test.flux", Source: "_labelReplace = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace})", Start: ast.Position{ Column: 6, Line: 39, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 39, }, File: "labelReplace_src_not_matched_test.flux", Source: "_labelReplace", Start: ast.Position{ Column: 6, Line: 39, }, }, }, Name: "_labelReplace", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "labelReplace_src_not_matched_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace})", Start: ast.Position{ Column: 22, Line: 39, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "labelReplace_src_not_matched_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace})", Start: ast.Position{ Column: 2, Line: 40, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 40, }, File: "labelReplace_src_not_matched_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace}", Start: ast.Position{ Column: 3, Line: 40, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "labelReplace_src_not_matched_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 40, }, File: "labelReplace_src_not_matched_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "labelReplace_src_not_matched_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "labelReplace_src_not_matched_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 40, }, File: "labelReplace_src_not_matched_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "labelReplace_src_not_matched_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 40, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "labelReplace_src_not_matched_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "labelReplace_src_not_matched_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 40, }, File: "labelReplace_src_not_matched_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "labelReplace_src_not_matched_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 40, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "labelReplace_src_not_matched_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 40, }, File: "labelReplace_src_not_matched_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "labelReplace_src_not_matched_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "labelReplace_src_not_matched_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 40, }, File: "labelReplace_src_not_matched_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "labelReplace_src_not_matched_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 40, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "labelReplace_src_not_matched_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "labelReplace_src_not_matched_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 40, }, File: "labelReplace_src_not_matched_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "labelReplace_src_not_matched_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 40, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 40, }, File: "labelReplace_src_not_matched_test.flux", Source: "fn: t_labelReplace", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 40, }, File: "labelReplace_src_not_matched_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 40, }, File: "labelReplace_src_not_matched_test.flux", Source: "t_labelReplace", Start: ast.Position{ Column: 86, Line: 40, }, }, }, Name: "t_labelReplace", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "labelReplace_src_not_matched_test.flux", Source: "test _labelReplace = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace})", Start: ast.Position{ Column: 1, Line: 39, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "labelReplace_src_not_matched_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 2, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "labelReplace_src_not_matched_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 2, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "labelReplace_src_not_matched_test.flux", Source: "import \"internal/promql\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "labelReplace_src_not_matched_test.flux", Source: "\"internal/promql\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "internal/promql", }, }}, Metadata: "parser-type=rust", Name: "labelReplace_src_not_matched_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "labelReplace_src_not_matched_test.flux", Source: "package promql_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "labelReplace_src_not_matched_test.flux", Source: "promql_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "promql_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "labelReplace_sub_string_match_test.flux", Source: "package promql_test\nimport \"testing\"\nimport \"internal/promql\"\n\noption now = () =>\n\t(2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,string,double,string\r\n#group,false,false,false,true,true,true,false,true\r\n#default,inData,,,,,,,\r\n,result,table,_time,_field,src,dst,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name,source-value-20,original-destination-value,4,prometheus\r\n\"\noutData = \"\n#datatype,string,long,string,string,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_field,src,dst,_value,_measurement\r\n,,0,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,metric_name,source-value-20,original-destination-value,4,prometheus\r\n\"\nt_labelReplace = (table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.labelReplace(\n\t\t\tsource: \"src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"value-(.*)\",\n\t\t\treplacement: \"destination-value-$1\",\n\t\t))\n\ntest _labelReplace = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "labelReplace_sub_string_match_test.flux", Source: "now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 5, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 5, }, File: "labelReplace_sub_string_match_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "labelReplace_sub_string_match_test.flux", Source: "() =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 5, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "labelReplace_sub_string_match_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 2, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 6, }, File: "labelReplace_sub_string_match_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 3, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "labelReplace_sub_string_match_test.flux", Source: "option now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 5, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 17, }, File: "labelReplace_sub_string_match_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,string,string,double,string\r\n#group,false,false,false,true,true,true,false,true\r\n#default,inData,,,,,,,\r\n,result,table,_time,_field,src,dst,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name,source-value-20,original-destination-value,4,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "labelReplace_sub_string_match_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 17, }, File: "labelReplace_sub_string_match_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,string,double,string\r\n#group,false,false,false,true,true,true,false,true\r\n#default,inData,,,,,,,\r\n,result,table,_time,_field,src,dst,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name,source-value-20,original-destination-value,4,prometheus\r\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,string,double,string\r\n#group,false,false,false,true,true,true,false,true\r\n#default,inData,,,,,,,\r\n,result,table,_time,_field,src,dst,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name,source-value-20,original-destination-value,4,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 27, }, File: "labelReplace_sub_string_match_test.flux", Source: "outData = \"\n#datatype,string,long,string,string,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_field,src,dst,_value,_measurement\r\n,,0,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,metric_name,source-value-20,original-destination-value,4,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 18, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 18, }, File: "labelReplace_sub_string_match_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 18, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 27, }, File: "labelReplace_sub_string_match_test.flux", Source: "\"\n#datatype,string,long,string,string,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_field,src,dst,_value,_measurement\r\n,,0,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,metric_name,source-value-20,original-destination-value,4,prometheus\r\n\"", Start: ast.Position{ Column: 11, Line: 18, }, }, }, Value: "\n#datatype,string,long,string,string,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_field,src,dst,_value,_measurement\r\n,,0,metric_name,source-value-10,original-destination-value,1,prometheus\r\n,,0,metric_name,source-value-10,original-destination-value,2,prometheus\r\n,,1,metric_name,source-value-20,original-destination-value,3,prometheus\r\n,,1,metric_name,source-value-20,original-destination-value,4,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 5, Line: 37, }, File: "labelReplace_sub_string_match_test.flux", Source: "t_labelReplace = (table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.labelReplace(\n\t\t\tsource: \"src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"value-(.*)\",\n\t\t\treplacement: \"destination-value-$1\",\n\t\t))", Start: ast.Position{ Column: 1, Line: 28, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 28, }, File: "labelReplace_sub_string_match_test.flux", Source: "t_labelReplace", Start: ast.Position{ Column: 1, Line: 28, }, }, }, Name: "t_labelReplace", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 5, Line: 37, }, File: "labelReplace_sub_string_match_test.flux", Source: "(table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.labelReplace(\n\t\t\tsource: \"src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"value-(.*)\",\n\t\t\treplacement: \"destination-value-$1\",\n\t\t))", Start: ast.Position{ Column: 18, Line: 28, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 5, Line: 37, }, File: "labelReplace_sub_string_match_test.flux", Source: "(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.labelReplace(\n\t\t\tsource: \"src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"value-(.*)\",\n\t\t\treplacement: \"destination-value-$1\",\n\t\t))", Start: ast.Position{ Column: 2, Line: 29, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 29, }, File: "labelReplace_sub_string_match_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 29, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 30, }, File: "labelReplace_sub_string_match_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 29, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 30, }, File: "labelReplace_sub_string_match_test.flux", Source: "start: 1980-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 30, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 30, }, File: "labelReplace_sub_string_match_test.flux", Source: "start: 1980-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 30, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 30, }, File: "labelReplace_sub_string_match_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 30, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 30, }, File: "labelReplace_sub_string_match_test.flux", Source: "1980-01-01T00:00:00Z", Start: ast.Position{ Column: 19, Line: 30, }, }, }, Value: parser.MustParseTime("1980-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 30, }, File: "labelReplace_sub_string_match_test.flux", Source: "range(start: 1980-01-01T00:00:00Z)", Start: ast.Position{ Column: 6, Line: 30, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 30, }, File: "labelReplace_sub_string_match_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 30, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 31, }, File: "labelReplace_sub_string_match_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 3, Line: 29, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 31, }, File: "labelReplace_sub_string_match_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 11, Line: 31, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 31, }, File: "labelReplace_sub_string_match_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 11, Line: 31, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 31, }, File: "labelReplace_sub_string_match_test.flux", Source: "columns", Start: ast.Position{ Column: 11, Line: 31, }, }, }, Name: "columns", }, Separator: nil, Value: &ast.ArrayExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 31, }, File: "labelReplace_sub_string_match_test.flux", Source: "[\"_start\", \"_stop\"]", Start: ast.Position{ Column: 20, Line: 31, }, }, }, Elements: []ast.Expression{&ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 31, }, File: "labelReplace_sub_string_match_test.flux", Source: "\"_start\"", Start: ast.Position{ Column: 21, Line: 31, }, }, }, Value: "_start", }, &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 38, Line: 31, }, File: "labelReplace_sub_string_match_test.flux", Source: "\"_stop\"", Start: ast.Position{ Column: 31, Line: 31, }, }, }, Value: "_stop", }}, Lbrack: nil, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 31, }, File: "labelReplace_sub_string_match_test.flux", Source: "drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 6, Line: 31, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 31, }, File: "labelReplace_sub_string_match_test.flux", Source: "drop", Start: ast.Position{ Column: 6, Line: 31, }, }, }, Name: "drop", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 4, Line: 37, }, File: "labelReplace_sub_string_match_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.labelReplace(\n\t\t\tsource: \"src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"value-(.*)\",\n\t\t\treplacement: \"destination-value-$1\",\n\t\t)", Start: ast.Position{ Column: 3, Line: 29, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "labelReplace_sub_string_match_test.flux", Source: "source: \"src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"value-(.*)\",\n\t\t\treplacement: \"destination-value-$1\"", Start: ast.Position{ Column: 4, Line: 33, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 33, }, File: "labelReplace_sub_string_match_test.flux", Source: "source: \"src\"", Start: ast.Position{ Column: 4, Line: 33, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 33, }, File: "labelReplace_sub_string_match_test.flux", Source: "source", Start: ast.Position{ Column: 4, Line: 33, }, }, }, Name: "source", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 33, }, File: "labelReplace_sub_string_match_test.flux", Source: "\"src\"", Start: ast.Position{ Column: 12, Line: 33, }, }, }, Value: "src", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 34, }, File: "labelReplace_sub_string_match_test.flux", Source: "destination: \"dst\"", Start: ast.Position{ Column: 4, Line: 34, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 34, }, File: "labelReplace_sub_string_match_test.flux", Source: "destination", Start: ast.Position{ Column: 4, Line: 34, }, }, }, Name: "destination", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 34, }, File: "labelReplace_sub_string_match_test.flux", Source: "\"dst\"", Start: ast.Position{ Column: 17, Line: 34, }, }, }, Value: "dst", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 35, }, File: "labelReplace_sub_string_match_test.flux", Source: "regex: \"value-(.*)\"", Start: ast.Position{ Column: 4, Line: 35, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 35, }, File: "labelReplace_sub_string_match_test.flux", Source: "regex", Start: ast.Position{ Column: 4, Line: 35, }, }, }, Name: "regex", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 35, }, File: "labelReplace_sub_string_match_test.flux", Source: "\"value-(.*)\"", Start: ast.Position{ Column: 11, Line: 35, }, }, }, Value: "value-(.*)", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "labelReplace_sub_string_match_test.flux", Source: "replacement: \"destination-value-$1\"", Start: ast.Position{ Column: 4, Line: 36, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 36, }, File: "labelReplace_sub_string_match_test.flux", Source: "replacement", Start: ast.Position{ Column: 4, Line: 36, }, }, }, Name: "replacement", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 36, }, File: "labelReplace_sub_string_match_test.flux", Source: "\"destination-value-$1\"", Start: ast.Position{ Column: 17, Line: 36, }, }, }, Value: "destination-value-$1", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 4, Line: 37, }, File: "labelReplace_sub_string_match_test.flux", Source: "promql.labelReplace(\n\t\t\tsource: \"src\",\n\t\t\tdestination: \"dst\",\n\t\t\tregex: \"value-(.*)\",\n\t\t\treplacement: \"destination-value-$1\",\n\t\t)", Start: ast.Position{ Column: 6, Line: 32, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 32, }, File: "labelReplace_sub_string_match_test.flux", Source: "promql.labelReplace", Start: ast.Position{ Column: 6, Line: 32, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 32, }, File: "labelReplace_sub_string_match_test.flux", Source: "promql", Start: ast.Position{ Column: 6, Line: 32, }, }, }, Name: "promql", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 32, }, File: "labelReplace_sub_string_match_test.flux", Source: "labelReplace", Start: ast.Position{ Column: 13, Line: 32, }, }, }, Name: "labelReplace", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 28, }, File: "labelReplace_sub_string_match_test.flux", Source: "table=<-", Start: ast.Position{ Column: 19, Line: 28, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 28, }, File: "labelReplace_sub_string_match_test.flux", Source: "table", Start: ast.Position{ Column: 19, Line: 28, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 28, }, File: "labelReplace_sub_string_match_test.flux", Source: "<-", Start: ast.Position{ Column: 25, Line: 28, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "labelReplace_sub_string_match_test.flux", Source: "_labelReplace = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace})", Start: ast.Position{ Column: 6, Line: 39, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 39, }, File: "labelReplace_sub_string_match_test.flux", Source: "_labelReplace", Start: ast.Position{ Column: 6, Line: 39, }, }, }, Name: "_labelReplace", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "labelReplace_sub_string_match_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace})", Start: ast.Position{ Column: 22, Line: 39, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "labelReplace_sub_string_match_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace})", Start: ast.Position{ Column: 2, Line: 40, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 40, }, File: "labelReplace_sub_string_match_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace}", Start: ast.Position{ Column: 3, Line: 40, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "labelReplace_sub_string_match_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 40, }, File: "labelReplace_sub_string_match_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 40, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "labelReplace_sub_string_match_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "labelReplace_sub_string_match_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 40, }, File: "labelReplace_sub_string_match_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 40, }, File: "labelReplace_sub_string_match_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 40, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 40, }, File: "labelReplace_sub_string_match_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "labelReplace_sub_string_match_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 40, }, File: "labelReplace_sub_string_match_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 40, }, File: "labelReplace_sub_string_match_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 40, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "labelReplace_sub_string_match_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 40, }, File: "labelReplace_sub_string_match_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 40, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "labelReplace_sub_string_match_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "labelReplace_sub_string_match_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 40, }, File: "labelReplace_sub_string_match_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 40, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 40, }, File: "labelReplace_sub_string_match_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 40, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 40, }, File: "labelReplace_sub_string_match_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "labelReplace_sub_string_match_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 40, }, File: "labelReplace_sub_string_match_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 40, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 40, }, File: "labelReplace_sub_string_match_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 40, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 40, }, File: "labelReplace_sub_string_match_test.flux", Source: "fn: t_labelReplace", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 40, }, File: "labelReplace_sub_string_match_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 40, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 40, }, File: "labelReplace_sub_string_match_test.flux", Source: "t_labelReplace", Start: ast.Position{ Column: 86, Line: 40, }, }, }, Name: "t_labelReplace", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 40, }, File: "labelReplace_sub_string_match_test.flux", Source: "test _labelReplace = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_labelReplace})", Start: ast.Position{ Column: 1, Line: 39, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "labelReplace_sub_string_match_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 2, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "labelReplace_sub_string_match_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 2, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "labelReplace_sub_string_match_test.flux", Source: "import \"internal/promql\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "labelReplace_sub_string_match_test.flux", Source: "\"internal/promql\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "internal/promql", }, }}, Metadata: "parser-type=rust", Name: "labelReplace_sub_string_match_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "labelReplace_sub_string_match_test.flux", Source: "package promql_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "labelReplace_sub_string_match_test.flux", Source: "promql_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "promql_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 57, }, File: "linearRegression_nopredict_test.flux", Source: "package promql_test\r\n\r\nimport \"testing\"\r\nimport \"internal/promql\"\r\nimport c \"csv\"\r\n\r\noption now = () =>\r\n\t(2030-01-01T00:00:00Z)\r\n// todo(faith): remove overload https://github.com/influxdata/flux/issues/3155\r\noption testing.loadStorage = (csv) => c.from(csv: csv)\r\n |> map(fn: (r) => ({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n }))\r\n\r\ninData = \"\r\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:53Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:03Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:13Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:23Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:53Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:53:03Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:13Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:23Z,metric_name2,100,prometheus\r\n,,2,2018-12-18T20:52:33Z,metric_name3,100,prometheus\r\n,,2,2018-12-18T20:52:43Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:52:53Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:03Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:53:13Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:23Z,metric_name3,400,prometheus\r\n,,3,2018-12-18T20:52:33Z,metric_name4,100,prometheus\r\n\"\r\noutData = \"\r\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_start,_stop,_field,_value,_measurement\r\n,,0,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name1,0,prometheus\r\n,,1,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name2,2.545714285714286,prometheus\r\n,,2,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name3,4.857142857142857,prometheus\r\n\"\r\nt_linearRegression = (table=<-) =>\r\n\t(table\r\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)\r\n\t\t|> promql.linearRegression(predict: false, fromNow: 0.0))\r\n\r\ntest _linearRegression = () =>\r\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_linearRegression})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 8, }, File: "linearRegression_nopredict_test.flux", Source: "now = () =>\r\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 7, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 7, }, File: "linearRegression_nopredict_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 7, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 8, }, File: "linearRegression_nopredict_test.flux", Source: "() =>\r\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 8, }, File: "linearRegression_nopredict_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 2, Line: 8, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 8, }, File: "linearRegression_nopredict_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 3, Line: 8, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 8, }, File: "linearRegression_nopredict_test.flux", Source: "option now = () =>\r\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.OptionStatement{ Assignment: &ast.MemberAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 15, }, File: "linearRegression_nopredict_test.flux", Source: "testing.loadStorage = (csv) => c.from(csv: csv)\r\n |> map(fn: (r) => ({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n }))", Start: ast.Position{ Column: 8, Line: 10, }, }, }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 15, }, File: "linearRegression_nopredict_test.flux", Source: "(csv) => c.from(csv: csv)\r\n |> map(fn: (r) => ({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n }))", Start: ast.Position{ Column: 30, Line: 10, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 10, }, File: "linearRegression_nopredict_test.flux", Source: "csv: csv", Start: ast.Position{ Column: 46, Line: 10, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 10, }, File: "linearRegression_nopredict_test.flux", Source: "csv: csv", Start: ast.Position{ Column: 46, Line: 10, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 10, }, File: "linearRegression_nopredict_test.flux", Source: "csv", Start: ast.Position{ Column: 46, Line: 10, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 10, }, File: "linearRegression_nopredict_test.flux", Source: "csv", Start: ast.Position{ Column: 51, Line: 10, }, }, }, Name: "csv", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 55, Line: 10, }, File: "linearRegression_nopredict_test.flux", Source: "c.from(csv: csv)", Start: ast.Position{ Column: 39, Line: 10, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 10, }, File: "linearRegression_nopredict_test.flux", Source: "c.from", Start: ast.Position{ Column: 39, Line: 10, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 10, }, File: "linearRegression_nopredict_test.flux", Source: "c", Start: ast.Position{ Column: 39, Line: 10, }, }, }, Name: "c", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 10, }, File: "linearRegression_nopredict_test.flux", Source: "from", Start: ast.Position{ Column: 41, Line: 10, }, }, }, Name: "from", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 15, }, File: "linearRegression_nopredict_test.flux", Source: "c.from(csv: csv)\r\n |> map(fn: (r) => ({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n }))", Start: ast.Position{ Column: 39, Line: 10, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 15, }, File: "linearRegression_nopredict_test.flux", Source: "fn: (r) => ({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n })", Start: ast.Position{ Column: 12, Line: 11, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 15, }, File: "linearRegression_nopredict_test.flux", Source: "fn: (r) => ({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n })", Start: ast.Position{ Column: 12, Line: 11, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 11, }, File: "linearRegression_nopredict_test.flux", Source: "fn", Start: ast.Position{ Column: 12, Line: 11, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 15, }, File: "linearRegression_nopredict_test.flux", Source: "(r) => ({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n })", Start: ast.Position{ Column: 16, Line: 11, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 15, }, File: "linearRegression_nopredict_test.flux", Source: "({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n })", Start: ast.Position{ Column: 23, Line: 11, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 6, Line: 15, }, File: "linearRegression_nopredict_test.flux", Source: "{r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n }", Start: ast.Position{ Column: 24, Line: 11, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 12, }, File: "linearRegression_nopredict_test.flux", Source: "_field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\")", Start: ast.Position{ Column: 5, Line: 12, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 12, }, File: "linearRegression_nopredict_test.flux", Source: "_field", Start: ast.Position{ Column: 5, Line: 12, }, }, }, Name: "_field", }, Separator: nil, Value: &ast.ConditionalExpression{ Alternate: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 12, }, File: "linearRegression_nopredict_test.flux", Source: "msg: \"test input table does not have _field column\"", Start: ast.Position{ Column: 55, Line: 12, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 12, }, File: "linearRegression_nopredict_test.flux", Source: "msg: \"test input table does not have _field column\"", Start: ast.Position{ Column: 55, Line: 12, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 12, }, File: "linearRegression_nopredict_test.flux", Source: "msg", Start: ast.Position{ Column: 55, Line: 12, }, }, }, Name: "msg", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 12, }, File: "linearRegression_nopredict_test.flux", Source: "\"test input table does not have _field column\"", Start: ast.Position{ Column: 60, Line: 12, }, }, }, Value: "test input table does not have _field column", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 12, }, File: "linearRegression_nopredict_test.flux", Source: "die(msg: \"test input table does not have _field column\")", Start: ast.Position{ Column: 51, Line: 12, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 12, }, File: "linearRegression_nopredict_test.flux", Source: "die", Start: ast.Position{ Column: 51, Line: 12, }, }, }, Name: "die", }, Lparen: nil, Rparen: nil, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 12, }, File: "linearRegression_nopredict_test.flux", Source: "if exists r._field then r._field else die(msg: \"test input table does not have _field column\")", Start: ast.Position{ Column: 13, Line: 12, }, }, }, Consequent: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 12, }, File: "linearRegression_nopredict_test.flux", Source: "r._field", Start: ast.Position{ Column: 37, Line: 12, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 38, Line: 12, }, File: "linearRegression_nopredict_test.flux", Source: "r", Start: ast.Position{ Column: 37, Line: 12, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 12, }, File: "linearRegression_nopredict_test.flux", Source: "_field", Start: ast.Position{ Column: 39, Line: 12, }, }, }, Name: "_field", }, Rbrack: nil, }, Test: &ast.UnaryExpression{ Argument: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 12, }, File: "linearRegression_nopredict_test.flux", Source: "r._field", Start: ast.Position{ Column: 23, Line: 12, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 12, }, File: "linearRegression_nopredict_test.flux", Source: "r", Start: ast.Position{ Column: 23, Line: 12, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 12, }, File: "linearRegression_nopredict_test.flux", Source: "_field", Start: ast.Position{ Column: 25, Line: 12, }, }, }, Name: "_field", }, Rbrack: nil, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 12, }, File: "linearRegression_nopredict_test.flux", Source: "exists r._field", Start: ast.Position{ Column: 16, Line: 12, }, }, }, Operator: 14, }, Tk_else: nil, Tk_if: nil, Tk_then: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 131, Line: 13, }, File: "linearRegression_nopredict_test.flux", Source: "_measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\")", Start: ast.Position{ Column: 5, Line: 13, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 13, }, File: "linearRegression_nopredict_test.flux", Source: "_measurement", Start: ast.Position{ Column: 5, Line: 13, }, }, }, Name: "_measurement", }, Separator: nil, Value: &ast.ConditionalExpression{ Alternate: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 130, Line: 13, }, File: "linearRegression_nopredict_test.flux", Source: "msg: \"test input table does not have _measurement column\"", Start: ast.Position{ Column: 73, Line: 13, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 130, Line: 13, }, File: "linearRegression_nopredict_test.flux", Source: "msg: \"test input table does not have _measurement column\"", Start: ast.Position{ Column: 73, Line: 13, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 13, }, File: "linearRegression_nopredict_test.flux", Source: "msg", Start: ast.Position{ Column: 73, Line: 13, }, }, }, Name: "msg", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 130, Line: 13, }, File: "linearRegression_nopredict_test.flux", Source: "\"test input table does not have _measurement column\"", Start: ast.Position{ Column: 78, Line: 13, }, }, }, Value: "test input table does not have _measurement column", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 131, Line: 13, }, File: "linearRegression_nopredict_test.flux", Source: "die(msg: \"test input table does not have _measurement column\")", Start: ast.Position{ Column: 69, Line: 13, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 13, }, File: "linearRegression_nopredict_test.flux", Source: "die", Start: ast.Position{ Column: 69, Line: 13, }, }, }, Name: "die", }, Lparen: nil, Rparen: nil, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 131, Line: 13, }, File: "linearRegression_nopredict_test.flux", Source: "if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\")", Start: ast.Position{ Column: 19, Line: 13, }, }, }, Consequent: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 13, }, File: "linearRegression_nopredict_test.flux", Source: "r._measurement", Start: ast.Position{ Column: 49, Line: 13, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 13, }, File: "linearRegression_nopredict_test.flux", Source: "r", Start: ast.Position{ Column: 49, Line: 13, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 13, }, File: "linearRegression_nopredict_test.flux", Source: "_measurement", Start: ast.Position{ Column: 51, Line: 13, }, }, }, Name: "_measurement", }, Rbrack: nil, }, Test: &ast.UnaryExpression{ Argument: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 13, }, File: "linearRegression_nopredict_test.flux", Source: "r._measurement", Start: ast.Position{ Column: 29, Line: 13, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 13, }, File: "linearRegression_nopredict_test.flux", Source: "r", Start: ast.Position{ Column: 29, Line: 13, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 13, }, File: "linearRegression_nopredict_test.flux", Source: "_measurement", Start: ast.Position{ Column: 31, Line: 13, }, }, }, Name: "_measurement", }, Rbrack: nil, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 13, }, File: "linearRegression_nopredict_test.flux", Source: "exists r._measurement", Start: ast.Position{ Column: 22, Line: 13, }, }, }, Operator: 14, }, Tk_else: nil, Tk_if: nil, Tk_then: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 14, }, File: "linearRegression_nopredict_test.flux", Source: "_time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")", Start: ast.Position{ Column: 5, Line: 14, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 14, }, File: "linearRegression_nopredict_test.flux", Source: "_time", Start: ast.Position{ Column: 5, Line: 14, }, }, }, Name: "_time", }, Separator: nil, Value: &ast.ConditionalExpression{ Alternate: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 14, }, File: "linearRegression_nopredict_test.flux", Source: "msg: \"test input table does not have _time column\"", Start: ast.Position{ Column: 52, Line: 14, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 14, }, File: "linearRegression_nopredict_test.flux", Source: "msg: \"test input table does not have _time column\"", Start: ast.Position{ Column: 52, Line: 14, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 55, Line: 14, }, File: "linearRegression_nopredict_test.flux", Source: "msg", Start: ast.Position{ Column: 52, Line: 14, }, }, }, Name: "msg", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 14, }, File: "linearRegression_nopredict_test.flux", Source: "\"test input table does not have _time column\"", Start: ast.Position{ Column: 57, Line: 14, }, }, }, Value: "test input table does not have _time column", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 14, }, File: "linearRegression_nopredict_test.flux", Source: "die(msg: \"test input table does not have _time column\")", Start: ast.Position{ Column: 48, Line: 14, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 51, Line: 14, }, File: "linearRegression_nopredict_test.flux", Source: "die", Start: ast.Position{ Column: 48, Line: 14, }, }, }, Name: "die", }, Lparen: nil, Rparen: nil, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 14, }, File: "linearRegression_nopredict_test.flux", Source: "if exists r._time then r._time else die(msg: \"test input table does not have _time column\")", Start: ast.Position{ Column: 12, Line: 14, }, }, }, Consequent: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 14, }, File: "linearRegression_nopredict_test.flux", Source: "r._time", Start: ast.Position{ Column: 35, Line: 14, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 14, }, File: "linearRegression_nopredict_test.flux", Source: "r", Start: ast.Position{ Column: 35, Line: 14, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 14, }, File: "linearRegression_nopredict_test.flux", Source: "_time", Start: ast.Position{ Column: 37, Line: 14, }, }, }, Name: "_time", }, Rbrack: nil, }, Test: &ast.UnaryExpression{ Argument: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 14, }, File: "linearRegression_nopredict_test.flux", Source: "r._time", Start: ast.Position{ Column: 22, Line: 14, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 14, }, File: "linearRegression_nopredict_test.flux", Source: "r", Start: ast.Position{ Column: 22, Line: 14, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 14, }, File: "linearRegression_nopredict_test.flux", Source: "_time", Start: ast.Position{ Column: 24, Line: 14, }, }, }, Name: "_time", }, Rbrack: nil, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 14, }, File: "linearRegression_nopredict_test.flux", Source: "exists r._time", Start: ast.Position{ Column: 15, Line: 14, }, }, }, Operator: 14, }, Tk_else: nil, Tk_if: nil, Tk_then: nil, }, }}, Rbrace: nil, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 26, Line: 11, }, File: "linearRegression_nopredict_test.flux", Source: "r", Start: ast.Position{ Column: 25, Line: 11, }, }, }, Name: "r", }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 11, }, File: "linearRegression_nopredict_test.flux", Source: "r", Start: ast.Position{ Column: 17, Line: 11, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 11, }, File: "linearRegression_nopredict_test.flux", Source: "r", Start: ast.Position{ Column: 17, Line: 11, }, }, }, Name: "r", }, Separator: nil, Value: nil, }}, Rparan: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 15, }, File: "linearRegression_nopredict_test.flux", Source: "map(fn: (r) => ({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n }))", Start: ast.Position{ Column: 8, Line: 11, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 11, }, File: "linearRegression_nopredict_test.flux", Source: "map", Start: ast.Position{ Column: 8, Line: 11, }, }, }, Name: "map", }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 10, }, File: "linearRegression_nopredict_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 10, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 10, }, File: "linearRegression_nopredict_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 10, }, }, }, Name: "csv", }, Separator: nil, Value: nil, }}, Rparan: nil, }, Member: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 10, }, File: "linearRegression_nopredict_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 8, Line: 10, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 10, }, File: "linearRegression_nopredict_test.flux", Source: "testing", Start: ast.Position{ Column: 8, Line: 10, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 10, }, File: "linearRegression_nopredict_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 16, Line: 10, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, }, BaseNode: ast.BaseNode{ Comments: []ast.Comment{ast.Comment{Text: "// todo(faith): remove overload https://github.com/influxdata/flux/issues/3155\r\n"}}, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 15, }, File: "linearRegression_nopredict_test.flux", Source: "option testing.loadStorage = (csv) => c.from(csv: csv)\r\n |> map(fn: (r) => ({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n }))", Start: ast.Position{ Column: 1, Line: 10, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 41, }, File: "linearRegression_nopredict_test.flux", Source: "inData = \"\r\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:53Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:03Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:13Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:23Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:53Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:53:03Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:13Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:23Z,metric_name2,100,prometheus\r\n,,2,2018-12-18T20:52:33Z,metric_name3,100,prometheus\r\n,,2,2018-12-18T20:52:43Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:52:53Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:03Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:53:13Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:23Z,metric_name3,400,prometheus\r\n,,3,2018-12-18T20:52:33Z,metric_name4,100,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 17, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 17, }, File: "linearRegression_nopredict_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 17, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 41, }, File: "linearRegression_nopredict_test.flux", Source: "\"\r\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:53Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:03Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:13Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:23Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:53Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:53:03Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:13Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:23Z,metric_name2,100,prometheus\r\n,,2,2018-12-18T20:52:33Z,metric_name3,100,prometheus\r\n,,2,2018-12-18T20:52:43Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:52:53Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:03Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:53:13Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:23Z,metric_name3,400,prometheus\r\n,,3,2018-12-18T20:52:33Z,metric_name4,100,prometheus\r\n\"", Start: ast.Position{ Column: 10, Line: 17, }, }, }, Value: "\r\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:53Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:03Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:13Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:23Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:53Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:53:03Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:13Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:23Z,metric_name2,100,prometheus\r\n,,2,2018-12-18T20:52:33Z,metric_name3,100,prometheus\r\n,,2,2018-12-18T20:52:43Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:52:53Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:03Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:53:13Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:23Z,metric_name3,400,prometheus\r\n,,3,2018-12-18T20:52:33Z,metric_name4,100,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 50, }, File: "linearRegression_nopredict_test.flux", Source: "outData = \"\r\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_start,_stop,_field,_value,_measurement\r\n,,0,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name1,0,prometheus\r\n,,1,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name2,2.545714285714286,prometheus\r\n,,2,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name3,4.857142857142857,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 42, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 42, }, File: "linearRegression_nopredict_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 42, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 50, }, File: "linearRegression_nopredict_test.flux", Source: "\"\r\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_start,_stop,_field,_value,_measurement\r\n,,0,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name1,0,prometheus\r\n,,1,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name2,2.545714285714286,prometheus\r\n,,2,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name3,4.857142857142857,prometheus\r\n\"", Start: ast.Position{ Column: 11, Line: 42, }, }, }, Value: "\r\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_start,_stop,_field,_value,_measurement\r\n,,0,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name1,0,prometheus\r\n,,1,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name2,2.545714285714286,prometheus\r\n,,2,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name3,4.857142857142857,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 54, }, File: "linearRegression_nopredict_test.flux", Source: "t_linearRegression = (table=<-) =>\r\n\t(table\r\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)\r\n\t\t|> promql.linearRegression(predict: false, fromNow: 0.0))", Start: ast.Position{ Column: 1, Line: 51, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 51, }, File: "linearRegression_nopredict_test.flux", Source: "t_linearRegression", Start: ast.Position{ Column: 1, Line: 51, }, }, }, Name: "t_linearRegression", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 54, }, File: "linearRegression_nopredict_test.flux", Source: "(table=<-) =>\r\n\t(table\r\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)\r\n\t\t|> promql.linearRegression(predict: false, fromNow: 0.0))", Start: ast.Position{ Column: 22, Line: 51, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 54, }, File: "linearRegression_nopredict_test.flux", Source: "(table\r\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)\r\n\t\t|> promql.linearRegression(predict: false, fromNow: 0.0))", Start: ast.Position{ Column: 2, Line: 52, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 52, }, File: "linearRegression_nopredict_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 52, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 53, }, File: "linearRegression_nopredict_test.flux", Source: "table\r\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)", Start: ast.Position{ Column: 3, Line: 52, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 53, }, File: "linearRegression_nopredict_test.flux", Source: "start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z", Start: ast.Position{ Column: 12, Line: 53, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 53, }, File: "linearRegression_nopredict_test.flux", Source: "start: 2018-12-18T20:50:00Z", Start: ast.Position{ Column: 12, Line: 53, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 53, }, File: "linearRegression_nopredict_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 53, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 53, }, File: "linearRegression_nopredict_test.flux", Source: "2018-12-18T20:50:00Z", Start: ast.Position{ Column: 19, Line: 53, }, }, }, Value: parser.MustParseTime("2018-12-18T20:50:00Z"), }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 53, }, File: "linearRegression_nopredict_test.flux", Source: "stop: 2018-12-18T20:55:00Z", Start: ast.Position{ Column: 41, Line: 53, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 53, }, File: "linearRegression_nopredict_test.flux", Source: "stop", Start: ast.Position{ Column: 41, Line: 53, }, }, }, Name: "stop", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 53, }, File: "linearRegression_nopredict_test.flux", Source: "2018-12-18T20:55:00Z", Start: ast.Position{ Column: 47, Line: 53, }, }, }, Value: parser.MustParseTime("2018-12-18T20:55:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 53, }, File: "linearRegression_nopredict_test.flux", Source: "range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)", Start: ast.Position{ Column: 6, Line: 53, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 53, }, File: "linearRegression_nopredict_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 53, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 54, }, File: "linearRegression_nopredict_test.flux", Source: "table\r\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)\r\n\t\t|> promql.linearRegression(predict: false, fromNow: 0.0)", Start: ast.Position{ Column: 3, Line: 52, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 54, }, File: "linearRegression_nopredict_test.flux", Source: "predict: false, fromNow: 0.0", Start: ast.Position{ Column: 30, Line: 54, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 44, Line: 54, }, File: "linearRegression_nopredict_test.flux", Source: "predict: false", Start: ast.Position{ Column: 30, Line: 54, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 54, }, File: "linearRegression_nopredict_test.flux", Source: "predict", Start: ast.Position{ Column: 30, Line: 54, }, }, }, Name: "predict", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 44, Line: 54, }, File: "linearRegression_nopredict_test.flux", Source: "false", Start: ast.Position{ Column: 39, Line: 54, }, }, }, Name: "false", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 54, }, File: "linearRegression_nopredict_test.flux", Source: "fromNow: 0.0", Start: ast.Position{ Column: 46, Line: 54, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 54, }, File: "linearRegression_nopredict_test.flux", Source: "fromNow", Start: ast.Position{ Column: 46, Line: 54, }, }, }, Name: "fromNow", }, Separator: nil, Value: &ast.FloatLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 54, }, File: "linearRegression_nopredict_test.flux", Source: "0.0", Start: ast.Position{ Column: 55, Line: 54, }, }, }, Value: 0.0, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 54, }, File: "linearRegression_nopredict_test.flux", Source: "promql.linearRegression(predict: false, fromNow: 0.0)", Start: ast.Position{ Column: 6, Line: 54, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 54, }, File: "linearRegression_nopredict_test.flux", Source: "promql.linearRegression", Start: ast.Position{ Column: 6, Line: 54, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 54, }, File: "linearRegression_nopredict_test.flux", Source: "promql", Start: ast.Position{ Column: 6, Line: 54, }, }, }, Name: "promql", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 54, }, File: "linearRegression_nopredict_test.flux", Source: "linearRegression", Start: ast.Position{ Column: 13, Line: 54, }, }, }, Name: "linearRegression", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 51, }, File: "linearRegression_nopredict_test.flux", Source: "table=<-", Start: ast.Position{ Column: 23, Line: 51, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 51, }, File: "linearRegression_nopredict_test.flux", Source: "table", Start: ast.Position{ Column: 23, Line: 51, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 51, }, File: "linearRegression_nopredict_test.flux", Source: "<-", Start: ast.Position{ Column: 29, Line: 51, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 57, }, File: "linearRegression_nopredict_test.flux", Source: "_linearRegression = () =>\r\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_linearRegression})", Start: ast.Position{ Column: 6, Line: 56, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 56, }, File: "linearRegression_nopredict_test.flux", Source: "_linearRegression", Start: ast.Position{ Column: 6, Line: 56, }, }, }, Name: "_linearRegression", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 57, }, File: "linearRegression_nopredict_test.flux", Source: "() =>\r\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_linearRegression})", Start: ast.Position{ Column: 26, Line: 56, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 57, }, File: "linearRegression_nopredict_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_linearRegression})", Start: ast.Position{ Column: 2, Line: 57, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 57, }, File: "linearRegression_nopredict_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_linearRegression}", Start: ast.Position{ Column: 3, Line: 57, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 57, }, File: "linearRegression_nopredict_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 57, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 57, }, File: "linearRegression_nopredict_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 57, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 57, }, File: "linearRegression_nopredict_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 57, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 57, }, File: "linearRegression_nopredict_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 57, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 57, }, File: "linearRegression_nopredict_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 57, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 57, }, File: "linearRegression_nopredict_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 57, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 57, }, File: "linearRegression_nopredict_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 57, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 57, }, File: "linearRegression_nopredict_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 57, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 57, }, File: "linearRegression_nopredict_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 57, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 57, }, File: "linearRegression_nopredict_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 57, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 57, }, File: "linearRegression_nopredict_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 57, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 57, }, File: "linearRegression_nopredict_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 57, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 57, }, File: "linearRegression_nopredict_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 57, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 57, }, File: "linearRegression_nopredict_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 57, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 57, }, File: "linearRegression_nopredict_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 57, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 57, }, File: "linearRegression_nopredict_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 57, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 57, }, File: "linearRegression_nopredict_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 57, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 57, }, File: "linearRegression_nopredict_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 57, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 57, }, File: "linearRegression_nopredict_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 57, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 57, }, File: "linearRegression_nopredict_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 57, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 57, }, File: "linearRegression_nopredict_test.flux", Source: "fn: t_linearRegression", Start: ast.Position{ Column: 82, Line: 57, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 57, }, File: "linearRegression_nopredict_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 57, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 57, }, File: "linearRegression_nopredict_test.flux", Source: "t_linearRegression", Start: ast.Position{ Column: 86, Line: 57, }, }, }, Name: "t_linearRegression", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 57, }, File: "linearRegression_nopredict_test.flux", Source: "test _linearRegression = () =>\r\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_linearRegression})", Start: ast.Position{ Column: 1, Line: 56, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "linearRegression_nopredict_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "linearRegression_nopredict_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 4, }, File: "linearRegression_nopredict_test.flux", Source: "import \"internal/promql\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 4, }, File: "linearRegression_nopredict_test.flux", Source: "\"internal/promql\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "internal/promql", }, }, &ast.ImportDeclaration{ As: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 5, }, File: "linearRegression_nopredict_test.flux", Source: "c", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Name: "c", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 5, }, File: "linearRegression_nopredict_test.flux", Source: "import c \"csv\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 5, }, File: "linearRegression_nopredict_test.flux", Source: "\"csv\"", Start: ast.Position{ Column: 10, Line: 5, }, }, }, Value: "csv", }, }}, Metadata: "parser-type=rust", Name: "linearRegression_nopredict_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "linearRegression_nopredict_test.flux", Source: "package promql_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "linearRegression_nopredict_test.flux", Source: "promql_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "promql_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 57, }, File: "linearRegression_predict_test.flux", Source: "package promql_test\r\n\r\nimport \"testing\"\r\nimport \"internal/promql\"\r\nimport c \"csv\"\r\n\r\noption now = () =>\r\n\t(2030-01-01T00:00:00Z)\r\n// todo(faith): remove overload https://github.com/influxdata/flux/issues/3155\r\noption testing.loadStorage = (csv) => c.from(csv: csv)\r\n |> map(fn: (r) => ({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n }))\r\n\r\ninData = \"\r\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:53Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:03Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:13Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:23Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:53Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:53:03Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:13Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:23Z,metric_name2,100,prometheus\r\n,,2,2018-12-18T20:52:33Z,metric_name3,100,prometheus\r\n,,2,2018-12-18T20:52:43Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:52:53Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:03Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:53:13Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:23Z,metric_name3,400,prometheus\r\n,,3,2018-12-18T20:52:33Z,metric_name4,100,prometheus\r\n\"\r\noutData = \"\r\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_start,_stop,_field,_value,_measurement\r\n,,0,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name2,1888.5057142857145,prometheus\r\n,,2,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name3,3756.8571428571427,prometheus\r\n\"\r\nt_linearRegression = (table=<-) =>\r\n\t(table\r\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)\r\n\t\t|> promql.linearRegression(predict: true, fromNow: 600.0))\r\n\r\ntest _linearRegression = () =>\r\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_linearRegression})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 8, }, File: "linearRegression_predict_test.flux", Source: "now = () =>\r\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 7, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 7, }, File: "linearRegression_predict_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 7, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 8, }, File: "linearRegression_predict_test.flux", Source: "() =>\r\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 8, }, File: "linearRegression_predict_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 2, Line: 8, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 8, }, File: "linearRegression_predict_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 3, Line: 8, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 8, }, File: "linearRegression_predict_test.flux", Source: "option now = () =>\r\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.OptionStatement{ Assignment: &ast.MemberAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 15, }, File: "linearRegression_predict_test.flux", Source: "testing.loadStorage = (csv) => c.from(csv: csv)\r\n |> map(fn: (r) => ({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n }))", Start: ast.Position{ Column: 8, Line: 10, }, }, }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 15, }, File: "linearRegression_predict_test.flux", Source: "(csv) => c.from(csv: csv)\r\n |> map(fn: (r) => ({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n }))", Start: ast.Position{ Column: 30, Line: 10, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 10, }, File: "linearRegression_predict_test.flux", Source: "csv: csv", Start: ast.Position{ Column: 46, Line: 10, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 10, }, File: "linearRegression_predict_test.flux", Source: "csv: csv", Start: ast.Position{ Column: 46, Line: 10, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 10, }, File: "linearRegression_predict_test.flux", Source: "csv", Start: ast.Position{ Column: 46, Line: 10, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 10, }, File: "linearRegression_predict_test.flux", Source: "csv", Start: ast.Position{ Column: 51, Line: 10, }, }, }, Name: "csv", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 55, Line: 10, }, File: "linearRegression_predict_test.flux", Source: "c.from(csv: csv)", Start: ast.Position{ Column: 39, Line: 10, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 10, }, File: "linearRegression_predict_test.flux", Source: "c.from", Start: ast.Position{ Column: 39, Line: 10, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 10, }, File: "linearRegression_predict_test.flux", Source: "c", Start: ast.Position{ Column: 39, Line: 10, }, }, }, Name: "c", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 10, }, File: "linearRegression_predict_test.flux", Source: "from", Start: ast.Position{ Column: 41, Line: 10, }, }, }, Name: "from", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 15, }, File: "linearRegression_predict_test.flux", Source: "c.from(csv: csv)\r\n |> map(fn: (r) => ({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n }))", Start: ast.Position{ Column: 39, Line: 10, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 15, }, File: "linearRegression_predict_test.flux", Source: "fn: (r) => ({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n })", Start: ast.Position{ Column: 12, Line: 11, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 15, }, File: "linearRegression_predict_test.flux", Source: "fn: (r) => ({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n })", Start: ast.Position{ Column: 12, Line: 11, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 11, }, File: "linearRegression_predict_test.flux", Source: "fn", Start: ast.Position{ Column: 12, Line: 11, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 15, }, File: "linearRegression_predict_test.flux", Source: "(r) => ({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n })", Start: ast.Position{ Column: 16, Line: 11, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 15, }, File: "linearRegression_predict_test.flux", Source: "({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n })", Start: ast.Position{ Column: 23, Line: 11, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 6, Line: 15, }, File: "linearRegression_predict_test.flux", Source: "{r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n }", Start: ast.Position{ Column: 24, Line: 11, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 12, }, File: "linearRegression_predict_test.flux", Source: "_field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\")", Start: ast.Position{ Column: 5, Line: 12, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 12, }, File: "linearRegression_predict_test.flux", Source: "_field", Start: ast.Position{ Column: 5, Line: 12, }, }, }, Name: "_field", }, Separator: nil, Value: &ast.ConditionalExpression{ Alternate: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 12, }, File: "linearRegression_predict_test.flux", Source: "msg: \"test input table does not have _field column\"", Start: ast.Position{ Column: 55, Line: 12, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 12, }, File: "linearRegression_predict_test.flux", Source: "msg: \"test input table does not have _field column\"", Start: ast.Position{ Column: 55, Line: 12, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 12, }, File: "linearRegression_predict_test.flux", Source: "msg", Start: ast.Position{ Column: 55, Line: 12, }, }, }, Name: "msg", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 12, }, File: "linearRegression_predict_test.flux", Source: "\"test input table does not have _field column\"", Start: ast.Position{ Column: 60, Line: 12, }, }, }, Value: "test input table does not have _field column", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 12, }, File: "linearRegression_predict_test.flux", Source: "die(msg: \"test input table does not have _field column\")", Start: ast.Position{ Column: 51, Line: 12, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 12, }, File: "linearRegression_predict_test.flux", Source: "die", Start: ast.Position{ Column: 51, Line: 12, }, }, }, Name: "die", }, Lparen: nil, Rparen: nil, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 12, }, File: "linearRegression_predict_test.flux", Source: "if exists r._field then r._field else die(msg: \"test input table does not have _field column\")", Start: ast.Position{ Column: 13, Line: 12, }, }, }, Consequent: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 12, }, File: "linearRegression_predict_test.flux", Source: "r._field", Start: ast.Position{ Column: 37, Line: 12, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 38, Line: 12, }, File: "linearRegression_predict_test.flux", Source: "r", Start: ast.Position{ Column: 37, Line: 12, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 12, }, File: "linearRegression_predict_test.flux", Source: "_field", Start: ast.Position{ Column: 39, Line: 12, }, }, }, Name: "_field", }, Rbrack: nil, }, Test: &ast.UnaryExpression{ Argument: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 12, }, File: "linearRegression_predict_test.flux", Source: "r._field", Start: ast.Position{ Column: 23, Line: 12, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 12, }, File: "linearRegression_predict_test.flux", Source: "r", Start: ast.Position{ Column: 23, Line: 12, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 12, }, File: "linearRegression_predict_test.flux", Source: "_field", Start: ast.Position{ Column: 25, Line: 12, }, }, }, Name: "_field", }, Rbrack: nil, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 12, }, File: "linearRegression_predict_test.flux", Source: "exists r._field", Start: ast.Position{ Column: 16, Line: 12, }, }, }, Operator: 14, }, Tk_else: nil, Tk_if: nil, Tk_then: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 131, Line: 13, }, File: "linearRegression_predict_test.flux", Source: "_measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\")", Start: ast.Position{ Column: 5, Line: 13, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 13, }, File: "linearRegression_predict_test.flux", Source: "_measurement", Start: ast.Position{ Column: 5, Line: 13, }, }, }, Name: "_measurement", }, Separator: nil, Value: &ast.ConditionalExpression{ Alternate: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 130, Line: 13, }, File: "linearRegression_predict_test.flux", Source: "msg: \"test input table does not have _measurement column\"", Start: ast.Position{ Column: 73, Line: 13, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 130, Line: 13, }, File: "linearRegression_predict_test.flux", Source: "msg: \"test input table does not have _measurement column\"", Start: ast.Position{ Column: 73, Line: 13, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 13, }, File: "linearRegression_predict_test.flux", Source: "msg", Start: ast.Position{ Column: 73, Line: 13, }, }, }, Name: "msg", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 130, Line: 13, }, File: "linearRegression_predict_test.flux", Source: "\"test input table does not have _measurement column\"", Start: ast.Position{ Column: 78, Line: 13, }, }, }, Value: "test input table does not have _measurement column", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 131, Line: 13, }, File: "linearRegression_predict_test.flux", Source: "die(msg: \"test input table does not have _measurement column\")", Start: ast.Position{ Column: 69, Line: 13, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 13, }, File: "linearRegression_predict_test.flux", Source: "die", Start: ast.Position{ Column: 69, Line: 13, }, }, }, Name: "die", }, Lparen: nil, Rparen: nil, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 131, Line: 13, }, File: "linearRegression_predict_test.flux", Source: "if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\")", Start: ast.Position{ Column: 19, Line: 13, }, }, }, Consequent: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 13, }, File: "linearRegression_predict_test.flux", Source: "r._measurement", Start: ast.Position{ Column: 49, Line: 13, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 13, }, File: "linearRegression_predict_test.flux", Source: "r", Start: ast.Position{ Column: 49, Line: 13, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 13, }, File: "linearRegression_predict_test.flux", Source: "_measurement", Start: ast.Position{ Column: 51, Line: 13, }, }, }, Name: "_measurement", }, Rbrack: nil, }, Test: &ast.UnaryExpression{ Argument: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 13, }, File: "linearRegression_predict_test.flux", Source: "r._measurement", Start: ast.Position{ Column: 29, Line: 13, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 13, }, File: "linearRegression_predict_test.flux", Source: "r", Start: ast.Position{ Column: 29, Line: 13, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 13, }, File: "linearRegression_predict_test.flux", Source: "_measurement", Start: ast.Position{ Column: 31, Line: 13, }, }, }, Name: "_measurement", }, Rbrack: nil, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 13, }, File: "linearRegression_predict_test.flux", Source: "exists r._measurement", Start: ast.Position{ Column: 22, Line: 13, }, }, }, Operator: 14, }, Tk_else: nil, Tk_if: nil, Tk_then: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 14, }, File: "linearRegression_predict_test.flux", Source: "_time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")", Start: ast.Position{ Column: 5, Line: 14, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 14, }, File: "linearRegression_predict_test.flux", Source: "_time", Start: ast.Position{ Column: 5, Line: 14, }, }, }, Name: "_time", }, Separator: nil, Value: &ast.ConditionalExpression{ Alternate: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 14, }, File: "linearRegression_predict_test.flux", Source: "msg: \"test input table does not have _time column\"", Start: ast.Position{ Column: 52, Line: 14, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 14, }, File: "linearRegression_predict_test.flux", Source: "msg: \"test input table does not have _time column\"", Start: ast.Position{ Column: 52, Line: 14, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 55, Line: 14, }, File: "linearRegression_predict_test.flux", Source: "msg", Start: ast.Position{ Column: 52, Line: 14, }, }, }, Name: "msg", }, Separator: nil, Value: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 14, }, File: "linearRegression_predict_test.flux", Source: "\"test input table does not have _time column\"", Start: ast.Position{ Column: 57, Line: 14, }, }, }, Value: "test input table does not have _time column", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 14, }, File: "linearRegression_predict_test.flux", Source: "die(msg: \"test input table does not have _time column\")", Start: ast.Position{ Column: 48, Line: 14, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 51, Line: 14, }, File: "linearRegression_predict_test.flux", Source: "die", Start: ast.Position{ Column: 48, Line: 14, }, }, }, Name: "die", }, Lparen: nil, Rparen: nil, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 14, }, File: "linearRegression_predict_test.flux", Source: "if exists r._time then r._time else die(msg: \"test input table does not have _time column\")", Start: ast.Position{ Column: 12, Line: 14, }, }, }, Consequent: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 14, }, File: "linearRegression_predict_test.flux", Source: "r._time", Start: ast.Position{ Column: 35, Line: 14, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 14, }, File: "linearRegression_predict_test.flux", Source: "r", Start: ast.Position{ Column: 35, Line: 14, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 14, }, File: "linearRegression_predict_test.flux", Source: "_time", Start: ast.Position{ Column: 37, Line: 14, }, }, }, Name: "_time", }, Rbrack: nil, }, Test: &ast.UnaryExpression{ Argument: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 14, }, File: "linearRegression_predict_test.flux", Source: "r._time", Start: ast.Position{ Column: 22, Line: 14, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 14, }, File: "linearRegression_predict_test.flux", Source: "r", Start: ast.Position{ Column: 22, Line: 14, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 14, }, File: "linearRegression_predict_test.flux", Source: "_time", Start: ast.Position{ Column: 24, Line: 14, }, }, }, Name: "_time", }, Rbrack: nil, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 14, }, File: "linearRegression_predict_test.flux", Source: "exists r._time", Start: ast.Position{ Column: 15, Line: 14, }, }, }, Operator: 14, }, Tk_else: nil, Tk_if: nil, Tk_then: nil, }, }}, Rbrace: nil, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 26, Line: 11, }, File: "linearRegression_predict_test.flux", Source: "r", Start: ast.Position{ Column: 25, Line: 11, }, }, }, Name: "r", }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 11, }, File: "linearRegression_predict_test.flux", Source: "r", Start: ast.Position{ Column: 17, Line: 11, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 11, }, File: "linearRegression_predict_test.flux", Source: "r", Start: ast.Position{ Column: 17, Line: 11, }, }, }, Name: "r", }, Separator: nil, Value: nil, }}, Rparan: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 15, }, File: "linearRegression_predict_test.flux", Source: "map(fn: (r) => ({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n }))", Start: ast.Position{ Column: 8, Line: 11, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 11, }, File: "linearRegression_predict_test.flux", Source: "map", Start: ast.Position{ Column: 8, Line: 11, }, }, }, Name: "map", }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 10, }, File: "linearRegression_predict_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 10, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 10, }, File: "linearRegression_predict_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 10, }, }, }, Name: "csv", }, Separator: nil, Value: nil, }}, Rparan: nil, }, Member: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 10, }, File: "linearRegression_predict_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 8, Line: 10, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 10, }, File: "linearRegression_predict_test.flux", Source: "testing", Start: ast.Position{ Column: 8, Line: 10, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 10, }, File: "linearRegression_predict_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 16, Line: 10, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, }, BaseNode: ast.BaseNode{ Comments: []ast.Comment{ast.Comment{Text: "// todo(faith): remove overload https://github.com/influxdata/flux/issues/3155\r\n"}}, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 15, }, File: "linearRegression_predict_test.flux", Source: "option testing.loadStorage = (csv) => c.from(csv: csv)\r\n |> map(fn: (r) => ({r with\r\n _field: if exists r._field then r._field else die(msg: \"test input table does not have _field column\"),\r\n _measurement: if exists r._measurement then r._measurement else die(msg: \"test input table does not have _measurement column\"),\r\n _time: if exists r._time then r._time else die(msg: \"test input table does not have _time column\")\r\n }))", Start: ast.Position{ Column: 1, Line: 10, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 41, }, File: "linearRegression_predict_test.flux", Source: "inData = \"\r\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:53Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:03Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:13Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:23Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:53Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:53:03Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:13Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:23Z,metric_name2,100,prometheus\r\n,,2,2018-12-18T20:52:33Z,metric_name3,100,prometheus\r\n,,2,2018-12-18T20:52:43Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:52:53Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:03Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:53:13Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:23Z,metric_name3,400,prometheus\r\n,,3,2018-12-18T20:52:33Z,metric_name4,100,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 17, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 17, }, File: "linearRegression_predict_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 17, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 41, }, File: "linearRegression_predict_test.flux", Source: "\"\r\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:53Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:03Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:13Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:23Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:53Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:53:03Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:13Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:23Z,metric_name2,100,prometheus\r\n,,2,2018-12-18T20:52:33Z,metric_name3,100,prometheus\r\n,,2,2018-12-18T20:52:43Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:52:53Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:03Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:53:13Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:23Z,metric_name3,400,prometheus\r\n,,3,2018-12-18T20:52:33Z,metric_name4,100,prometheus\r\n\"", Start: ast.Position{ Column: 10, Line: 17, }, }, }, Value: "\r\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:53Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:03Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:13Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:23Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:53Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:53:03Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:13Z,metric_name2,100,prometheus\r\n,,1,2018-12-18T20:53:23Z,metric_name2,100,prometheus\r\n,,2,2018-12-18T20:52:33Z,metric_name3,100,prometheus\r\n,,2,2018-12-18T20:52:43Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:52:53Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:03Z,metric_name3,200,prometheus\r\n,,2,2018-12-18T20:53:13Z,metric_name3,300,prometheus\r\n,,2,2018-12-18T20:53:23Z,metric_name3,400,prometheus\r\n,,3,2018-12-18T20:52:33Z,metric_name4,100,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 50, }, File: "linearRegression_predict_test.flux", Source: "outData = \"\r\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_start,_stop,_field,_value,_measurement\r\n,,0,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name2,1888.5057142857145,prometheus\r\n,,2,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name3,3756.8571428571427,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 42, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 42, }, File: "linearRegression_predict_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 42, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 50, }, File: "linearRegression_predict_test.flux", Source: "\"\r\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_start,_stop,_field,_value,_measurement\r\n,,0,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name2,1888.5057142857145,prometheus\r\n,,2,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name3,3756.8571428571427,prometheus\r\n\"", Start: ast.Position{ Column: 11, Line: 42, }, }, }, Value: "\r\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_start,_stop,_field,_value,_measurement\r\n,,0,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name2,1888.5057142857145,prometheus\r\n,,2,2018-12-18T20:50:00Z,2018-12-18T20:55:00Z,metric_name3,3756.8571428571427,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 54, }, File: "linearRegression_predict_test.flux", Source: "t_linearRegression = (table=<-) =>\r\n\t(table\r\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)\r\n\t\t|> promql.linearRegression(predict: true, fromNow: 600.0))", Start: ast.Position{ Column: 1, Line: 51, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 51, }, File: "linearRegression_predict_test.flux", Source: "t_linearRegression", Start: ast.Position{ Column: 1, Line: 51, }, }, }, Name: "t_linearRegression", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 54, }, File: "linearRegression_predict_test.flux", Source: "(table=<-) =>\r\n\t(table\r\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)\r\n\t\t|> promql.linearRegression(predict: true, fromNow: 600.0))", Start: ast.Position{ Column: 22, Line: 51, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 54, }, File: "linearRegression_predict_test.flux", Source: "(table\r\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)\r\n\t\t|> promql.linearRegression(predict: true, fromNow: 600.0))", Start: ast.Position{ Column: 2, Line: 52, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 52, }, File: "linearRegression_predict_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 52, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 53, }, File: "linearRegression_predict_test.flux", Source: "table\r\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)", Start: ast.Position{ Column: 3, Line: 52, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 53, }, File: "linearRegression_predict_test.flux", Source: "start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z", Start: ast.Position{ Column: 12, Line: 53, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 53, }, File: "linearRegression_predict_test.flux", Source: "start: 2018-12-18T20:50:00Z", Start: ast.Position{ Column: 12, Line: 53, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 53, }, File: "linearRegression_predict_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 53, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 53, }, File: "linearRegression_predict_test.flux", Source: "2018-12-18T20:50:00Z", Start: ast.Position{ Column: 19, Line: 53, }, }, }, Value: parser.MustParseTime("2018-12-18T20:50:00Z"), }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 53, }, File: "linearRegression_predict_test.flux", Source: "stop: 2018-12-18T20:55:00Z", Start: ast.Position{ Column: 41, Line: 53, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 53, }, File: "linearRegression_predict_test.flux", Source: "stop", Start: ast.Position{ Column: 41, Line: 53, }, }, }, Name: "stop", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 53, }, File: "linearRegression_predict_test.flux", Source: "2018-12-18T20:55:00Z", Start: ast.Position{ Column: 47, Line: 53, }, }, }, Value: parser.MustParseTime("2018-12-18T20:55:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 53, }, File: "linearRegression_predict_test.flux", Source: "range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)", Start: ast.Position{ Column: 6, Line: 53, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 53, }, File: "linearRegression_predict_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 53, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 54, }, File: "linearRegression_predict_test.flux", Source: "table\r\n\t\t|> range(start: 2018-12-18T20:50:00Z, stop: 2018-12-18T20:55:00Z)\r\n\t\t|> promql.linearRegression(predict: true, fromNow: 600.0)", Start: ast.Position{ Column: 3, Line: 52, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 54, }, File: "linearRegression_predict_test.flux", Source: "predict: true, fromNow: 600.0", Start: ast.Position{ Column: 30, Line: 54, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 54, }, File: "linearRegression_predict_test.flux", Source: "predict: true", Start: ast.Position{ Column: 30, Line: 54, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 54, }, File: "linearRegression_predict_test.flux", Source: "predict", Start: ast.Position{ Column: 30, Line: 54, }, }, }, Name: "predict", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 54, }, File: "linearRegression_predict_test.flux", Source: "true", Start: ast.Position{ Column: 39, Line: 54, }, }, }, Name: "true", }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 54, }, File: "linearRegression_predict_test.flux", Source: "fromNow: 600.0", Start: ast.Position{ Column: 45, Line: 54, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 54, }, File: "linearRegression_predict_test.flux", Source: "fromNow", Start: ast.Position{ Column: 45, Line: 54, }, }, }, Name: "fromNow", }, Separator: nil, Value: &ast.FloatLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 54, }, File: "linearRegression_predict_test.flux", Source: "600.0", Start: ast.Position{ Column: 54, Line: 54, }, }, }, Value: 600.0, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 54, }, File: "linearRegression_predict_test.flux", Source: "promql.linearRegression(predict: true, fromNow: 600.0)", Start: ast.Position{ Column: 6, Line: 54, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 54, }, File: "linearRegression_predict_test.flux", Source: "promql.linearRegression", Start: ast.Position{ Column: 6, Line: 54, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 54, }, File: "linearRegression_predict_test.flux", Source: "promql", Start: ast.Position{ Column: 6, Line: 54, }, }, }, Name: "promql", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 54, }, File: "linearRegression_predict_test.flux", Source: "linearRegression", Start: ast.Position{ Column: 13, Line: 54, }, }, }, Name: "linearRegression", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 51, }, File: "linearRegression_predict_test.flux", Source: "table=<-", Start: ast.Position{ Column: 23, Line: 51, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 51, }, File: "linearRegression_predict_test.flux", Source: "table", Start: ast.Position{ Column: 23, Line: 51, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 51, }, File: "linearRegression_predict_test.flux", Source: "<-", Start: ast.Position{ Column: 29, Line: 51, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 57, }, File: "linearRegression_predict_test.flux", Source: "_linearRegression = () =>\r\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_linearRegression})", Start: ast.Position{ Column: 6, Line: 56, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 56, }, File: "linearRegression_predict_test.flux", Source: "_linearRegression", Start: ast.Position{ Column: 6, Line: 56, }, }, }, Name: "_linearRegression", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 57, }, File: "linearRegression_predict_test.flux", Source: "() =>\r\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_linearRegression})", Start: ast.Position{ Column: 26, Line: 56, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 57, }, File: "linearRegression_predict_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_linearRegression})", Start: ast.Position{ Column: 2, Line: 57, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 57, }, File: "linearRegression_predict_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_linearRegression}", Start: ast.Position{ Column: 3, Line: 57, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 57, }, File: "linearRegression_predict_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 57, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 57, }, File: "linearRegression_predict_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 57, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 57, }, File: "linearRegression_predict_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 57, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 57, }, File: "linearRegression_predict_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 57, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 57, }, File: "linearRegression_predict_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 57, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 57, }, File: "linearRegression_predict_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 57, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 57, }, File: "linearRegression_predict_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 57, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 57, }, File: "linearRegression_predict_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 57, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 57, }, File: "linearRegression_predict_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 57, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 57, }, File: "linearRegression_predict_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 57, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 57, }, File: "linearRegression_predict_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 57, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 57, }, File: "linearRegression_predict_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 57, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 57, }, File: "linearRegression_predict_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 57, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 57, }, File: "linearRegression_predict_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 57, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 57, }, File: "linearRegression_predict_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 57, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 57, }, File: "linearRegression_predict_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 57, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 57, }, File: "linearRegression_predict_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 57, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 57, }, File: "linearRegression_predict_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 57, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 57, }, File: "linearRegression_predict_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 57, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 57, }, File: "linearRegression_predict_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 57, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 57, }, File: "linearRegression_predict_test.flux", Source: "fn: t_linearRegression", Start: ast.Position{ Column: 82, Line: 57, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 57, }, File: "linearRegression_predict_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 57, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 57, }, File: "linearRegression_predict_test.flux", Source: "t_linearRegression", Start: ast.Position{ Column: 86, Line: 57, }, }, }, Name: "t_linearRegression", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 57, }, File: "linearRegression_predict_test.flux", Source: "test _linearRegression = () =>\r\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_linearRegression})", Start: ast.Position{ Column: 1, Line: 56, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "linearRegression_predict_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "linearRegression_predict_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 4, }, File: "linearRegression_predict_test.flux", Source: "import \"internal/promql\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 4, }, File: "linearRegression_predict_test.flux", Source: "\"internal/promql\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "internal/promql", }, }, &ast.ImportDeclaration{ As: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 5, }, File: "linearRegression_predict_test.flux", Source: "c", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Name: "c", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 5, }, File: "linearRegression_predict_test.flux", Source: "import c \"csv\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 5, }, File: "linearRegression_predict_test.flux", Source: "\"csv\"", Start: ast.Position{ Column: 10, Line: 5, }, }, }, Value: "csv", }, }}, Metadata: "parser-type=rust", Name: "linearRegression_predict_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "linearRegression_predict_test.flux", Source: "package promql_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "linearRegression_predict_test.flux", Source: "promql_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "promql_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 41, }, File: "minute_test.flux", Source: "package promql_test\nimport \"testing\"\nimport \"internal/promql\"\n\noption now = () =>\n\t(2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T00:00:00Z,metric_name,0,prometheus\r\n,,0,2018-02-04T00:01:00Z,metric_name,0,prometheus\r\n,,0,2018-03-05T00:02:00Z,metric_name,0,prometheus\r\n,,0,2018-10-06T00:57:00Z,metric_name,0,prometheus\r\n,,0,2018-11-07T00:58:00Z,metric_name,0,prometheus\r\n,,0,2018-12-08T00:59:00Z,metric_name,0,prometheus\r\n\"\noutData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,outData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T00:00:00Z,metric_name,0,prometheus\r\n,,0,2018-02-04T00:01:00Z,metric_name,1,prometheus\r\n,,0,2018-03-05T00:02:00Z,metric_name,2,prometheus\r\n,,0,2018-10-06T00:57:00Z,metric_name,57,prometheus\r\n,,0,2018-11-07T00:58:00Z,metric_name,58,prometheus\r\n,,0,2018-12-08T00:59:00Z,metric_name,59,prometheus\r\n\"\nt_promqlMinute = (table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()\n\t\t|> map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlMinute(timestamp: r._value)})))\n\ntest _promqlMinute = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlMinute})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "minute_test.flux", Source: "now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 5, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 5, }, File: "minute_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "minute_test.flux", Source: "() =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 5, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "minute_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 2, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 6, }, File: "minute_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 3, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "minute_test.flux", Source: "option now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 5, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "minute_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T00:00:00Z,metric_name,0,prometheus\r\n,,0,2018-02-04T00:01:00Z,metric_name,0,prometheus\r\n,,0,2018-03-05T00:02:00Z,metric_name,0,prometheus\r\n,,0,2018-10-06T00:57:00Z,metric_name,0,prometheus\r\n,,0,2018-11-07T00:58:00Z,metric_name,0,prometheus\r\n,,0,2018-12-08T00:59:00Z,metric_name,0,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "minute_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "minute_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T00:00:00Z,metric_name,0,prometheus\r\n,,0,2018-02-04T00:01:00Z,metric_name,0,prometheus\r\n,,0,2018-03-05T00:02:00Z,metric_name,0,prometheus\r\n,,0,2018-10-06T00:57:00Z,metric_name,0,prometheus\r\n,,0,2018-11-07T00:58:00Z,metric_name,0,prometheus\r\n,,0,2018-12-08T00:59:00Z,metric_name,0,prometheus\r\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T00:00:00Z,metric_name,0,prometheus\r\n,,0,2018-02-04T00:01:00Z,metric_name,0,prometheus\r\n,,0,2018-03-05T00:02:00Z,metric_name,0,prometheus\r\n,,0,2018-10-06T00:57:00Z,metric_name,0,prometheus\r\n,,0,2018-11-07T00:58:00Z,metric_name,0,prometheus\r\n,,0,2018-12-08T00:59:00Z,metric_name,0,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 31, }, File: "minute_test.flux", Source: "outData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,outData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T00:00:00Z,metric_name,0,prometheus\r\n,,0,2018-02-04T00:01:00Z,metric_name,1,prometheus\r\n,,0,2018-03-05T00:02:00Z,metric_name,2,prometheus\r\n,,0,2018-10-06T00:57:00Z,metric_name,57,prometheus\r\n,,0,2018-11-07T00:58:00Z,metric_name,58,prometheus\r\n,,0,2018-12-08T00:59:00Z,metric_name,59,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 20, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 20, }, File: "minute_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 20, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 31, }, File: "minute_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,outData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T00:00:00Z,metric_name,0,prometheus\r\n,,0,2018-02-04T00:01:00Z,metric_name,1,prometheus\r\n,,0,2018-03-05T00:02:00Z,metric_name,2,prometheus\r\n,,0,2018-10-06T00:57:00Z,metric_name,57,prometheus\r\n,,0,2018-11-07T00:58:00Z,metric_name,58,prometheus\r\n,,0,2018-12-08T00:59:00Z,metric_name,59,prometheus\r\n\"", Start: ast.Position{ Column: 11, Line: 20, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,outData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T00:00:00Z,metric_name,0,prometheus\r\n,,0,2018-02-04T00:01:00Z,metric_name,1,prometheus\r\n,,0,2018-03-05T00:02:00Z,metric_name,2,prometheus\r\n,,0,2018-10-06T00:57:00Z,metric_name,57,prometheus\r\n,,0,2018-11-07T00:58:00Z,metric_name,58,prometheus\r\n,,0,2018-12-08T00:59:00Z,metric_name,59,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 38, }, File: "minute_test.flux", Source: "t_promqlMinute = (table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()\n\t\t|> map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlMinute(timestamp: r._value)})))", Start: ast.Position{ Column: 1, Line: 32, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 32, }, File: "minute_test.flux", Source: "t_promqlMinute", Start: ast.Position{ Column: 1, Line: 32, }, }, }, Name: "t_promqlMinute", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 38, }, File: "minute_test.flux", Source: "(table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()\n\t\t|> map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlMinute(timestamp: r._value)})))", Start: ast.Position{ Column: 18, Line: 32, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 38, }, File: "minute_test.flux", Source: "(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()\n\t\t|> map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlMinute(timestamp: r._value)})))", Start: ast.Position{ Column: 2, Line: 33, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 33, }, File: "minute_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 33, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 34, }, File: "minute_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 33, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 34, }, File: "minute_test.flux", Source: "start: 1980-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 34, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 34, }, File: "minute_test.flux", Source: "start: 1980-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 34, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 34, }, File: "minute_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 34, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 34, }, File: "minute_test.flux", Source: "1980-01-01T00:00:00Z", Start: ast.Position{ Column: 19, Line: 34, }, }, }, Value: parser.MustParseTime("1980-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 34, }, File: "minute_test.flux", Source: "range(start: 1980-01-01T00:00:00Z)", Start: ast.Position{ Column: 6, Line: 34, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 34, }, File: "minute_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 34, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 35, }, File: "minute_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 3, Line: 33, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 35, }, File: "minute_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 11, Line: 35, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 35, }, File: "minute_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 11, Line: 35, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 35, }, File: "minute_test.flux", Source: "columns", Start: ast.Position{ Column: 11, Line: 35, }, }, }, Name: "columns", }, Separator: nil, Value: &ast.ArrayExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 35, }, File: "minute_test.flux", Source: "[\"_start\", \"_stop\"]", Start: ast.Position{ Column: 20, Line: 35, }, }, }, Elements: []ast.Expression{&ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 35, }, File: "minute_test.flux", Source: "\"_start\"", Start: ast.Position{ Column: 21, Line: 35, }, }, }, Value: "_start", }, &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 38, Line: 35, }, File: "minute_test.flux", Source: "\"_stop\"", Start: ast.Position{ Column: 31, Line: 35, }, }, }, Value: "_stop", }}, Lbrack: nil, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 35, }, File: "minute_test.flux", Source: "drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 6, Line: 35, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 35, }, File: "minute_test.flux", Source: "drop", Start: ast.Position{ Column: 6, Line: 35, }, }, }, Name: "drop", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 36, }, File: "minute_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()", Start: ast.Position{ Column: 3, Line: 33, }, }, }, Call: &ast.CallExpression{ Arguments: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 36, }, File: "minute_test.flux", Source: "promql.timestamp()", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 36, }, File: "minute_test.flux", Source: "promql.timestamp", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 36, }, File: "minute_test.flux", Source: "promql", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Name: "promql", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 36, }, File: "minute_test.flux", Source: "timestamp", Start: ast.Position{ Column: 13, Line: 36, }, }, }, Name: "timestamp", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 38, }, File: "minute_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()\n\t\t|> map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlMinute(timestamp: r._value)}))", Start: ast.Position{ Column: 3, Line: 33, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 38, }, File: "minute_test.flux", Source: "fn: (r) =>\n\t\t\t({r with _value: promql.promqlMinute(timestamp: r._value)})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 38, }, File: "minute_test.flux", Source: "fn: (r) =>\n\t\t\t({r with _value: promql.promqlMinute(timestamp: r._value)})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 37, }, File: "minute_test.flux", Source: "fn", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 38, }, File: "minute_test.flux", Source: "(r) =>\n\t\t\t({r with _value: promql.promqlMinute(timestamp: r._value)})", Start: ast.Position{ Column: 14, Line: 37, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 38, }, File: "minute_test.flux", Source: "({r with _value: promql.promqlMinute(timestamp: r._value)})", Start: ast.Position{ Column: 4, Line: 38, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 38, }, File: "minute_test.flux", Source: "{r with _value: promql.promqlMinute(timestamp: r._value)}", Start: ast.Position{ Column: 5, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 38, }, File: "minute_test.flux", Source: "_value: promql.promqlMinute(timestamp: r._value)", Start: ast.Position{ Column: 13, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 38, }, File: "minute_test.flux", Source: "_value", Start: ast.Position{ Column: 13, Line: 38, }, }, }, Name: "_value", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 38, }, File: "minute_test.flux", Source: "timestamp: r._value", Start: ast.Position{ Column: 41, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 38, }, File: "minute_test.flux", Source: "timestamp: r._value", Start: ast.Position{ Column: 41, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 50, Line: 38, }, File: "minute_test.flux", Source: "timestamp", Start: ast.Position{ Column: 41, Line: 38, }, }, }, Name: "timestamp", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 38, }, File: "minute_test.flux", Source: "r._value", Start: ast.Position{ Column: 52, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 38, }, File: "minute_test.flux", Source: "r", Start: ast.Position{ Column: 52, Line: 38, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 38, }, File: "minute_test.flux", Source: "_value", Start: ast.Position{ Column: 54, Line: 38, }, }, }, Name: "_value", }, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 38, }, File: "minute_test.flux", Source: "promql.promqlMinute(timestamp: r._value)", Start: ast.Position{ Column: 21, Line: 38, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 38, }, File: "minute_test.flux", Source: "promql.promqlMinute", Start: ast.Position{ Column: 21, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 38, }, File: "minute_test.flux", Source: "promql", Start: ast.Position{ Column: 21, Line: 38, }, }, }, Name: "promql", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 38, }, File: "minute_test.flux", Source: "promqlMinute", Start: ast.Position{ Column: 28, Line: 38, }, }, }, Name: "promqlMinute", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }}, Rbrace: nil, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 38, }, File: "minute_test.flux", Source: "r", Start: ast.Position{ Column: 6, Line: 38, }, }, }, Name: "r", }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "minute_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "minute_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Name: "r", }, Separator: nil, Value: nil, }}, Rparan: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 38, }, File: "minute_test.flux", Source: "map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlMinute(timestamp: r._value)}))", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 37, }, File: "minute_test.flux", Source: "map", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Name: "map", }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 32, }, File: "minute_test.flux", Source: "table=<-", Start: ast.Position{ Column: 19, Line: 32, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 32, }, File: "minute_test.flux", Source: "table", Start: ast.Position{ Column: 19, Line: 32, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 32, }, File: "minute_test.flux", Source: "<-", Start: ast.Position{ Column: 25, Line: 32, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 41, }, File: "minute_test.flux", Source: "_promqlMinute = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlMinute})", Start: ast.Position{ Column: 6, Line: 40, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 40, }, File: "minute_test.flux", Source: "_promqlMinute", Start: ast.Position{ Column: 6, Line: 40, }, }, }, Name: "_promqlMinute", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 41, }, File: "minute_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlMinute})", Start: ast.Position{ Column: 22, Line: 40, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 41, }, File: "minute_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlMinute})", Start: ast.Position{ Column: 2, Line: 41, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 41, }, File: "minute_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlMinute}", Start: ast.Position{ Column: 3, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 41, }, File: "minute_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 41, }, File: "minute_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 41, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 41, }, File: "minute_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 41, }, File: "minute_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 41, }, File: "minute_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 41, }, File: "minute_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 41, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 41, }, File: "minute_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 41, }, File: "minute_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 41, }, File: "minute_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 41, }, File: "minute_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 41, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 41, }, File: "minute_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 41, }, File: "minute_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 41, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 41, }, File: "minute_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 41, }, File: "minute_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 41, }, File: "minute_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 41, }, File: "minute_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 41, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 41, }, File: "minute_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 41, }, File: "minute_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 41, }, File: "minute_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 41, }, File: "minute_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 41, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 41, }, File: "minute_test.flux", Source: "fn: t_promqlMinute", Start: ast.Position{ Column: 82, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 41, }, File: "minute_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 41, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 41, }, File: "minute_test.flux", Source: "t_promqlMinute", Start: ast.Position{ Column: 86, Line: 41, }, }, }, Name: "t_promqlMinute", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 41, }, File: "minute_test.flux", Source: "test _promqlMinute = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlMinute})", Start: ast.Position{ Column: 1, Line: 40, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "minute_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 2, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "minute_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 2, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "minute_test.flux", Source: "import \"internal/promql\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "minute_test.flux", Source: "\"internal/promql\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "internal/promql", }, }}, Metadata: "parser-type=rust", Name: "minute_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "minute_test.flux", Source: "package promql_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "minute_test.flux", Source: "promql_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "promql_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 41, }, File: "month_test.flux", Source: "package promql_test\nimport \"testing\"\nimport \"internal/promql\"\n\noption now = () =>\n\t(2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-02-04T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-03-05T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-10-06T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-11-07T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-08T20:00:00Z,metric_name,0,prometheus\r\n\"\noutData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,outData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T20:00:00Z,metric_name,1,prometheus\r\n,,0,2018-02-04T20:00:00Z,metric_name,2,prometheus\r\n,,0,2018-03-05T20:00:00Z,metric_name,3,prometheus\r\n,,0,2018-10-06T20:00:00Z,metric_name,10,prometheus\r\n,,0,2018-11-07T20:00:00Z,metric_name,11,prometheus\r\n,,0,2018-12-08T20:00:00Z,metric_name,12,prometheus\r\n\"\nt_promqlMonth = (table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()\n\t\t|> map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlMonth(timestamp: r._value)})))\n\ntest _promqlMonth = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlMonth})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "month_test.flux", Source: "now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 5, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 5, }, File: "month_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "month_test.flux", Source: "() =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 5, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "month_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 2, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 6, }, File: "month_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 3, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "month_test.flux", Source: "option now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 5, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "month_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-02-04T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-03-05T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-10-06T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-11-07T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-08T20:00:00Z,metric_name,0,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "month_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "month_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-02-04T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-03-05T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-10-06T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-11-07T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-08T20:00:00Z,metric_name,0,prometheus\r\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-02-04T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-03-05T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-10-06T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-11-07T20:00:00Z,metric_name,0,prometheus\r\n,,0,2018-12-08T20:00:00Z,metric_name,0,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 31, }, File: "month_test.flux", Source: "outData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,outData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T20:00:00Z,metric_name,1,prometheus\r\n,,0,2018-02-04T20:00:00Z,metric_name,2,prometheus\r\n,,0,2018-03-05T20:00:00Z,metric_name,3,prometheus\r\n,,0,2018-10-06T20:00:00Z,metric_name,10,prometheus\r\n,,0,2018-11-07T20:00:00Z,metric_name,11,prometheus\r\n,,0,2018-12-08T20:00:00Z,metric_name,12,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 20, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 20, }, File: "month_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 20, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 31, }, File: "month_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,outData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T20:00:00Z,metric_name,1,prometheus\r\n,,0,2018-02-04T20:00:00Z,metric_name,2,prometheus\r\n,,0,2018-03-05T20:00:00Z,metric_name,3,prometheus\r\n,,0,2018-10-06T20:00:00Z,metric_name,10,prometheus\r\n,,0,2018-11-07T20:00:00Z,metric_name,11,prometheus\r\n,,0,2018-12-08T20:00:00Z,metric_name,12,prometheus\r\n\"", Start: ast.Position{ Column: 11, Line: 20, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,outData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T20:00:00Z,metric_name,1,prometheus\r\n,,0,2018-02-04T20:00:00Z,metric_name,2,prometheus\r\n,,0,2018-03-05T20:00:00Z,metric_name,3,prometheus\r\n,,0,2018-10-06T20:00:00Z,metric_name,10,prometheus\r\n,,0,2018-11-07T20:00:00Z,metric_name,11,prometheus\r\n,,0,2018-12-08T20:00:00Z,metric_name,12,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 38, }, File: "month_test.flux", Source: "t_promqlMonth = (table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()\n\t\t|> map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlMonth(timestamp: r._value)})))", Start: ast.Position{ Column: 1, Line: 32, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 32, }, File: "month_test.flux", Source: "t_promqlMonth", Start: ast.Position{ Column: 1, Line: 32, }, }, }, Name: "t_promqlMonth", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 38, }, File: "month_test.flux", Source: "(table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()\n\t\t|> map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlMonth(timestamp: r._value)})))", Start: ast.Position{ Column: 17, Line: 32, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 38, }, File: "month_test.flux", Source: "(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()\n\t\t|> map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlMonth(timestamp: r._value)})))", Start: ast.Position{ Column: 2, Line: 33, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 33, }, File: "month_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 33, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 34, }, File: "month_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 33, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 34, }, File: "month_test.flux", Source: "start: 1980-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 34, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 34, }, File: "month_test.flux", Source: "start: 1980-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 34, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 34, }, File: "month_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 34, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 34, }, File: "month_test.flux", Source: "1980-01-01T00:00:00Z", Start: ast.Position{ Column: 19, Line: 34, }, }, }, Value: parser.MustParseTime("1980-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 34, }, File: "month_test.flux", Source: "range(start: 1980-01-01T00:00:00Z)", Start: ast.Position{ Column: 6, Line: 34, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 34, }, File: "month_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 34, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 35, }, File: "month_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 3, Line: 33, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 35, }, File: "month_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 11, Line: 35, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 35, }, File: "month_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 11, Line: 35, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 35, }, File: "month_test.flux", Source: "columns", Start: ast.Position{ Column: 11, Line: 35, }, }, }, Name: "columns", }, Separator: nil, Value: &ast.ArrayExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 35, }, File: "month_test.flux", Source: "[\"_start\", \"_stop\"]", Start: ast.Position{ Column: 20, Line: 35, }, }, }, Elements: []ast.Expression{&ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 35, }, File: "month_test.flux", Source: "\"_start\"", Start: ast.Position{ Column: 21, Line: 35, }, }, }, Value: "_start", }, &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 38, Line: 35, }, File: "month_test.flux", Source: "\"_stop\"", Start: ast.Position{ Column: 31, Line: 35, }, }, }, Value: "_stop", }}, Lbrack: nil, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 35, }, File: "month_test.flux", Source: "drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 6, Line: 35, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 35, }, File: "month_test.flux", Source: "drop", Start: ast.Position{ Column: 6, Line: 35, }, }, }, Name: "drop", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 36, }, File: "month_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()", Start: ast.Position{ Column: 3, Line: 33, }, }, }, Call: &ast.CallExpression{ Arguments: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 36, }, File: "month_test.flux", Source: "promql.timestamp()", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 36, }, File: "month_test.flux", Source: "promql.timestamp", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 36, }, File: "month_test.flux", Source: "promql", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Name: "promql", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 36, }, File: "month_test.flux", Source: "timestamp", Start: ast.Position{ Column: 13, Line: 36, }, }, }, Name: "timestamp", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 38, }, File: "month_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()\n\t\t|> map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlMonth(timestamp: r._value)}))", Start: ast.Position{ Column: 3, Line: 33, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 38, }, File: "month_test.flux", Source: "fn: (r) =>\n\t\t\t({r with _value: promql.promqlMonth(timestamp: r._value)})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 38, }, File: "month_test.flux", Source: "fn: (r) =>\n\t\t\t({r with _value: promql.promqlMonth(timestamp: r._value)})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 37, }, File: "month_test.flux", Source: "fn", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 38, }, File: "month_test.flux", Source: "(r) =>\n\t\t\t({r with _value: promql.promqlMonth(timestamp: r._value)})", Start: ast.Position{ Column: 14, Line: 37, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 38, }, File: "month_test.flux", Source: "({r with _value: promql.promqlMonth(timestamp: r._value)})", Start: ast.Position{ Column: 4, Line: 38, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 38, }, File: "month_test.flux", Source: "{r with _value: promql.promqlMonth(timestamp: r._value)}", Start: ast.Position{ Column: 5, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 38, }, File: "month_test.flux", Source: "_value: promql.promqlMonth(timestamp: r._value)", Start: ast.Position{ Column: 13, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 38, }, File: "month_test.flux", Source: "_value", Start: ast.Position{ Column: 13, Line: 38, }, }, }, Name: "_value", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 38, }, File: "month_test.flux", Source: "timestamp: r._value", Start: ast.Position{ Column: 40, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 38, }, File: "month_test.flux", Source: "timestamp: r._value", Start: ast.Position{ Column: 40, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 38, }, File: "month_test.flux", Source: "timestamp", Start: ast.Position{ Column: 40, Line: 38, }, }, }, Name: "timestamp", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 38, }, File: "month_test.flux", Source: "r._value", Start: ast.Position{ Column: 51, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 38, }, File: "month_test.flux", Source: "r", Start: ast.Position{ Column: 51, Line: 38, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 38, }, File: "month_test.flux", Source: "_value", Start: ast.Position{ Column: 53, Line: 38, }, }, }, Name: "_value", }, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 38, }, File: "month_test.flux", Source: "promql.promqlMonth(timestamp: r._value)", Start: ast.Position{ Column: 21, Line: 38, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 38, }, File: "month_test.flux", Source: "promql.promqlMonth", Start: ast.Position{ Column: 21, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 38, }, File: "month_test.flux", Source: "promql", Start: ast.Position{ Column: 21, Line: 38, }, }, }, Name: "promql", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 38, }, File: "month_test.flux", Source: "promqlMonth", Start: ast.Position{ Column: 28, Line: 38, }, }, }, Name: "promqlMonth", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }}, Rbrace: nil, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 38, }, File: "month_test.flux", Source: "r", Start: ast.Position{ Column: 6, Line: 38, }, }, }, Name: "r", }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "month_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "month_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Name: "r", }, Separator: nil, Value: nil, }}, Rparan: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 38, }, File: "month_test.flux", Source: "map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlMonth(timestamp: r._value)}))", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 37, }, File: "month_test.flux", Source: "map", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Name: "map", }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 26, Line: 32, }, File: "month_test.flux", Source: "table=<-", Start: ast.Position{ Column: 18, Line: 32, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 32, }, File: "month_test.flux", Source: "table", Start: ast.Position{ Column: 18, Line: 32, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 26, Line: 32, }, File: "month_test.flux", Source: "<-", Start: ast.Position{ Column: 24, Line: 32, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 41, }, File: "month_test.flux", Source: "_promqlMonth = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlMonth})", Start: ast.Position{ Column: 6, Line: 40, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 40, }, File: "month_test.flux", Source: "_promqlMonth", Start: ast.Position{ Column: 6, Line: 40, }, }, }, Name: "_promqlMonth", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 41, }, File: "month_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlMonth})", Start: ast.Position{ Column: 21, Line: 40, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 41, }, File: "month_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlMonth})", Start: ast.Position{ Column: 2, Line: 41, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 41, }, File: "month_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlMonth}", Start: ast.Position{ Column: 3, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 41, }, File: "month_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 41, }, File: "month_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 41, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 41, }, File: "month_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 41, }, File: "month_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 41, }, File: "month_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 41, }, File: "month_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 41, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 41, }, File: "month_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 41, }, File: "month_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 41, }, File: "month_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 41, }, File: "month_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 41, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 41, }, File: "month_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 41, }, File: "month_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 41, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 41, }, File: "month_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 41, }, File: "month_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 41, }, File: "month_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 41, }, File: "month_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 41, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 41, }, File: "month_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 41, }, File: "month_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 41, }, File: "month_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 41, }, File: "month_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 41, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 41, }, File: "month_test.flux", Source: "fn: t_promqlMonth", Start: ast.Position{ Column: 82, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 41, }, File: "month_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 41, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 41, }, File: "month_test.flux", Source: "t_promqlMonth", Start: ast.Position{ Column: 86, Line: 41, }, }, }, Name: "t_promqlMonth", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 41, }, File: "month_test.flux", Source: "test _promqlMonth = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlMonth})", Start: ast.Position{ Column: 1, Line: 40, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "month_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 2, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "month_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 2, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "month_test.flux", Source: "import \"internal/promql\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "month_test.flux", Source: "\"internal/promql\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "internal/promql", }, }}, Metadata: "parser-type=rust", Name: "month_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "month_test.flux", Source: "package promql_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "month_test.flux", Source: "promql_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "promql_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 43, }, File: "quantile_neg_test.flux", Source: "package promql_test\n\nimport \"testing\"\nimport \"internal/promql\" \n\noption now = () => (2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,string,string,string,dateTime:RFC3339,double\n#group,false,false,true,true,true,false,false\n#default,_result,,,,,,\n,result,table,_measurement,_field,t0,_time,_value\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:44:58Z,7.940387008821781\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:08Z,49.460104214779086\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:18Z,-36.564150808873954\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:28Z,34.319039251798635\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:38Z,79.27019811403116\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:48Z,41.91029522104053\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:44:58Z,-61.68790887989735\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:08Z,-6.3173755351186465\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:18Z,-26.049728557657513\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:28Z,114.285955884979\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:38Z,16.140262630578995\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:48Z,29.50336437998469\n\"\n\noutData = \"\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string,double\n#group,false,false,true,true,true,true,true,false\n#default,_result,,,,,,,\n,result,table,_start,_stop,_measurement,_field,t0,_value\n,,2,2019-01-01T00:00:00Z,2030-01-01T00:00:00Z,Reiva,OAOJWe7,BnR,-Inf\n,,3,2019-01-01T00:00:00Z,2030-01-01T00:00:00Z,Reiva,OAOJWe7,qCnJDC,-Inf\n\"\n\n// testing below range value\nt_quantile = (tables=<-) =>\n tables\n |> range(start: 2019-01-01T00:00:00Z)\n |> promql.quantile(q: -0.1)\n\ntest _quantile = () => \n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_quantile})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "quantile_neg_test.flux", Source: "now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 6, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 6, }, File: "quantile_neg_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "quantile_neg_test.flux", Source: "() => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 6, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "quantile_neg_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 20, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 6, }, File: "quantile_neg_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 21, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "quantile_neg_test.flux", Source: "option now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 6, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 25, }, File: "quantile_neg_test.flux", Source: "inData = \"\n#datatype,string,long,string,string,string,dateTime:RFC3339,double\n#group,false,false,true,true,true,false,false\n#default,_result,,,,,,\n,result,table,_measurement,_field,t0,_time,_value\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:44:58Z,7.940387008821781\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:08Z,49.460104214779086\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:18Z,-36.564150808873954\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:28Z,34.319039251798635\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:38Z,79.27019811403116\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:48Z,41.91029522104053\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:44:58Z,-61.68790887989735\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:08Z,-6.3173755351186465\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:18Z,-26.049728557657513\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:28Z,114.285955884979\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:38Z,16.140262630578995\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:48Z,29.50336437998469\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "quantile_neg_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 25, }, File: "quantile_neg_test.flux", Source: "\"\n#datatype,string,long,string,string,string,dateTime:RFC3339,double\n#group,false,false,true,true,true,false,false\n#default,_result,,,,,,\n,result,table,_measurement,_field,t0,_time,_value\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:44:58Z,7.940387008821781\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:08Z,49.460104214779086\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:18Z,-36.564150808873954\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:28Z,34.319039251798635\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:38Z,79.27019811403116\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:48Z,41.91029522104053\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:44:58Z,-61.68790887989735\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:08Z,-6.3173755351186465\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:18Z,-26.049728557657513\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:28Z,114.285955884979\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:38Z,16.140262630578995\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:48Z,29.50336437998469\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,string,string,string,dateTime:RFC3339,double\n#group,false,false,true,true,true,false,false\n#default,_result,,,,,,\n,result,table,_measurement,_field,t0,_time,_value\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:44:58Z,7.940387008821781\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:08Z,49.460104214779086\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:18Z,-36.564150808873954\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:28Z,34.319039251798635\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:38Z,79.27019811403116\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:48Z,41.91029522104053\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:44:58Z,-61.68790887989735\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:08Z,-6.3173755351186465\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:18Z,-26.049728557657513\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:28Z,114.285955884979\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:38Z,16.140262630578995\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:48Z,29.50336437998469\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "quantile_neg_test.flux", Source: "outData = \"\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string,double\n#group,false,false,true,true,true,true,true,false\n#default,_result,,,,,,,\n,result,table,_start,_stop,_measurement,_field,t0,_value\n,,2,2019-01-01T00:00:00Z,2030-01-01T00:00:00Z,Reiva,OAOJWe7,BnR,-Inf\n,,3,2019-01-01T00:00:00Z,2030-01-01T00:00:00Z,Reiva,OAOJWe7,qCnJDC,-Inf\n\"", Start: ast.Position{ Column: 1, Line: 27, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 27, }, File: "quantile_neg_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 27, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "quantile_neg_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string,double\n#group,false,false,true,true,true,true,true,false\n#default,_result,,,,,,,\n,result,table,_start,_stop,_measurement,_field,t0,_value\n,,2,2019-01-01T00:00:00Z,2030-01-01T00:00:00Z,Reiva,OAOJWe7,BnR,-Inf\n,,3,2019-01-01T00:00:00Z,2030-01-01T00:00:00Z,Reiva,OAOJWe7,qCnJDC,-Inf\n\"", Start: ast.Position{ Column: 11, Line: 27, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string,double\n#group,false,false,true,true,true,true,true,false\n#default,_result,,,,,,,\n,result,table,_start,_stop,_measurement,_field,t0,_value\n,,2,2019-01-01T00:00:00Z,2030-01-01T00:00:00Z,Reiva,OAOJWe7,BnR,-Inf\n,,3,2019-01-01T00:00:00Z,2030-01-01T00:00:00Z,Reiva,OAOJWe7,qCnJDC,-Inf\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 40, }, File: "quantile_neg_test.flux", Source: "t_quantile = (tables=<-) =>\n tables\n |> range(start: 2019-01-01T00:00:00Z)\n |> promql.quantile(q: -0.1)", Start: ast.Position{ Column: 1, Line: 37, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: []ast.Comment{ast.Comment{Text: "// testing below range value\n"}}, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 37, }, File: "quantile_neg_test.flux", Source: "t_quantile", Start: ast.Position{ Column: 1, Line: 37, }, }, }, Name: "t_quantile", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 40, }, File: "quantile_neg_test.flux", Source: "(tables=<-) =>\n tables\n |> range(start: 2019-01-01T00:00:00Z)\n |> promql.quantile(q: -0.1)", Start: ast.Position{ Column: 14, Line: 37, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 38, }, File: "quantile_neg_test.flux", Source: "tables", Start: ast.Position{ Column: 5, Line: 38, }, }, }, Name: "tables", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 39, }, File: "quantile_neg_test.flux", Source: "tables\n |> range(start: 2019-01-01T00:00:00Z)", Start: ast.Position{ Column: 5, Line: 38, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 39, }, File: "quantile_neg_test.flux", Source: "start: 2019-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 39, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 39, }, File: "quantile_neg_test.flux", Source: "start: 2019-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 39, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 39, }, File: "quantile_neg_test.flux", Source: "start", Start: ast.Position{ Column: 18, Line: 39, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 39, }, File: "quantile_neg_test.flux", Source: "2019-01-01T00:00:00Z", Start: ast.Position{ Column: 25, Line: 39, }, }, }, Value: parser.MustParseTime("2019-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 39, }, File: "quantile_neg_test.flux", Source: "range(start: 2019-01-01T00:00:00Z)", Start: ast.Position{ Column: 12, Line: 39, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 39, }, File: "quantile_neg_test.flux", Source: "range", Start: ast.Position{ Column: 12, Line: 39, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 40, }, File: "quantile_neg_test.flux", Source: "tables\n |> range(start: 2019-01-01T00:00:00Z)\n |> promql.quantile(q: -0.1)", Start: ast.Position{ Column: 5, Line: 38, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 40, }, File: "quantile_neg_test.flux", Source: "q: -0.1", Start: ast.Position{ Column: 28, Line: 40, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 40, }, File: "quantile_neg_test.flux", Source: "q: -0.1", Start: ast.Position{ Column: 28, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 40, }, File: "quantile_neg_test.flux", Source: "q", Start: ast.Position{ Column: 28, Line: 40, }, }, }, Name: "q", }, Separator: nil, Value: &ast.UnaryExpression{ Argument: &ast.FloatLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 40, }, File: "quantile_neg_test.flux", Source: "0.1", Start: ast.Position{ Column: 32, Line: 40, }, }, }, Value: 0.1, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 40, }, File: "quantile_neg_test.flux", Source: "-0.1", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Operator: 6, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 40, }, File: "quantile_neg_test.flux", Source: "promql.quantile(q: -0.1)", Start: ast.Position{ Column: 12, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 40, }, File: "quantile_neg_test.flux", Source: "promql.quantile", Start: ast.Position{ Column: 12, Line: 40, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 40, }, File: "quantile_neg_test.flux", Source: "promql", Start: ast.Position{ Column: 12, Line: 40, }, }, }, Name: "promql", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 40, }, File: "quantile_neg_test.flux", Source: "quantile", Start: ast.Position{ Column: 19, Line: 40, }, }, }, Name: "quantile", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 37, }, File: "quantile_neg_test.flux", Source: "tables=<-", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 37, }, File: "quantile_neg_test.flux", Source: "tables", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Name: "tables", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 37, }, File: "quantile_neg_test.flux", Source: "<-", Start: ast.Position{ Column: 22, Line: 37, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 43, }, File: "quantile_neg_test.flux", Source: "_quantile = () => \n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_quantile})", Start: ast.Position{ Column: 6, Line: 42, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 42, }, File: "quantile_neg_test.flux", Source: "_quantile", Start: ast.Position{ Column: 6, Line: 42, }, }, }, Name: "_quantile", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 43, }, File: "quantile_neg_test.flux", Source: "() => \n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_quantile})", Start: ast.Position{ Column: 18, Line: 42, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 43, }, File: "quantile_neg_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_quantile})", Start: ast.Position{ Column: 5, Line: 43, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 43, }, File: "quantile_neg_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_quantile}", Start: ast.Position{ Column: 6, Line: 43, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 43, }, File: "quantile_neg_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 7, Line: 43, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 43, }, File: "quantile_neg_test.flux", Source: "input", Start: ast.Position{ Column: 7, Line: 43, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 43, }, File: "quantile_neg_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 43, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 43, }, File: "quantile_neg_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 43, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 43, }, File: "quantile_neg_test.flux", Source: "csv", Start: ast.Position{ Column: 34, Line: 43, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 43, }, File: "quantile_neg_test.flux", Source: "inData", Start: ast.Position{ Column: 39, Line: 43, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 43, }, File: "quantile_neg_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 14, Line: 43, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 43, }, File: "quantile_neg_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 14, Line: 43, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 43, }, File: "quantile_neg_test.flux", Source: "testing", Start: ast.Position{ Column: 14, Line: 43, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 43, }, File: "quantile_neg_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 22, Line: 43, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 43, }, File: "quantile_neg_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 48, Line: 43, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 43, }, File: "quantile_neg_test.flux", Source: "want", Start: ast.Position{ Column: 48, Line: 43, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 43, }, File: "quantile_neg_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 43, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 43, }, File: "quantile_neg_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 43, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 43, }, File: "quantile_neg_test.flux", Source: "csv", Start: ast.Position{ Column: 70, Line: 43, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 43, }, File: "quantile_neg_test.flux", Source: "outData", Start: ast.Position{ Column: 75, Line: 43, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 43, }, File: "quantile_neg_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 54, Line: 43, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 43, }, File: "quantile_neg_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 54, Line: 43, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 43, }, File: "quantile_neg_test.flux", Source: "testing", Start: ast.Position{ Column: 54, Line: 43, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 43, }, File: "quantile_neg_test.flux", Source: "loadMem", Start: ast.Position{ Column: 62, Line: 43, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 43, }, File: "quantile_neg_test.flux", Source: "fn: t_quantile", Start: ast.Position{ Column: 85, Line: 43, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 43, }, File: "quantile_neg_test.flux", Source: "fn", Start: ast.Position{ Column: 85, Line: 43, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 43, }, File: "quantile_neg_test.flux", Source: "t_quantile", Start: ast.Position{ Column: 89, Line: 43, }, }, }, Name: "t_quantile", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 43, }, File: "quantile_neg_test.flux", Source: "test _quantile = () => \n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_quantile})", Start: ast.Position{ Column: 1, Line: 42, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "quantile_neg_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "quantile_neg_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 4, }, File: "quantile_neg_test.flux", Source: "import \"internal/promql\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 4, }, File: "quantile_neg_test.flux", Source: "\"internal/promql\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "internal/promql", }, }}, Metadata: "parser-type=rust", Name: "quantile_neg_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "quantile_neg_test.flux", Source: "package promql_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "quantile_neg_test.flux", Source: "promql_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "promql_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 43, }, File: "quantile_pos_test.flux", Source: "package promql_test\n\nimport \"testing\"\nimport \"internal/promql\" \n\noption now = () => (2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,string,string,string,dateTime:RFC3339,double\n#group,false,false,true,true,true,false,false\n#default,_result,,,,,,\n,result,table,_measurement,_field,t0,_time,_value\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:44:58Z,7.940387008821781\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:08Z,49.460104214779086\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:18Z,-36.564150808873954\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:28Z,34.319039251798635\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:38Z,79.27019811403116\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:48Z,41.91029522104053\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:44:58Z,-61.68790887989735\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:08Z,-6.3173755351186465\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:18Z,-26.049728557657513\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:28Z,114.285955884979\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:38Z,16.140262630578995\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:48Z,29.50336437998469\n\"\n\noutData = \"\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string,double\n#group,false,false,true,true,true,true,true,false\n#default,_result,,,,,,,\n,result,table,_start,_stop,_measurement,_field,t0,_value\n,,2,2019-01-01T00:00:00Z,2030-01-01T00:00:00Z,Reiva,OAOJWe7,BnR,+Inf\n,,3,2019-01-01T00:00:00Z,2030-01-01T00:00:00Z,Reiva,OAOJWe7,qCnJDC,+Inf\n\"\n\n// testing above range value\nt_quantile = (tables=<-) =>\n tables\n |> range(start: 2019-01-01T00:00:00Z)\n |> promql.quantile(q: 1.1)\n\ntest _quantile = () => \n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_quantile})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "quantile_pos_test.flux", Source: "now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 6, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 6, }, File: "quantile_pos_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "quantile_pos_test.flux", Source: "() => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 6, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "quantile_pos_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 20, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 6, }, File: "quantile_pos_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 21, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "quantile_pos_test.flux", Source: "option now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 6, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 25, }, File: "quantile_pos_test.flux", Source: "inData = \"\n#datatype,string,long,string,string,string,dateTime:RFC3339,double\n#group,false,false,true,true,true,false,false\n#default,_result,,,,,,\n,result,table,_measurement,_field,t0,_time,_value\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:44:58Z,7.940387008821781\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:08Z,49.460104214779086\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:18Z,-36.564150808873954\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:28Z,34.319039251798635\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:38Z,79.27019811403116\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:48Z,41.91029522104053\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:44:58Z,-61.68790887989735\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:08Z,-6.3173755351186465\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:18Z,-26.049728557657513\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:28Z,114.285955884979\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:38Z,16.140262630578995\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:48Z,29.50336437998469\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "quantile_pos_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 25, }, File: "quantile_pos_test.flux", Source: "\"\n#datatype,string,long,string,string,string,dateTime:RFC3339,double\n#group,false,false,true,true,true,false,false\n#default,_result,,,,,,\n,result,table,_measurement,_field,t0,_time,_value\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:44:58Z,7.940387008821781\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:08Z,49.460104214779086\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:18Z,-36.564150808873954\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:28Z,34.319039251798635\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:38Z,79.27019811403116\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:48Z,41.91029522104053\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:44:58Z,-61.68790887989735\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:08Z,-6.3173755351186465\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:18Z,-26.049728557657513\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:28Z,114.285955884979\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:38Z,16.140262630578995\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:48Z,29.50336437998469\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,string,string,string,dateTime:RFC3339,double\n#group,false,false,true,true,true,false,false\n#default,_result,,,,,,\n,result,table,_measurement,_field,t0,_time,_value\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:44:58Z,7.940387008821781\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:08Z,49.460104214779086\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:18Z,-36.564150808873954\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:28Z,34.319039251798635\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:38Z,79.27019811403116\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:48Z,41.91029522104053\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:44:58Z,-61.68790887989735\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:08Z,-6.3173755351186465\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:18Z,-26.049728557657513\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:28Z,114.285955884979\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:38Z,16.140262630578995\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:48Z,29.50336437998469\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "quantile_pos_test.flux", Source: "outData = \"\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string,double\n#group,false,false,true,true,true,true,true,false\n#default,_result,,,,,,,\n,result,table,_start,_stop,_measurement,_field,t0,_value\n,,2,2019-01-01T00:00:00Z,2030-01-01T00:00:00Z,Reiva,OAOJWe7,BnR,+Inf\n,,3,2019-01-01T00:00:00Z,2030-01-01T00:00:00Z,Reiva,OAOJWe7,qCnJDC,+Inf\n\"", Start: ast.Position{ Column: 1, Line: 27, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 27, }, File: "quantile_pos_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 27, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "quantile_pos_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string,double\n#group,false,false,true,true,true,true,true,false\n#default,_result,,,,,,,\n,result,table,_start,_stop,_measurement,_field,t0,_value\n,,2,2019-01-01T00:00:00Z,2030-01-01T00:00:00Z,Reiva,OAOJWe7,BnR,+Inf\n,,3,2019-01-01T00:00:00Z,2030-01-01T00:00:00Z,Reiva,OAOJWe7,qCnJDC,+Inf\n\"", Start: ast.Position{ Column: 11, Line: 27, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string,double\n#group,false,false,true,true,true,true,true,false\n#default,_result,,,,,,,\n,result,table,_start,_stop,_measurement,_field,t0,_value\n,,2,2019-01-01T00:00:00Z,2030-01-01T00:00:00Z,Reiva,OAOJWe7,BnR,+Inf\n,,3,2019-01-01T00:00:00Z,2030-01-01T00:00:00Z,Reiva,OAOJWe7,qCnJDC,+Inf\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 40, }, File: "quantile_pos_test.flux", Source: "t_quantile = (tables=<-) =>\n tables\n |> range(start: 2019-01-01T00:00:00Z)\n |> promql.quantile(q: 1.1)", Start: ast.Position{ Column: 1, Line: 37, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: []ast.Comment{ast.Comment{Text: "// testing above range value\n"}}, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 37, }, File: "quantile_pos_test.flux", Source: "t_quantile", Start: ast.Position{ Column: 1, Line: 37, }, }, }, Name: "t_quantile", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 40, }, File: "quantile_pos_test.flux", Source: "(tables=<-) =>\n tables\n |> range(start: 2019-01-01T00:00:00Z)\n |> promql.quantile(q: 1.1)", Start: ast.Position{ Column: 14, Line: 37, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 38, }, File: "quantile_pos_test.flux", Source: "tables", Start: ast.Position{ Column: 5, Line: 38, }, }, }, Name: "tables", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 39, }, File: "quantile_pos_test.flux", Source: "tables\n |> range(start: 2019-01-01T00:00:00Z)", Start: ast.Position{ Column: 5, Line: 38, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 39, }, File: "quantile_pos_test.flux", Source: "start: 2019-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 39, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 39, }, File: "quantile_pos_test.flux", Source: "start: 2019-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 39, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 39, }, File: "quantile_pos_test.flux", Source: "start", Start: ast.Position{ Column: 18, Line: 39, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 39, }, File: "quantile_pos_test.flux", Source: "2019-01-01T00:00:00Z", Start: ast.Position{ Column: 25, Line: 39, }, }, }, Value: parser.MustParseTime("2019-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 39, }, File: "quantile_pos_test.flux", Source: "range(start: 2019-01-01T00:00:00Z)", Start: ast.Position{ Column: 12, Line: 39, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 39, }, File: "quantile_pos_test.flux", Source: "range", Start: ast.Position{ Column: 12, Line: 39, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 40, }, File: "quantile_pos_test.flux", Source: "tables\n |> range(start: 2019-01-01T00:00:00Z)\n |> promql.quantile(q: 1.1)", Start: ast.Position{ Column: 5, Line: 38, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 40, }, File: "quantile_pos_test.flux", Source: "q: 1.1", Start: ast.Position{ Column: 28, Line: 40, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 40, }, File: "quantile_pos_test.flux", Source: "q: 1.1", Start: ast.Position{ Column: 28, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 40, }, File: "quantile_pos_test.flux", Source: "q", Start: ast.Position{ Column: 28, Line: 40, }, }, }, Name: "q", }, Separator: nil, Value: &ast.FloatLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 40, }, File: "quantile_pos_test.flux", Source: "1.1", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Value: 1.1, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 40, }, File: "quantile_pos_test.flux", Source: "promql.quantile(q: 1.1)", Start: ast.Position{ Column: 12, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 40, }, File: "quantile_pos_test.flux", Source: "promql.quantile", Start: ast.Position{ Column: 12, Line: 40, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 40, }, File: "quantile_pos_test.flux", Source: "promql", Start: ast.Position{ Column: 12, Line: 40, }, }, }, Name: "promql", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 40, }, File: "quantile_pos_test.flux", Source: "quantile", Start: ast.Position{ Column: 19, Line: 40, }, }, }, Name: "quantile", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 37, }, File: "quantile_pos_test.flux", Source: "tables=<-", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 37, }, File: "quantile_pos_test.flux", Source: "tables", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Name: "tables", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 37, }, File: "quantile_pos_test.flux", Source: "<-", Start: ast.Position{ Column: 22, Line: 37, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 43, }, File: "quantile_pos_test.flux", Source: "_quantile = () => \n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_quantile})", Start: ast.Position{ Column: 6, Line: 42, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 42, }, File: "quantile_pos_test.flux", Source: "_quantile", Start: ast.Position{ Column: 6, Line: 42, }, }, }, Name: "_quantile", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 43, }, File: "quantile_pos_test.flux", Source: "() => \n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_quantile})", Start: ast.Position{ Column: 18, Line: 42, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 43, }, File: "quantile_pos_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_quantile})", Start: ast.Position{ Column: 5, Line: 43, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 43, }, File: "quantile_pos_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_quantile}", Start: ast.Position{ Column: 6, Line: 43, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 43, }, File: "quantile_pos_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 7, Line: 43, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 43, }, File: "quantile_pos_test.flux", Source: "input", Start: ast.Position{ Column: 7, Line: 43, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 43, }, File: "quantile_pos_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 43, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 43, }, File: "quantile_pos_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 43, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 43, }, File: "quantile_pos_test.flux", Source: "csv", Start: ast.Position{ Column: 34, Line: 43, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 43, }, File: "quantile_pos_test.flux", Source: "inData", Start: ast.Position{ Column: 39, Line: 43, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 43, }, File: "quantile_pos_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 14, Line: 43, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 43, }, File: "quantile_pos_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 14, Line: 43, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 43, }, File: "quantile_pos_test.flux", Source: "testing", Start: ast.Position{ Column: 14, Line: 43, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 43, }, File: "quantile_pos_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 22, Line: 43, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 43, }, File: "quantile_pos_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 48, Line: 43, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 43, }, File: "quantile_pos_test.flux", Source: "want", Start: ast.Position{ Column: 48, Line: 43, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 43, }, File: "quantile_pos_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 43, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 43, }, File: "quantile_pos_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 43, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 43, }, File: "quantile_pos_test.flux", Source: "csv", Start: ast.Position{ Column: 70, Line: 43, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 43, }, File: "quantile_pos_test.flux", Source: "outData", Start: ast.Position{ Column: 75, Line: 43, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 43, }, File: "quantile_pos_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 54, Line: 43, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 43, }, File: "quantile_pos_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 54, Line: 43, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 43, }, File: "quantile_pos_test.flux", Source: "testing", Start: ast.Position{ Column: 54, Line: 43, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 43, }, File: "quantile_pos_test.flux", Source: "loadMem", Start: ast.Position{ Column: 62, Line: 43, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 43, }, File: "quantile_pos_test.flux", Source: "fn: t_quantile", Start: ast.Position{ Column: 85, Line: 43, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 43, }, File: "quantile_pos_test.flux", Source: "fn", Start: ast.Position{ Column: 85, Line: 43, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 43, }, File: "quantile_pos_test.flux", Source: "t_quantile", Start: ast.Position{ Column: 89, Line: 43, }, }, }, Name: "t_quantile", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 43, }, File: "quantile_pos_test.flux", Source: "test _quantile = () => \n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_quantile})", Start: ast.Position{ Column: 1, Line: 42, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "quantile_pos_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "quantile_pos_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 4, }, File: "quantile_pos_test.flux", Source: "import \"internal/promql\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 4, }, File: "quantile_pos_test.flux", Source: "\"internal/promql\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "internal/promql", }, }}, Metadata: "parser-type=rust", Name: "quantile_pos_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "quantile_pos_test.flux", Source: "package promql_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "quantile_pos_test.flux", Source: "promql_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "promql_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 43, }, File: "quantile_test.flux", Source: "package promql_test\n\nimport \"testing\"\nimport \"internal/promql\" \n\noption now = () => (2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,string,string,string,dateTime:RFC3339,double\n#group,false,false,true,true,true,false,false\n#default,_result,,,,,,\n,result,table,_measurement,_field,t0,_time,_value\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:44:58Z,7.940387008821781\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:08Z,49.460104214779086\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:18Z,-36.564150808873954\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:28Z,34.319039251798635\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:38Z,79.27019811403116\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:48Z,41.91029522104053\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:44:58Z,-61.68790887989735\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:08Z,-6.3173755351186465\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:18Z,-26.049728557657513\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:28Z,114.285955884979\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:38Z,16.140262630578995\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:48Z,29.50336437998469\n\"\n\noutData = \"\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string,double\n#group,false,false,true,true,true,true,true,false\n#default,_result,,,,,,,\n,result,table,_start,_stop,_measurement,_field,t0,_value\n,,2,2019-01-01T00:00:00Z,2030-01-01T00:00:00Z,Reiva,OAOJWe7,BnR,47.57265196634445\n,,3,2019-01-01T00:00:00Z,2030-01-01T00:00:00Z,Reiva,OAOJWe7,qCnJDC,26.162588942633263\n\"\n\n// testing normal range value\nt_quantile = (tables=<-) =>\n tables\n |> range(start: 2019-01-01T00:00:00Z)\n |> promql.quantile(q: 0.75)\n\ntest _quantile = () => \n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_quantile})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "quantile_test.flux", Source: "now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 6, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 6, }, File: "quantile_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 6, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "quantile_test.flux", Source: "() => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 6, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "quantile_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 20, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 6, }, File: "quantile_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 21, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 6, }, File: "quantile_test.flux", Source: "option now = () => (2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 6, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 25, }, File: "quantile_test.flux", Source: "inData = \"\n#datatype,string,long,string,string,string,dateTime:RFC3339,double\n#group,false,false,true,true,true,false,false\n#default,_result,,,,,,\n,result,table,_measurement,_field,t0,_time,_value\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:44:58Z,7.940387008821781\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:08Z,49.460104214779086\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:18Z,-36.564150808873954\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:28Z,34.319039251798635\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:38Z,79.27019811403116\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:48Z,41.91029522104053\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:44:58Z,-61.68790887989735\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:08Z,-6.3173755351186465\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:18Z,-26.049728557657513\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:28Z,114.285955884979\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:38Z,16.140262630578995\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:48Z,29.50336437998469\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "quantile_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 25, }, File: "quantile_test.flux", Source: "\"\n#datatype,string,long,string,string,string,dateTime:RFC3339,double\n#group,false,false,true,true,true,false,false\n#default,_result,,,,,,\n,result,table,_measurement,_field,t0,_time,_value\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:44:58Z,7.940387008821781\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:08Z,49.460104214779086\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:18Z,-36.564150808873954\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:28Z,34.319039251798635\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:38Z,79.27019811403116\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:48Z,41.91029522104053\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:44:58Z,-61.68790887989735\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:08Z,-6.3173755351186465\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:18Z,-26.049728557657513\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:28Z,114.285955884979\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:38Z,16.140262630578995\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:48Z,29.50336437998469\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,string,string,string,dateTime:RFC3339,double\n#group,false,false,true,true,true,false,false\n#default,_result,,,,,,\n,result,table,_measurement,_field,t0,_time,_value\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:44:58Z,7.940387008821781\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:08Z,49.460104214779086\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:18Z,-36.564150808873954\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:28Z,34.319039251798635\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:38Z,79.27019811403116\n,,2,Reiva,OAOJWe7,BnR,2019-01-09T19:45:48Z,41.91029522104053\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:44:58Z,-61.68790887989735\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:08Z,-6.3173755351186465\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:18Z,-26.049728557657513\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:28Z,114.285955884979\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:38Z,16.140262630578995\n,,3,Reiva,OAOJWe7,qCnJDC,2019-01-09T19:45:48Z,29.50336437998469\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "quantile_test.flux", Source: "outData = \"\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string,double\n#group,false,false,true,true,true,true,true,false\n#default,_result,,,,,,,\n,result,table,_start,_stop,_measurement,_field,t0,_value\n,,2,2019-01-01T00:00:00Z,2030-01-01T00:00:00Z,Reiva,OAOJWe7,BnR,47.57265196634445\n,,3,2019-01-01T00:00:00Z,2030-01-01T00:00:00Z,Reiva,OAOJWe7,qCnJDC,26.162588942633263\n\"", Start: ast.Position{ Column: 1, Line: 27, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 27, }, File: "quantile_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 27, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "quantile_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string,double\n#group,false,false,true,true,true,true,true,false\n#default,_result,,,,,,,\n,result,table,_start,_stop,_measurement,_field,t0,_value\n,,2,2019-01-01T00:00:00Z,2030-01-01T00:00:00Z,Reiva,OAOJWe7,BnR,47.57265196634445\n,,3,2019-01-01T00:00:00Z,2030-01-01T00:00:00Z,Reiva,OAOJWe7,qCnJDC,26.162588942633263\n\"", Start: ast.Position{ Column: 11, Line: 27, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,string,double\n#group,false,false,true,true,true,true,true,false\n#default,_result,,,,,,,\n,result,table,_start,_stop,_measurement,_field,t0,_value\n,,2,2019-01-01T00:00:00Z,2030-01-01T00:00:00Z,Reiva,OAOJWe7,BnR,47.57265196634445\n,,3,2019-01-01T00:00:00Z,2030-01-01T00:00:00Z,Reiva,OAOJWe7,qCnJDC,26.162588942633263\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 40, }, File: "quantile_test.flux", Source: "t_quantile = (tables=<-) =>\n tables\n |> range(start: 2019-01-01T00:00:00Z)\n |> promql.quantile(q: 0.75)", Start: ast.Position{ Column: 1, Line: 37, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: []ast.Comment{ast.Comment{Text: "// testing normal range value\n"}}, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 37, }, File: "quantile_test.flux", Source: "t_quantile", Start: ast.Position{ Column: 1, Line: 37, }, }, }, Name: "t_quantile", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 40, }, File: "quantile_test.flux", Source: "(tables=<-) =>\n tables\n |> range(start: 2019-01-01T00:00:00Z)\n |> promql.quantile(q: 0.75)", Start: ast.Position{ Column: 14, Line: 37, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 38, }, File: "quantile_test.flux", Source: "tables", Start: ast.Position{ Column: 5, Line: 38, }, }, }, Name: "tables", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 39, }, File: "quantile_test.flux", Source: "tables\n |> range(start: 2019-01-01T00:00:00Z)", Start: ast.Position{ Column: 5, Line: 38, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 39, }, File: "quantile_test.flux", Source: "start: 2019-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 39, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 39, }, File: "quantile_test.flux", Source: "start: 2019-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 39, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 39, }, File: "quantile_test.flux", Source: "start", Start: ast.Position{ Column: 18, Line: 39, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 39, }, File: "quantile_test.flux", Source: "2019-01-01T00:00:00Z", Start: ast.Position{ Column: 25, Line: 39, }, }, }, Value: parser.MustParseTime("2019-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 39, }, File: "quantile_test.flux", Source: "range(start: 2019-01-01T00:00:00Z)", Start: ast.Position{ Column: 12, Line: 39, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 39, }, File: "quantile_test.flux", Source: "range", Start: ast.Position{ Column: 12, Line: 39, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 40, }, File: "quantile_test.flux", Source: "tables\n |> range(start: 2019-01-01T00:00:00Z)\n |> promql.quantile(q: 0.75)", Start: ast.Position{ Column: 5, Line: 38, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 40, }, File: "quantile_test.flux", Source: "q: 0.75", Start: ast.Position{ Column: 28, Line: 40, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 40, }, File: "quantile_test.flux", Source: "q: 0.75", Start: ast.Position{ Column: 28, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 40, }, File: "quantile_test.flux", Source: "q", Start: ast.Position{ Column: 28, Line: 40, }, }, }, Name: "q", }, Separator: nil, Value: &ast.FloatLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 40, }, File: "quantile_test.flux", Source: "0.75", Start: ast.Position{ Column: 31, Line: 40, }, }, }, Value: 0.75, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 36, Line: 40, }, File: "quantile_test.flux", Source: "promql.quantile(q: 0.75)", Start: ast.Position{ Column: 12, Line: 40, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 40, }, File: "quantile_test.flux", Source: "promql.quantile", Start: ast.Position{ Column: 12, Line: 40, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 40, }, File: "quantile_test.flux", Source: "promql", Start: ast.Position{ Column: 12, Line: 40, }, }, }, Name: "promql", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 40, }, File: "quantile_test.flux", Source: "quantile", Start: ast.Position{ Column: 19, Line: 40, }, }, }, Name: "quantile", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 37, }, File: "quantile_test.flux", Source: "tables=<-", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 37, }, File: "quantile_test.flux", Source: "tables", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Name: "tables", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 37, }, File: "quantile_test.flux", Source: "<-", Start: ast.Position{ Column: 22, Line: 37, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 43, }, File: "quantile_test.flux", Source: "_quantile = () => \n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_quantile})", Start: ast.Position{ Column: 6, Line: 42, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 42, }, File: "quantile_test.flux", Source: "_quantile", Start: ast.Position{ Column: 6, Line: 42, }, }, }, Name: "_quantile", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 43, }, File: "quantile_test.flux", Source: "() => \n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_quantile})", Start: ast.Position{ Column: 18, Line: 42, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 43, }, File: "quantile_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_quantile})", Start: ast.Position{ Column: 5, Line: 43, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 43, }, File: "quantile_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_quantile}", Start: ast.Position{ Column: 6, Line: 43, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 43, }, File: "quantile_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 7, Line: 43, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 43, }, File: "quantile_test.flux", Source: "input", Start: ast.Position{ Column: 7, Line: 43, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 43, }, File: "quantile_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 43, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 43, }, File: "quantile_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 43, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 43, }, File: "quantile_test.flux", Source: "csv", Start: ast.Position{ Column: 34, Line: 43, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 43, }, File: "quantile_test.flux", Source: "inData", Start: ast.Position{ Column: 39, Line: 43, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 43, }, File: "quantile_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 14, Line: 43, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 43, }, File: "quantile_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 14, Line: 43, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 43, }, File: "quantile_test.flux", Source: "testing", Start: ast.Position{ Column: 14, Line: 43, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 43, }, File: "quantile_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 22, Line: 43, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 43, }, File: "quantile_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 48, Line: 43, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 43, }, File: "quantile_test.flux", Source: "want", Start: ast.Position{ Column: 48, Line: 43, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 43, }, File: "quantile_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 43, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 43, }, File: "quantile_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 43, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 43, }, File: "quantile_test.flux", Source: "csv", Start: ast.Position{ Column: 70, Line: 43, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 43, }, File: "quantile_test.flux", Source: "outData", Start: ast.Position{ Column: 75, Line: 43, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 43, }, File: "quantile_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 54, Line: 43, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 43, }, File: "quantile_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 54, Line: 43, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 43, }, File: "quantile_test.flux", Source: "testing", Start: ast.Position{ Column: 54, Line: 43, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 43, }, File: "quantile_test.flux", Source: "loadMem", Start: ast.Position{ Column: 62, Line: 43, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 43, }, File: "quantile_test.flux", Source: "fn: t_quantile", Start: ast.Position{ Column: 85, Line: 43, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 43, }, File: "quantile_test.flux", Source: "fn", Start: ast.Position{ Column: 85, Line: 43, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 43, }, File: "quantile_test.flux", Source: "t_quantile", Start: ast.Position{ Column: 89, Line: 43, }, }, }, Name: "t_quantile", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 43, }, File: "quantile_test.flux", Source: "test _quantile = () => \n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_quantile})", Start: ast.Position{ Column: 1, Line: 42, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "quantile_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 3, }, File: "quantile_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 4, }, File: "quantile_test.flux", Source: "import \"internal/promql\"", Start: ast.Position{ Column: 1, Line: 4, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 4, }, File: "quantile_test.flux", Source: "\"internal/promql\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "internal/promql", }, }}, Metadata: "parser-type=rust", Name: "quantile_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "quantile_test.flux", Source: "package promql_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "quantile_test.flux", Source: "promql_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "promql_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 96, Line: 47, }, File: "resets_test.flux", Source: "package promql_test\nimport \"testing\"\nimport \"internal/promql\"\n\noption now = () =>\n\t(2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:53Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:03Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:13Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:23Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:53Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:53:03Z,metric_name2,2,prometheus\r\n,,1,2018-12-18T20:53:13Z,metric_name2,2,prometheus\r\n,,1,2018-12-18T20:53:23Z,metric_name2,2,prometheus\r\n,,2,2018-12-18T20:52:33Z,metric_name3,1,prometheus\r\n,,2,2018-12-18T20:52:43Z,metric_name3,2,prometheus\r\n,,2,2018-12-18T20:52:53Z,metric_name3,3,prometheus\r\n,,2,2018-12-18T20:53:03Z,metric_name3,1,prometheus\r\n,,2,2018-12-18T20:53:13Z,metric_name3,2,prometheus\r\n,,2,2018-12-18T20:53:23Z,metric_name3,1,prometheus\r\n\"\noutData = \"\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_start,_stop,_field,_value,_measurement\r\n,,0,2018-12-01T00:00:00Z,2030-01-01T00:00:00Z,metric_name1,0,prometheus\r\n,,1,2018-12-01T00:00:00Z,2030-01-01T00:00:00Z,metric_name2,0,prometheus\r\n,,2,2018-12-01T00:00:00Z,2030-01-01T00:00:00Z,metric_name3,2,prometheus\r\n\"\nt_resets = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-12-01T00:00:00Z)\n\t\t|> promql.resets())\n\ntest _resets = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_resets})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "resets_test.flux", Source: "now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 5, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 5, }, File: "resets_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "resets_test.flux", Source: "() =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 5, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "resets_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 2, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 6, }, File: "resets_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 3, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "resets_test.flux", Source: "option now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 5, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 31, }, File: "resets_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:53Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:03Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:13Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:23Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:53Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:53:03Z,metric_name2,2,prometheus\r\n,,1,2018-12-18T20:53:13Z,metric_name2,2,prometheus\r\n,,1,2018-12-18T20:53:23Z,metric_name2,2,prometheus\r\n,,2,2018-12-18T20:52:33Z,metric_name3,1,prometheus\r\n,,2,2018-12-18T20:52:43Z,metric_name3,2,prometheus\r\n,,2,2018-12-18T20:52:53Z,metric_name3,3,prometheus\r\n,,2,2018-12-18T20:53:03Z,metric_name3,1,prometheus\r\n,,2,2018-12-18T20:53:13Z,metric_name3,2,prometheus\r\n,,2,2018-12-18T20:53:23Z,metric_name3,1,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "resets_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 31, }, File: "resets_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:53Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:03Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:13Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:23Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:53Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:53:03Z,metric_name2,2,prometheus\r\n,,1,2018-12-18T20:53:13Z,metric_name2,2,prometheus\r\n,,1,2018-12-18T20:53:23Z,metric_name2,2,prometheus\r\n,,2,2018-12-18T20:52:33Z,metric_name3,1,prometheus\r\n,,2,2018-12-18T20:52:43Z,metric_name3,2,prometheus\r\n,,2,2018-12-18T20:52:53Z,metric_name3,3,prometheus\r\n,,2,2018-12-18T20:53:03Z,metric_name3,1,prometheus\r\n,,2,2018-12-18T20:53:13Z,metric_name3,2,prometheus\r\n,,2,2018-12-18T20:53:23Z,metric_name3,1,prometheus\r\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-18T20:52:33Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:43Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:52:53Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:03Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:13Z,metric_name1,1,prometheus\r\n,,0,2018-12-18T20:53:23Z,metric_name1,1,prometheus\r\n,,1,2018-12-18T20:52:33Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:43Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:52:53Z,metric_name2,1,prometheus\r\n,,1,2018-12-18T20:53:03Z,metric_name2,2,prometheus\r\n,,1,2018-12-18T20:53:13Z,metric_name2,2,prometheus\r\n,,1,2018-12-18T20:53:23Z,metric_name2,2,prometheus\r\n,,2,2018-12-18T20:52:33Z,metric_name3,1,prometheus\r\n,,2,2018-12-18T20:52:43Z,metric_name3,2,prometheus\r\n,,2,2018-12-18T20:52:53Z,metric_name3,3,prometheus\r\n,,2,2018-12-18T20:53:03Z,metric_name3,1,prometheus\r\n,,2,2018-12-18T20:53:13Z,metric_name3,2,prometheus\r\n,,2,2018-12-18T20:53:23Z,metric_name3,1,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 40, }, File: "resets_test.flux", Source: "outData = \"\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_start,_stop,_field,_value,_measurement\r\n,,0,2018-12-01T00:00:00Z,2030-01-01T00:00:00Z,metric_name1,0,prometheus\r\n,,1,2018-12-01T00:00:00Z,2030-01-01T00:00:00Z,metric_name2,0,prometheus\r\n,,2,2018-12-01T00:00:00Z,2030-01-01T00:00:00Z,metric_name3,2,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 32, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 32, }, File: "resets_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 32, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 40, }, File: "resets_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_start,_stop,_field,_value,_measurement\r\n,,0,2018-12-01T00:00:00Z,2030-01-01T00:00:00Z,metric_name1,0,prometheus\r\n,,1,2018-12-01T00:00:00Z,2030-01-01T00:00:00Z,metric_name2,0,prometheus\r\n,,2,2018-12-01T00:00:00Z,2030-01-01T00:00:00Z,metric_name3,2,prometheus\r\n\"", Start: ast.Position{ Column: 11, Line: 32, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,double,string\r\n#group,false,false,true,true,true,false,true\r\n#default,outData,,,,,,\r\n,result,table,_start,_stop,_field,_value,_measurement\r\n,,0,2018-12-01T00:00:00Z,2030-01-01T00:00:00Z,metric_name1,0,prometheus\r\n,,1,2018-12-01T00:00:00Z,2030-01-01T00:00:00Z,metric_name2,0,prometheus\r\n,,2,2018-12-01T00:00:00Z,2030-01-01T00:00:00Z,metric_name3,2,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 44, }, File: "resets_test.flux", Source: "t_resets = (table=<-) =>\n\t(table\n\t\t|> range(start: 2018-12-01T00:00:00Z)\n\t\t|> promql.resets())", Start: ast.Position{ Column: 1, Line: 41, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 41, }, File: "resets_test.flux", Source: "t_resets", Start: ast.Position{ Column: 1, Line: 41, }, }, }, Name: "t_resets", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 44, }, File: "resets_test.flux", Source: "(table=<-) =>\n\t(table\n\t\t|> range(start: 2018-12-01T00:00:00Z)\n\t\t|> promql.resets())", Start: ast.Position{ Column: 12, Line: 41, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 44, }, File: "resets_test.flux", Source: "(table\n\t\t|> range(start: 2018-12-01T00:00:00Z)\n\t\t|> promql.resets())", Start: ast.Position{ Column: 2, Line: 42, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 42, }, File: "resets_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 42, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 43, }, File: "resets_test.flux", Source: "table\n\t\t|> range(start: 2018-12-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 42, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 43, }, File: "resets_test.flux", Source: "start: 2018-12-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 43, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 43, }, File: "resets_test.flux", Source: "start: 2018-12-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 43, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 43, }, File: "resets_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 43, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 43, }, File: "resets_test.flux", Source: "2018-12-01T00:00:00Z", Start: ast.Position{ Column: 19, Line: 43, }, }, }, Value: parser.MustParseTime("2018-12-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 43, }, File: "resets_test.flux", Source: "range(start: 2018-12-01T00:00:00Z)", Start: ast.Position{ Column: 6, Line: 43, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 43, }, File: "resets_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 43, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 44, }, File: "resets_test.flux", Source: "table\n\t\t|> range(start: 2018-12-01T00:00:00Z)\n\t\t|> promql.resets()", Start: ast.Position{ Column: 3, Line: 42, }, }, }, Call: &ast.CallExpression{ Arguments: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 44, }, File: "resets_test.flux", Source: "promql.resets()", Start: ast.Position{ Column: 6, Line: 44, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 44, }, File: "resets_test.flux", Source: "promql.resets", Start: ast.Position{ Column: 6, Line: 44, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 44, }, File: "resets_test.flux", Source: "promql", Start: ast.Position{ Column: 6, Line: 44, }, }, }, Name: "promql", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 44, }, File: "resets_test.flux", Source: "resets", Start: ast.Position{ Column: 13, Line: 44, }, }, }, Name: "resets", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 41, }, File: "resets_test.flux", Source: "table=<-", Start: ast.Position{ Column: 13, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 41, }, File: "resets_test.flux", Source: "table", Start: ast.Position{ Column: 13, Line: 41, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 41, }, File: "resets_test.flux", Source: "<-", Start: ast.Position{ Column: 19, Line: 41, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 96, Line: 47, }, File: "resets_test.flux", Source: "_resets = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_resets})", Start: ast.Position{ Column: 6, Line: 46, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 13, Line: 46, }, File: "resets_test.flux", Source: "_resets", Start: ast.Position{ Column: 6, Line: 46, }, }, }, Name: "_resets", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 96, Line: 47, }, File: "resets_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_resets})", Start: ast.Position{ Column: 16, Line: 46, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 96, Line: 47, }, File: "resets_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_resets})", Start: ast.Position{ Column: 2, Line: 47, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 95, Line: 47, }, File: "resets_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_resets}", Start: ast.Position{ Column: 3, Line: 47, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 47, }, File: "resets_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 47, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 47, }, File: "resets_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 47, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 47, }, File: "resets_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 47, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 47, }, File: "resets_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 47, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 47, }, File: "resets_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 47, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 47, }, File: "resets_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 47, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 47, }, File: "resets_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 47, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 47, }, File: "resets_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 47, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 47, }, File: "resets_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 47, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 47, }, File: "resets_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 47, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 47, }, File: "resets_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 47, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 47, }, File: "resets_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 47, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 47, }, File: "resets_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 47, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 47, }, File: "resets_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 47, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 47, }, File: "resets_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 47, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 47, }, File: "resets_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 47, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 47, }, File: "resets_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 47, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 47, }, File: "resets_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 47, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 47, }, File: "resets_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 47, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 47, }, File: "resets_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 47, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 94, Line: 47, }, File: "resets_test.flux", Source: "fn: t_resets", Start: ast.Position{ Column: 82, Line: 47, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 47, }, File: "resets_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 47, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 94, Line: 47, }, File: "resets_test.flux", Source: "t_resets", Start: ast.Position{ Column: 86, Line: 47, }, }, }, Name: "t_resets", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 96, Line: 47, }, File: "resets_test.flux", Source: "test _resets = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_resets})", Start: ast.Position{ Column: 1, Line: 46, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "resets_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 2, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "resets_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 2, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "resets_test.flux", Source: "import \"internal/promql\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "resets_test.flux", Source: "\"internal/promql\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "internal/promql", }, }}, Metadata: "parser-type=rust", Name: "resets_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "resets_test.flux", Source: "package promql_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "resets_test.flux", Source: "promql_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "promql_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 39, }, File: "timestamp_test.flux", Source: "package promql_test\nimport \"testing\"\nimport \"internal/promql\"\n\noption now = () =>\n\t(2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-01T20:00:10.123Z,metric_name,0,prometheus\r\n,,0,2018-12-02T20:00:20.123Z,metric_name,0,prometheus\r\n,,0,2018-12-03T20:00:30.123Z,metric_name,0,prometheus\r\n,,0,2018-12-29T20:00:40.123Z,metric_name,0,prometheus\r\n,,0,2018-12-30T20:00:50.123Z,metric_name,0,prometheus\r\n,,0,2018-12-31T20:01:00.123Z,metric_name,0,prometheus\r\n\"\noutData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,outData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-01T20:00:10.123Z,metric_name,1543694410.123,prometheus\r\n,,0,2018-12-02T20:00:20.123Z,metric_name,1543780820.123,prometheus\r\n,,0,2018-12-03T20:00:30.123Z,metric_name,1543867230.123,prometheus\r\n,,0,2018-12-29T20:00:40.123Z,metric_name,1546113640.123,prometheus\r\n,,0,2018-12-30T20:00:50.123Z,metric_name,1546200050.123,prometheus\r\n,,0,2018-12-31T20:01:00.123Z,metric_name,1546286460.123,prometheus\r\n\"\nt_timestamp = (table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp())\n\ntest _timestamp = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_timestamp})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "timestamp_test.flux", Source: "now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 5, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 5, }, File: "timestamp_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "timestamp_test.flux", Source: "() =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 5, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "timestamp_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 2, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 6, }, File: "timestamp_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 3, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "timestamp_test.flux", Source: "option now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 5, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "timestamp_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-01T20:00:10.123Z,metric_name,0,prometheus\r\n,,0,2018-12-02T20:00:20.123Z,metric_name,0,prometheus\r\n,,0,2018-12-03T20:00:30.123Z,metric_name,0,prometheus\r\n,,0,2018-12-29T20:00:40.123Z,metric_name,0,prometheus\r\n,,0,2018-12-30T20:00:50.123Z,metric_name,0,prometheus\r\n,,0,2018-12-31T20:01:00.123Z,metric_name,0,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "timestamp_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "timestamp_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-01T20:00:10.123Z,metric_name,0,prometheus\r\n,,0,2018-12-02T20:00:20.123Z,metric_name,0,prometheus\r\n,,0,2018-12-03T20:00:30.123Z,metric_name,0,prometheus\r\n,,0,2018-12-29T20:00:40.123Z,metric_name,0,prometheus\r\n,,0,2018-12-30T20:00:50.123Z,metric_name,0,prometheus\r\n,,0,2018-12-31T20:01:00.123Z,metric_name,0,prometheus\r\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-01T20:00:10.123Z,metric_name,0,prometheus\r\n,,0,2018-12-02T20:00:20.123Z,metric_name,0,prometheus\r\n,,0,2018-12-03T20:00:30.123Z,metric_name,0,prometheus\r\n,,0,2018-12-29T20:00:40.123Z,metric_name,0,prometheus\r\n,,0,2018-12-30T20:00:50.123Z,metric_name,0,prometheus\r\n,,0,2018-12-31T20:01:00.123Z,metric_name,0,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 31, }, File: "timestamp_test.flux", Source: "outData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,outData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-01T20:00:10.123Z,metric_name,1543694410.123,prometheus\r\n,,0,2018-12-02T20:00:20.123Z,metric_name,1543780820.123,prometheus\r\n,,0,2018-12-03T20:00:30.123Z,metric_name,1543867230.123,prometheus\r\n,,0,2018-12-29T20:00:40.123Z,metric_name,1546113640.123,prometheus\r\n,,0,2018-12-30T20:00:50.123Z,metric_name,1546200050.123,prometheus\r\n,,0,2018-12-31T20:01:00.123Z,metric_name,1546286460.123,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 20, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 20, }, File: "timestamp_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 20, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 31, }, File: "timestamp_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,outData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-01T20:00:10.123Z,metric_name,1543694410.123,prometheus\r\n,,0,2018-12-02T20:00:20.123Z,metric_name,1543780820.123,prometheus\r\n,,0,2018-12-03T20:00:30.123Z,metric_name,1543867230.123,prometheus\r\n,,0,2018-12-29T20:00:40.123Z,metric_name,1546113640.123,prometheus\r\n,,0,2018-12-30T20:00:50.123Z,metric_name,1546200050.123,prometheus\r\n,,0,2018-12-31T20:01:00.123Z,metric_name,1546286460.123,prometheus\r\n\"", Start: ast.Position{ Column: 11, Line: 20, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,outData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-12-01T20:00:10.123Z,metric_name,1543694410.123,prometheus\r\n,,0,2018-12-02T20:00:20.123Z,metric_name,1543780820.123,prometheus\r\n,,0,2018-12-03T20:00:30.123Z,metric_name,1543867230.123,prometheus\r\n,,0,2018-12-29T20:00:40.123Z,metric_name,1546113640.123,prometheus\r\n,,0,2018-12-30T20:00:50.123Z,metric_name,1546200050.123,prometheus\r\n,,0,2018-12-31T20:01:00.123Z,metric_name,1546286460.123,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 36, }, File: "timestamp_test.flux", Source: "t_timestamp = (table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp())", Start: ast.Position{ Column: 1, Line: 32, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 32, }, File: "timestamp_test.flux", Source: "t_timestamp", Start: ast.Position{ Column: 1, Line: 32, }, }, }, Name: "t_timestamp", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 36, }, File: "timestamp_test.flux", Source: "(table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp())", Start: ast.Position{ Column: 15, Line: 32, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 36, }, File: "timestamp_test.flux", Source: "(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp())", Start: ast.Position{ Column: 2, Line: 33, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 33, }, File: "timestamp_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 33, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 34, }, File: "timestamp_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 33, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 34, }, File: "timestamp_test.flux", Source: "start: 1980-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 34, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 34, }, File: "timestamp_test.flux", Source: "start: 1980-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 34, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 34, }, File: "timestamp_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 34, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 34, }, File: "timestamp_test.flux", Source: "1980-01-01T00:00:00Z", Start: ast.Position{ Column: 19, Line: 34, }, }, }, Value: parser.MustParseTime("1980-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 34, }, File: "timestamp_test.flux", Source: "range(start: 1980-01-01T00:00:00Z)", Start: ast.Position{ Column: 6, Line: 34, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 34, }, File: "timestamp_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 34, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 35, }, File: "timestamp_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 3, Line: 33, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 35, }, File: "timestamp_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 11, Line: 35, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 35, }, File: "timestamp_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 11, Line: 35, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 35, }, File: "timestamp_test.flux", Source: "columns", Start: ast.Position{ Column: 11, Line: 35, }, }, }, Name: "columns", }, Separator: nil, Value: &ast.ArrayExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 35, }, File: "timestamp_test.flux", Source: "[\"_start\", \"_stop\"]", Start: ast.Position{ Column: 20, Line: 35, }, }, }, Elements: []ast.Expression{&ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 35, }, File: "timestamp_test.flux", Source: "\"_start\"", Start: ast.Position{ Column: 21, Line: 35, }, }, }, Value: "_start", }, &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 38, Line: 35, }, File: "timestamp_test.flux", Source: "\"_stop\"", Start: ast.Position{ Column: 31, Line: 35, }, }, }, Value: "_stop", }}, Lbrack: nil, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 35, }, File: "timestamp_test.flux", Source: "drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 6, Line: 35, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 35, }, File: "timestamp_test.flux", Source: "drop", Start: ast.Position{ Column: 6, Line: 35, }, }, }, Name: "drop", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 36, }, File: "timestamp_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()", Start: ast.Position{ Column: 3, Line: 33, }, }, }, Call: &ast.CallExpression{ Arguments: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 36, }, File: "timestamp_test.flux", Source: "promql.timestamp()", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 36, }, File: "timestamp_test.flux", Source: "promql.timestamp", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 36, }, File: "timestamp_test.flux", Source: "promql", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Name: "promql", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 36, }, File: "timestamp_test.flux", Source: "timestamp", Start: ast.Position{ Column: 13, Line: 36, }, }, }, Name: "timestamp", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 32, }, File: "timestamp_test.flux", Source: "table=<-", Start: ast.Position{ Column: 16, Line: 32, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 32, }, File: "timestamp_test.flux", Source: "table", Start: ast.Position{ Column: 16, Line: 32, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 32, }, File: "timestamp_test.flux", Source: "<-", Start: ast.Position{ Column: 22, Line: 32, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 39, }, File: "timestamp_test.flux", Source: "_timestamp = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_timestamp})", Start: ast.Position{ Column: 6, Line: 38, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 38, }, File: "timestamp_test.flux", Source: "_timestamp", Start: ast.Position{ Column: 6, Line: 38, }, }, }, Name: "_timestamp", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 39, }, File: "timestamp_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_timestamp})", Start: ast.Position{ Column: 19, Line: 38, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 39, }, File: "timestamp_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_timestamp})", Start: ast.Position{ Column: 2, Line: 39, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 39, }, File: "timestamp_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_timestamp}", Start: ast.Position{ Column: 3, Line: 39, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 39, }, File: "timestamp_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 39, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 39, }, File: "timestamp_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 39, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 39, }, File: "timestamp_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 39, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 39, }, File: "timestamp_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 39, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 39, }, File: "timestamp_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 39, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 39, }, File: "timestamp_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 39, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 39, }, File: "timestamp_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 39, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 39, }, File: "timestamp_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 39, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 39, }, File: "timestamp_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 39, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 39, }, File: "timestamp_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 39, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 39, }, File: "timestamp_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 39, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 39, }, File: "timestamp_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 39, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 39, }, File: "timestamp_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 39, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 39, }, File: "timestamp_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 39, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 39, }, File: "timestamp_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 39, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 39, }, File: "timestamp_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 39, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 39, }, File: "timestamp_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 39, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 39, }, File: "timestamp_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 39, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 39, }, File: "timestamp_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 39, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 39, }, File: "timestamp_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 39, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 39, }, File: "timestamp_test.flux", Source: "fn: t_timestamp", Start: ast.Position{ Column: 82, Line: 39, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 39, }, File: "timestamp_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 39, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 97, Line: 39, }, File: "timestamp_test.flux", Source: "t_timestamp", Start: ast.Position{ Column: 86, Line: 39, }, }, }, Name: "t_timestamp", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 39, }, File: "timestamp_test.flux", Source: "test _timestamp = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_timestamp})", Start: ast.Position{ Column: 1, Line: 38, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "timestamp_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 2, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "timestamp_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 2, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "timestamp_test.flux", Source: "import \"internal/promql\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "timestamp_test.flux", Source: "\"internal/promql\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "internal/promql", }, }}, Metadata: "parser-type=rust", Name: "timestamp_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "timestamp_test.flux", Source: "package promql_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "timestamp_test.flux", Source: "promql_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "promql_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 41, }, File: "year_test.flux", Source: "package promql_test\nimport \"testing\"\nimport \"internal/promql\"\n\noption now = () =>\n\t(2030-01-01T00:00:00Z)\n\ninData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T20:00:00Z,metric_name,0,prometheus\r\n,,0,2019-02-04T20:00:00Z,metric_name,0,prometheus\r\n,,0,2020-03-05T20:00:00Z,metric_name,0,prometheus\r\n,,0,2021-10-06T20:00:00Z,metric_name,0,prometheus\r\n,,0,2022-11-07T20:00:00Z,metric_name,0,prometheus\r\n,,0,2023-12-08T20:00:00Z,metric_name,0,prometheus\r\n\"\noutData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,outData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T20:00:00Z,metric_name,2018,prometheus\r\n,,0,2019-02-04T20:00:00Z,metric_name,2019,prometheus\r\n,,0,2020-03-05T20:00:00Z,metric_name,2020,prometheus\r\n,,0,2021-10-06T20:00:00Z,metric_name,2021,prometheus\r\n,,0,2022-11-07T20:00:00Z,metric_name,2022,prometheus\r\n,,0,2023-12-08T20:00:00Z,metric_name,2023,prometheus\r\n\"\nt_promqlYear = (table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()\n\t\t|> map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlYear(timestamp: r._value)})))\n\ntest _promqlYear = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlYear})", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Body: []ast.Statement{&ast.OptionStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "year_test.flux", Source: "now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 8, Line: 5, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 5, }, File: "year_test.flux", Source: "now", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Name: "now", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "year_test.flux", Source: "() =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 14, Line: 5, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "year_test.flux", Source: "(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 2, Line: 6, }, }, }, Expression: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 6, }, File: "year_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 3, Line: 6, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 6, }, File: "year_test.flux", Source: "option now = () =>\n\t(2030-01-01T00:00:00Z)", Start: ast.Position{ Column: 1, Line: 5, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "year_test.flux", Source: "inData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T20:00:00Z,metric_name,0,prometheus\r\n,,0,2019-02-04T20:00:00Z,metric_name,0,prometheus\r\n,,0,2020-03-05T20:00:00Z,metric_name,0,prometheus\r\n,,0,2021-10-06T20:00:00Z,metric_name,0,prometheus\r\n,,0,2022-11-07T20:00:00Z,metric_name,0,prometheus\r\n,,0,2023-12-08T20:00:00Z,metric_name,0,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 8, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 8, }, File: "year_test.flux", Source: "inData", Start: ast.Position{ Column: 1, Line: 8, }, }, }, Name: "inData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 19, }, File: "year_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T20:00:00Z,metric_name,0,prometheus\r\n,,0,2019-02-04T20:00:00Z,metric_name,0,prometheus\r\n,,0,2020-03-05T20:00:00Z,metric_name,0,prometheus\r\n,,0,2021-10-06T20:00:00Z,metric_name,0,prometheus\r\n,,0,2022-11-07T20:00:00Z,metric_name,0,prometheus\r\n,,0,2023-12-08T20:00:00Z,metric_name,0,prometheus\r\n\"", Start: ast.Position{ Column: 10, Line: 8, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,inData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T20:00:00Z,metric_name,0,prometheus\r\n,,0,2019-02-04T20:00:00Z,metric_name,0,prometheus\r\n,,0,2020-03-05T20:00:00Z,metric_name,0,prometheus\r\n,,0,2021-10-06T20:00:00Z,metric_name,0,prometheus\r\n,,0,2022-11-07T20:00:00Z,metric_name,0,prometheus\r\n,,0,2023-12-08T20:00:00Z,metric_name,0,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 31, }, File: "year_test.flux", Source: "outData = \"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,outData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T20:00:00Z,metric_name,2018,prometheus\r\n,,0,2019-02-04T20:00:00Z,metric_name,2019,prometheus\r\n,,0,2020-03-05T20:00:00Z,metric_name,2020,prometheus\r\n,,0,2021-10-06T20:00:00Z,metric_name,2021,prometheus\r\n,,0,2022-11-07T20:00:00Z,metric_name,2022,prometheus\r\n,,0,2023-12-08T20:00:00Z,metric_name,2023,prometheus\r\n\"", Start: ast.Position{ Column: 1, Line: 20, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 20, }, File: "year_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 20, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 31, }, File: "year_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,outData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T20:00:00Z,metric_name,2018,prometheus\r\n,,0,2019-02-04T20:00:00Z,metric_name,2019,prometheus\r\n,,0,2020-03-05T20:00:00Z,metric_name,2020,prometheus\r\n,,0,2021-10-06T20:00:00Z,metric_name,2021,prometheus\r\n,,0,2022-11-07T20:00:00Z,metric_name,2022,prometheus\r\n,,0,2023-12-08T20:00:00Z,metric_name,2023,prometheus\r\n\"", Start: ast.Position{ Column: 11, Line: 20, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,double,string\r\n#group,false,false,false,true,false,true\r\n#default,outData,,,,,\r\n,result,table,_time,_field,_value,_measurement\r\n,,0,2018-01-03T20:00:00Z,metric_name,2018,prometheus\r\n,,0,2019-02-04T20:00:00Z,metric_name,2019,prometheus\r\n,,0,2020-03-05T20:00:00Z,metric_name,2020,prometheus\r\n,,0,2021-10-06T20:00:00Z,metric_name,2021,prometheus\r\n,,0,2022-11-07T20:00:00Z,metric_name,2022,prometheus\r\n,,0,2023-12-08T20:00:00Z,metric_name,2023,prometheus\r\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 38, }, File: "year_test.flux", Source: "t_promqlYear = (table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()\n\t\t|> map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlYear(timestamp: r._value)})))", Start: ast.Position{ Column: 1, Line: 32, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 13, Line: 32, }, File: "year_test.flux", Source: "t_promqlYear", Start: ast.Position{ Column: 1, Line: 32, }, }, }, Name: "t_promqlYear", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 38, }, File: "year_test.flux", Source: "(table=<-) =>\n\t(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()\n\t\t|> map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlYear(timestamp: r._value)})))", Start: ast.Position{ Column: 16, Line: 32, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 63, Line: 38, }, File: "year_test.flux", Source: "(table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()\n\t\t|> map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlYear(timestamp: r._value)})))", Start: ast.Position{ Column: 2, Line: 33, }, }, }, Expression: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 33, }, File: "year_test.flux", Source: "table", Start: ast.Position{ Column: 3, Line: 33, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 34, }, File: "year_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)", Start: ast.Position{ Column: 3, Line: 33, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 34, }, File: "year_test.flux", Source: "start: 1980-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 34, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 34, }, File: "year_test.flux", Source: "start: 1980-01-01T00:00:00Z", Start: ast.Position{ Column: 12, Line: 34, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 34, }, File: "year_test.flux", Source: "start", Start: ast.Position{ Column: 12, Line: 34, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 34, }, File: "year_test.flux", Source: "1980-01-01T00:00:00Z", Start: ast.Position{ Column: 19, Line: 34, }, }, }, Value: parser.MustParseTime("1980-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 34, }, File: "year_test.flux", Source: "range(start: 1980-01-01T00:00:00Z)", Start: ast.Position{ Column: 6, Line: 34, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 11, Line: 34, }, File: "year_test.flux", Source: "range", Start: ast.Position{ Column: 6, Line: 34, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 35, }, File: "year_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 3, Line: 33, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 35, }, File: "year_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 11, Line: 35, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 35, }, File: "year_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 11, Line: 35, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 35, }, File: "year_test.flux", Source: "columns", Start: ast.Position{ Column: 11, Line: 35, }, }, }, Name: "columns", }, Separator: nil, Value: &ast.ArrayExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 39, Line: 35, }, File: "year_test.flux", Source: "[\"_start\", \"_stop\"]", Start: ast.Position{ Column: 20, Line: 35, }, }, }, Elements: []ast.Expression{&ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 35, }, File: "year_test.flux", Source: "\"_start\"", Start: ast.Position{ Column: 21, Line: 35, }, }, }, Value: "_start", }, &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 38, Line: 35, }, File: "year_test.flux", Source: "\"_stop\"", Start: ast.Position{ Column: 31, Line: 35, }, }, }, Value: "_stop", }}, Lbrack: nil, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 35, }, File: "year_test.flux", Source: "drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 6, Line: 35, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 35, }, File: "year_test.flux", Source: "drop", Start: ast.Position{ Column: 6, Line: 35, }, }, }, Name: "drop", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 36, }, File: "year_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()", Start: ast.Position{ Column: 3, Line: 33, }, }, }, Call: &ast.CallExpression{ Arguments: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 36, }, File: "year_test.flux", Source: "promql.timestamp()", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 36, }, File: "year_test.flux", Source: "promql.timestamp", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 36, }, File: "year_test.flux", Source: "promql", Start: ast.Position{ Column: 6, Line: 36, }, }, }, Name: "promql", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 36, }, File: "year_test.flux", Source: "timestamp", Start: ast.Position{ Column: 13, Line: 36, }, }, }, Name: "timestamp", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 38, }, File: "year_test.flux", Source: "table\n\t\t|> range(start: 1980-01-01T00:00:00Z)\n\t\t|> drop(columns: [\"_start\", \"_stop\"])\n\t\t|> promql.timestamp()\n\t\t|> map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlYear(timestamp: r._value)}))", Start: ast.Position{ Column: 3, Line: 33, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 38, }, File: "year_test.flux", Source: "fn: (r) =>\n\t\t\t({r with _value: promql.promqlYear(timestamp: r._value)})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 38, }, File: "year_test.flux", Source: "fn: (r) =>\n\t\t\t({r with _value: promql.promqlYear(timestamp: r._value)})", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 37, }, File: "year_test.flux", Source: "fn", Start: ast.Position{ Column: 10, Line: 37, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 38, }, File: "year_test.flux", Source: "(r) =>\n\t\t\t({r with _value: promql.promqlYear(timestamp: r._value)})", Start: ast.Position{ Column: 14, Line: 37, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 38, }, File: "year_test.flux", Source: "({r with _value: promql.promqlYear(timestamp: r._value)})", Start: ast.Position{ Column: 4, Line: 38, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 38, }, File: "year_test.flux", Source: "{r with _value: promql.promqlYear(timestamp: r._value)}", Start: ast.Position{ Column: 5, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 38, }, File: "year_test.flux", Source: "_value: promql.promqlYear(timestamp: r._value)", Start: ast.Position{ Column: 13, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 38, }, File: "year_test.flux", Source: "_value", Start: ast.Position{ Column: 13, Line: 38, }, }, }, Name: "_value", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 38, }, File: "year_test.flux", Source: "timestamp: r._value", Start: ast.Position{ Column: 39, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 38, }, File: "year_test.flux", Source: "timestamp: r._value", Start: ast.Position{ Column: 39, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 38, }, File: "year_test.flux", Source: "timestamp", Start: ast.Position{ Column: 39, Line: 38, }, }, }, Name: "timestamp", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 38, }, File: "year_test.flux", Source: "r._value", Start: ast.Position{ Column: 50, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 51, Line: 38, }, File: "year_test.flux", Source: "r", Start: ast.Position{ Column: 50, Line: 38, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 38, }, File: "year_test.flux", Source: "_value", Start: ast.Position{ Column: 52, Line: 38, }, }, }, Name: "_value", }, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 38, }, File: "year_test.flux", Source: "promql.promqlYear(timestamp: r._value)", Start: ast.Position{ Column: 21, Line: 38, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 38, Line: 38, }, File: "year_test.flux", Source: "promql.promqlYear", Start: ast.Position{ Column: 21, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 38, }, File: "year_test.flux", Source: "promql", Start: ast.Position{ Column: 21, Line: 38, }, }, }, Name: "promql", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 38, Line: 38, }, File: "year_test.flux", Source: "promqlYear", Start: ast.Position{ Column: 28, Line: 38, }, }, }, Name: "promqlYear", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }}, Rbrace: nil, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 7, Line: 38, }, File: "year_test.flux", Source: "r", Start: ast.Position{ Column: 6, Line: 38, }, }, }, Name: "r", }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "year_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 37, }, File: "year_test.flux", Source: "r", Start: ast.Position{ Column: 15, Line: 37, }, }, }, Name: "r", }, Separator: nil, Value: nil, }}, Rparan: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 38, }, File: "year_test.flux", Source: "map(fn: (r) =>\n\t\t\t({r with _value: promql.promqlYear(timestamp: r._value)}))", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 37, }, File: "year_test.flux", Source: "map", Start: ast.Position{ Column: 6, Line: 37, }, }, }, Name: "map", }, Lparen: nil, Rparen: nil, }, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 32, }, File: "year_test.flux", Source: "table=<-", Start: ast.Position{ Column: 17, Line: 32, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 32, }, File: "year_test.flux", Source: "table", Start: ast.Position{ Column: 17, Line: 32, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 32, }, File: "year_test.flux", Source: "<-", Start: ast.Position{ Column: 23, Line: 32, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 41, }, File: "year_test.flux", Source: "_promqlYear = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlYear})", Start: ast.Position{ Column: 6, Line: 40, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 40, }, File: "year_test.flux", Source: "_promqlYear", Start: ast.Position{ Column: 6, Line: 40, }, }, }, Name: "_promqlYear", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 41, }, File: "year_test.flux", Source: "() =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlYear})", Start: ast.Position{ Column: 20, Line: 40, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 41, }, File: "year_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlYear})", Start: ast.Position{ Column: 2, Line: 41, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 41, }, File: "year_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlYear}", Start: ast.Position{ Column: 3, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 41, }, File: "year_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 4, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 9, Line: 41, }, File: "year_test.flux", Source: "input", Start: ast.Position{ Column: 4, Line: 41, }, }, }, Name: "input", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 41, }, File: "year_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 41, }, File: "year_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 31, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 34, Line: 41, }, File: "year_test.flux", Source: "csv", Start: ast.Position{ Column: 31, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 41, }, File: "year_test.flux", Source: "inData", Start: ast.Position{ Column: 36, Line: 41, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 43, Line: 41, }, File: "year_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 11, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 41, }, File: "year_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 11, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 41, }, File: "year_test.flux", Source: "testing", Start: ast.Position{ Column: 11, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 41, }, File: "year_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 19, Line: 41, }, }, }, Name: "loadStorage", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 41, }, File: "year_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 45, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 49, Line: 41, }, File: "year_test.flux", Source: "want", Start: ast.Position{ Column: 45, Line: 41, }, }, }, Name: "want", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 41, }, File: "year_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 41, }, File: "year_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 67, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 41, }, File: "year_test.flux", Source: "csv", Start: ast.Position{ Column: 67, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 41, }, File: "year_test.flux", Source: "outData", Start: ast.Position{ Column: 72, Line: 41, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 41, }, File: "year_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 51, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 41, }, File: "year_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 51, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 41, }, File: "year_test.flux", Source: "testing", Start: ast.Position{ Column: 51, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 41, }, File: "year_test.flux", Source: "loadMem", Start: ast.Position{ Column: 59, Line: 41, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 41, }, File: "year_test.flux", Source: "fn: t_promqlYear", Start: ast.Position{ Column: 82, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 41, }, File: "year_test.flux", Source: "fn", Start: ast.Position{ Column: 82, Line: 41, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 98, Line: 41, }, File: "year_test.flux", Source: "t_promqlYear", Start: ast.Position{ Column: 86, Line: 41, }, }, }, Name: "t_promqlYear", }, }}, Rbrace: nil, With: nil, }, Lparen: nil, Rparen: nil, }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 41, }, File: "year_test.flux", Source: "test _promqlYear = () =>\n\t({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_promqlYear})", Start: ast.Position{ Column: 1, Line: 40, }, }, }, }}, Eof: nil, Imports: []*ast.ImportDeclaration{&ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "year_test.flux", Source: "import \"testing\"", Start: ast.Position{ Column: 1, Line: 2, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 2, }, File: "year_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 2, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "year_test.flux", Source: "import \"internal/promql\"", Start: ast.Position{ Column: 1, Line: 3, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 3, }, File: "year_test.flux", Source: "\"internal/promql\"", Start: ast.Position{ Column: 8, Line: 3, }, }, }, Value: "internal/promql", }, }}, Metadata: "parser-type=rust", Name: "year_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "year_test.flux", Source: "package promql_test", Start: ast.Position{ Column: 1, Line: 1, }, }, }, Name: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 1, }, File: "year_test.flux", Source: "promql_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "promql_test", }, }, }}, Package: "promql_test", Path: "testing/promql", }}
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.