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: 106, Line: 41, }, File: "hour_duration_test.flux", Source: "package date_test\n\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => 2030-01-01T00:00:00Z\n\ninData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"\noutData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,23\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,23\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,23\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n\"\nt_duration_hour = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.hour(t: duration(v: r._value))}))\n\ntest _duration_hour = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_hour})", 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: 40, Line: 7, }, File: "hour_duration_test.flux", Source: "now = () => 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: "hour_duration_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: 40, Line: 7, }, File: "hour_duration_test.flux", Source: "() => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "hour_duration_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 20, Line: 7, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "hour_duration_test.flux", Source: "option now = () => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 21, }, File: "hour_duration_test.flux", Source: "inData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\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: "hour_duration_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: 21, }, File: "hour_duration_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 5, Line: 10, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "hour_duration_test.flux", Source: "outData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,23\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,23\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,23\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n\"", Start: ast.Position{ Column: 1, Line: 22, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 22, }, File: "hour_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 22, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "hour_duration_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,23\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,23\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,23\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n\"", Start: ast.Position{ Column: 5, Line: 23, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,23\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,23\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,23\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 38, }, File: "hour_duration_test.flux", Source: "t_duration_hour = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.hour(t: duration(v: r._value))}))", Start: ast.Position{ Column: 1, Line: 35, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 35, }, File: "hour_duration_test.flux", Source: "t_duration_hour", Start: ast.Position{ Column: 1, Line: 35, }, }, }, Name: "t_duration_hour", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 38, }, File: "hour_duration_test.flux", Source: "(table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.hour(t: duration(v: r._value))}))", Start: ast.Position{ Column: 19, Line: 35, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 36, }, File: "hour_duration_test.flux", Source: "table", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 37, }, File: "hour_duration_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "hour_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "hour_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 37, }, File: "hour_duration_test.flux", Source: "start", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "hour_duration_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 25, Line: 37, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 37, }, File: "hour_duration_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 12, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 37, }, File: "hour_duration_test.flux", Source: "range", Start: ast.Position{ Column: 12, Line: 37, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 38, }, File: "hour_duration_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.hour(t: duration(v: r._value))}))", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 38, }, File: "hour_duration_test.flux", Source: "fn: (r) => ({r with _value: date.hour(t: duration(v: r._value))})", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 38, }, File: "hour_duration_test.flux", Source: "fn: (r) => ({r with _value: date.hour(t: duration(v: r._value))})", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 38, }, File: "hour_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 38, }, File: "hour_duration_test.flux", Source: "(r) => ({r with _value: date.hour(t: duration(v: r._value))})", Start: ast.Position{ Column: 20, Line: 38, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 38, }, File: "hour_duration_test.flux", Source: "({r with _value: date.hour(t: duration(v: r._value))})", Start: ast.Position{ Column: 27, Line: 38, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 38, }, File: "hour_duration_test.flux", Source: "{r with _value: date.hour(t: duration(v: r._value))}", Start: ast.Position{ Column: 28, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 38, }, File: "hour_duration_test.flux", Source: "_value: date.hour(t: duration(v: r._value))", Start: ast.Position{ Column: 36, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 38, }, File: "hour_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 36, 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: 78, Line: 38, }, File: "hour_duration_test.flux", Source: "t: duration(v: r._value)", Start: ast.Position{ Column: 54, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 38, }, File: "hour_duration_test.flux", Source: "t: duration(v: r._value)", Start: ast.Position{ Column: 54, 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: "hour_duration_test.flux", Source: "t", Start: ast.Position{ Column: 54, Line: 38, }, }, }, Name: "t", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 38, }, File: "hour_duration_test.flux", Source: "v: r._value", Start: ast.Position{ Column: 66, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 38, }, File: "hour_duration_test.flux", Source: "v: r._value", Start: ast.Position{ Column: 66, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 38, }, File: "hour_duration_test.flux", Source: "v", Start: ast.Position{ Column: 66, Line: 38, }, }, }, Name: "v", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 38, }, File: "hour_duration_test.flux", Source: "r._value", Start: ast.Position{ Column: 69, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 38, }, File: "hour_duration_test.flux", Source: "r", Start: ast.Position{ Column: 69, Line: 38, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 38, }, File: "hour_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 71, Line: 38, }, }, }, Name: "_value", }, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 38, }, File: "hour_duration_test.flux", Source: "duration(v: r._value)", Start: ast.Position{ Column: 57, Line: 38, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 38, }, File: "hour_duration_test.flux", Source: "duration", Start: ast.Position{ Column: 57, Line: 38, }, }, }, Name: "duration", }, Lparen: nil, Rparen: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 38, }, File: "hour_duration_test.flux", Source: "date.hour(t: duration(v: r._value))", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 38, }, File: "hour_duration_test.flux", Source: "date.hour", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 38, }, File: "hour_duration_test.flux", Source: "date", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 38, }, File: "hour_duration_test.flux", Source: "hour", Start: ast.Position{ Column: 49, Line: 38, }, }, }, Name: "hour", }, 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: 30, Line: 38, }, File: "hour_duration_test.flux", Source: "r", Start: ast.Position{ Column: 29, 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: 22, Line: 38, }, File: "hour_duration_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 38, }, File: "hour_duration_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 38, }, }, }, 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: 82, Line: 38, }, File: "hour_duration_test.flux", Source: "map(fn: (r) => ({r with _value: date.hour(t: duration(v: r._value))}))", Start: ast.Position{ Column: 12, Line: 38, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 38, }, File: "hour_duration_test.flux", Source: "map", Start: ast.Position{ Column: 12, Line: 38, }, }, }, 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: 28, Line: 35, }, File: "hour_duration_test.flux", Source: "table=<-", Start: ast.Position{ Column: 20, Line: 35, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 35, }, File: "hour_duration_test.flux", Source: "table", Start: ast.Position{ Column: 20, Line: 35, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 35, }, File: "hour_duration_test.flux", Source: "<-", Start: ast.Position{ Column: 26, Line: 35, }, }, }}, }}, 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: "hour_duration_test.flux", Source: "_duration_hour = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_hour})", Start: ast.Position{ Column: 6, Line: 40, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 40, }, File: "hour_duration_test.flux", Source: "_duration_hour", Start: ast.Position{ Column: 6, Line: 40, }, }, }, Name: "_duration_hour", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 41, }, File: "hour_duration_test.flux", Source: "() =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_hour})", Start: ast.Position{ Column: 23, Line: 40, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 41, }, File: "hour_duration_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_hour})", Start: ast.Position{ Column: 5, Line: 41, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 41, }, File: "hour_duration_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_hour}", Start: ast.Position{ Column: 6, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 41, }, File: "hour_duration_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 7, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 41, }, File: "hour_duration_test.flux", Source: "input", Start: ast.Position{ Column: 7, 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: 45, Line: 41, }, File: "hour_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 41, }, File: "hour_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 41, }, File: "hour_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 41, }, File: "hour_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 39, Line: 41, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 41, }, File: "hour_duration_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 41, }, File: "hour_duration_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 41, }, File: "hour_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 41, }, File: "hour_duration_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 22, 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: 83, Line: 41, }, File: "hour_duration_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 48, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 41, }, File: "hour_duration_test.flux", Source: "want", Start: ast.Position{ Column: 48, 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: 82, Line: 41, }, File: "hour_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 41, }, File: "hour_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 41, }, File: "hour_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 41, }, File: "hour_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 75, Line: 41, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 41, }, File: "hour_duration_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 41, }, File: "hour_duration_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 41, }, File: "hour_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 41, }, File: "hour_duration_test.flux", Source: "loadMem", Start: ast.Position{ Column: 62, 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: "hour_duration_test.flux", Source: "fn: t_duration_hour", Start: ast.Position{ Column: 85, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 41, }, File: "hour_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 85, 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: "hour_duration_test.flux", Source: "t_duration_hour", Start: ast.Position{ Column: 89, Line: 41, }, }, }, Name: "t_duration_hour", }, }}, 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: "hour_duration_test.flux", Source: "test _duration_hour = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_hour})", 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: 4, }, File: "hour_duration_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: "hour_duration_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "hour_duration_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "hour_duration_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "hour_duration_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "hour_duration_test.flux", Source: "package date_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: 18, Line: 1, }, File: "hour_duration_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 77, }, File: "hour_time_test.flux", Source: "package date_test\n\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => 2030-01-01T00:00:00Z\n\ninData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T00:53:00Z,_m,FF,1\n,,0,2018-05-22T01:53:00Z,_m,FF,1\n,,0,2018-05-22T02:53:10Z,_m,FF,1\n,,0,2018-05-22T03:53:20Z,_m,FF,1\n,,0,2018-05-22T04:53:30Z,_m,FF,1\n,,0,2018-05-22T05:53:40Z,_m,FF,1\n,,0,2018-05-22T06:53:50Z,_m,FF,1\n,,1,2018-05-22T07:53:00Z,_m,QQ,1\n,,1,2018-05-22T08:53:10Z,_m,QQ,1\n,,1,2018-05-22T09:53:20Z,_m,QQ,1\n,,1,2018-05-22T10:53:30Z,_m,QQ,1\n,,1,2018-05-22T11:53:40Z,_m,QQ,1\n,,1,2018-05-22T12:53:50Z,_m,QQ,1\n,,1,2018-05-22T13:54:00Z,_m,QQ,1\n,,1,2018-05-22T14:54:10Z,_m,QQ,1\n,,1,2018-05-22T15:54:20Z,_m,QQ,1\n,,2,2018-05-22T16:53:00Z,_m,RR,1\n,,2,2018-05-22T17:53:10Z,_m,RR,1\n,,2,2018-05-22T18:53:20Z,_m,RR,1\n,,2,2018-05-22T19:53:30Z,_m,RR,1\n,,3,2018-05-22T20:53:40Z,_m,SR,1\n,,3,2018-05-22T21:53:50Z,_m,SR,1\n,,3,2018-05-22T22:53:00Z,_m,SR,1\n,,3,2018-05-22T23:53:50Z,_m,SR,1\n\"\noutData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T00:53:00Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T01:53:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T02:53:10Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T03:53:20Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T04:53:30Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T05:53:40Z,5\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T06:53:50Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T07:53:00Z,7\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T08:53:10Z,8\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T09:53:20Z,9\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T10:53:30Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T11:53:40Z,11\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T12:53:50Z,12\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T13:54:00Z,13\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T14:54:10Z,14\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T15:54:20Z,15\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T16:53:00Z,16\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T17:53:10Z,17\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T18:53:20Z,18\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:30Z,19\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T20:53:40Z,20\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T21:53:50Z,21\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T22:53:00Z,22\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T23:53:50Z,23\n\"\nt_time_hour = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.hour(t: r._time)}))\n\ntest _time_hour = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_hour})", 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: 40, Line: 7, }, File: "hour_time_test.flux", Source: "now = () => 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: "hour_time_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: 40, Line: 7, }, File: "hour_time_test.flux", Source: "() => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "hour_time_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 20, Line: 7, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "hour_time_test.flux", Source: "option now = () => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 39, }, File: "hour_time_test.flux", Source: "inData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T00:53:00Z,_m,FF,1\n,,0,2018-05-22T01:53:00Z,_m,FF,1\n,,0,2018-05-22T02:53:10Z,_m,FF,1\n,,0,2018-05-22T03:53:20Z,_m,FF,1\n,,0,2018-05-22T04:53:30Z,_m,FF,1\n,,0,2018-05-22T05:53:40Z,_m,FF,1\n,,0,2018-05-22T06:53:50Z,_m,FF,1\n,,1,2018-05-22T07:53:00Z,_m,QQ,1\n,,1,2018-05-22T08:53:10Z,_m,QQ,1\n,,1,2018-05-22T09:53:20Z,_m,QQ,1\n,,1,2018-05-22T10:53:30Z,_m,QQ,1\n,,1,2018-05-22T11:53:40Z,_m,QQ,1\n,,1,2018-05-22T12:53:50Z,_m,QQ,1\n,,1,2018-05-22T13:54:00Z,_m,QQ,1\n,,1,2018-05-22T14:54:10Z,_m,QQ,1\n,,1,2018-05-22T15:54:20Z,_m,QQ,1\n,,2,2018-05-22T16:53:00Z,_m,RR,1\n,,2,2018-05-22T17:53:10Z,_m,RR,1\n,,2,2018-05-22T18:53:20Z,_m,RR,1\n,,2,2018-05-22T19:53:30Z,_m,RR,1\n,,3,2018-05-22T20:53:40Z,_m,SR,1\n,,3,2018-05-22T21:53:50Z,_m,SR,1\n,,3,2018-05-22T22:53:00Z,_m,SR,1\n,,3,2018-05-22T23:53:50Z,_m,SR,1\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: "hour_time_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: 39, }, File: "hour_time_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T00:53:00Z,_m,FF,1\n,,0,2018-05-22T01:53:00Z,_m,FF,1\n,,0,2018-05-22T02:53:10Z,_m,FF,1\n,,0,2018-05-22T03:53:20Z,_m,FF,1\n,,0,2018-05-22T04:53:30Z,_m,FF,1\n,,0,2018-05-22T05:53:40Z,_m,FF,1\n,,0,2018-05-22T06:53:50Z,_m,FF,1\n,,1,2018-05-22T07:53:00Z,_m,QQ,1\n,,1,2018-05-22T08:53:10Z,_m,QQ,1\n,,1,2018-05-22T09:53:20Z,_m,QQ,1\n,,1,2018-05-22T10:53:30Z,_m,QQ,1\n,,1,2018-05-22T11:53:40Z,_m,QQ,1\n,,1,2018-05-22T12:53:50Z,_m,QQ,1\n,,1,2018-05-22T13:54:00Z,_m,QQ,1\n,,1,2018-05-22T14:54:10Z,_m,QQ,1\n,,1,2018-05-22T15:54:20Z,_m,QQ,1\n,,2,2018-05-22T16:53:00Z,_m,RR,1\n,,2,2018-05-22T17:53:10Z,_m,RR,1\n,,2,2018-05-22T18:53:20Z,_m,RR,1\n,,2,2018-05-22T19:53:30Z,_m,RR,1\n,,3,2018-05-22T20:53:40Z,_m,SR,1\n,,3,2018-05-22T21:53:50Z,_m,SR,1\n,,3,2018-05-22T22:53:00Z,_m,SR,1\n,,3,2018-05-22T23:53:50Z,_m,SR,1\n\"", Start: ast.Position{ Column: 5, Line: 10, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T00:53:00Z,_m,FF,1\n,,0,2018-05-22T01:53:00Z,_m,FF,1\n,,0,2018-05-22T02:53:10Z,_m,FF,1\n,,0,2018-05-22T03:53:20Z,_m,FF,1\n,,0,2018-05-22T04:53:30Z,_m,FF,1\n,,0,2018-05-22T05:53:40Z,_m,FF,1\n,,0,2018-05-22T06:53:50Z,_m,FF,1\n,,1,2018-05-22T07:53:00Z,_m,QQ,1\n,,1,2018-05-22T08:53:10Z,_m,QQ,1\n,,1,2018-05-22T09:53:20Z,_m,QQ,1\n,,1,2018-05-22T10:53:30Z,_m,QQ,1\n,,1,2018-05-22T11:53:40Z,_m,QQ,1\n,,1,2018-05-22T12:53:50Z,_m,QQ,1\n,,1,2018-05-22T13:54:00Z,_m,QQ,1\n,,1,2018-05-22T14:54:10Z,_m,QQ,1\n,,1,2018-05-22T15:54:20Z,_m,QQ,1\n,,2,2018-05-22T16:53:00Z,_m,RR,1\n,,2,2018-05-22T17:53:10Z,_m,RR,1\n,,2,2018-05-22T18:53:20Z,_m,RR,1\n,,2,2018-05-22T19:53:30Z,_m,RR,1\n,,3,2018-05-22T20:53:40Z,_m,SR,1\n,,3,2018-05-22T21:53:50Z,_m,SR,1\n,,3,2018-05-22T22:53:00Z,_m,SR,1\n,,3,2018-05-22T23:53:50Z,_m,SR,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 70, }, File: "hour_time_test.flux", Source: "outData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T00:53:00Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T01:53:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T02:53:10Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T03:53:20Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T04:53:30Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T05:53:40Z,5\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T06:53:50Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T07:53:00Z,7\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T08:53:10Z,8\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T09:53:20Z,9\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T10:53:30Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T11:53:40Z,11\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T12:53:50Z,12\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T13:54:00Z,13\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T14:54:10Z,14\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T15:54:20Z,15\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T16:53:00Z,16\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T17:53:10Z,17\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T18:53:20Z,18\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:30Z,19\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T20:53:40Z,20\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T21:53:50Z,21\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T22:53:00Z,22\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T23:53:50Z,23\n\"", Start: ast.Position{ Column: 1, Line: 40, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 40, }, File: "hour_time_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 40, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 70, }, File: "hour_time_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T00:53:00Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T01:53:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T02:53:10Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T03:53:20Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T04:53:30Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T05:53:40Z,5\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T06:53:50Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T07:53:00Z,7\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T08:53:10Z,8\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T09:53:20Z,9\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T10:53:30Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T11:53:40Z,11\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T12:53:50Z,12\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T13:54:00Z,13\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T14:54:10Z,14\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T15:54:20Z,15\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T16:53:00Z,16\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T17:53:10Z,17\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T18:53:20Z,18\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:30Z,19\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T20:53:40Z,20\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T21:53:50Z,21\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T22:53:00Z,22\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T23:53:50Z,23\n\"", Start: ast.Position{ Column: 5, Line: 41, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T00:53:00Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T01:53:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T02:53:10Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T03:53:20Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T04:53:30Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T05:53:40Z,5\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T06:53:50Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T07:53:00Z,7\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T08:53:10Z,8\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T09:53:20Z,9\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T10:53:30Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T11:53:40Z,11\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T12:53:50Z,12\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T13:54:00Z,13\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T14:54:10Z,14\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T15:54:20Z,15\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T16:53:00Z,16\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T17:53:10Z,17\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T18:53:20Z,18\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:30Z,19\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T20:53:40Z,20\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T21:53:50Z,21\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T22:53:00Z,22\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T23:53:50Z,23\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 74, }, File: "hour_time_test.flux", Source: "t_time_hour = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.hour(t: r._time)}))", Start: ast.Position{ Column: 1, Line: 71, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 71, }, File: "hour_time_test.flux", Source: "t_time_hour", Start: ast.Position{ Column: 1, Line: 71, }, }, }, Name: "t_time_hour", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 74, }, File: "hour_time_test.flux", Source: "(table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.hour(t: r._time)}))", Start: ast.Position{ Column: 15, Line: 71, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 72, }, File: "hour_time_test.flux", Source: "table", Start: ast.Position{ Column: 5, Line: 72, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 73, }, File: "hour_time_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 5, Line: 72, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 73, }, File: "hour_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 73, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 73, }, File: "hour_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 73, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 73, }, File: "hour_time_test.flux", Source: "start", Start: ast.Position{ Column: 18, Line: 73, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 73, }, File: "hour_time_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 25, Line: 73, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 73, }, File: "hour_time_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 12, Line: 73, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 73, }, File: "hour_time_test.flux", Source: "range", Start: ast.Position{ Column: 12, Line: 73, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 74, }, File: "hour_time_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.hour(t: r._time)}))", Start: ast.Position{ Column: 5, Line: 72, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 74, }, File: "hour_time_test.flux", Source: "fn: (r) => ({r with _value: date.hour(t: r._time)})", Start: ast.Position{ Column: 16, Line: 74, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 74, }, File: "hour_time_test.flux", Source: "fn: (r) => ({r with _value: date.hour(t: r._time)})", Start: ast.Position{ Column: 16, Line: 74, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 74, }, File: "hour_time_test.flux", Source: "fn", Start: ast.Position{ Column: 16, Line: 74, }, }, }, 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: 74, }, File: "hour_time_test.flux", Source: "(r) => ({r with _value: date.hour(t: r._time)})", Start: ast.Position{ Column: 20, Line: 74, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 74, }, File: "hour_time_test.flux", Source: "({r with _value: date.hour(t: r._time)})", Start: ast.Position{ Column: 27, Line: 74, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 74, }, File: "hour_time_test.flux", Source: "{r with _value: date.hour(t: r._time)}", Start: ast.Position{ Column: 28, Line: 74, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 74, }, File: "hour_time_test.flux", Source: "_value: date.hour(t: r._time)", Start: ast.Position{ Column: 36, Line: 74, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 74, }, File: "hour_time_test.flux", Source: "_value", Start: ast.Position{ Column: 36, Line: 74, }, }, }, 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: 74, }, File: "hour_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 54, Line: 74, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 74, }, File: "hour_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 54, Line: 74, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 55, Line: 74, }, File: "hour_time_test.flux", Source: "t", Start: ast.Position{ Column: 54, Line: 74, }, }, }, Name: "t", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 74, }, File: "hour_time_test.flux", Source: "r._time", Start: ast.Position{ Column: 57, Line: 74, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 74, }, File: "hour_time_test.flux", Source: "r", Start: ast.Position{ Column: 57, Line: 74, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 74, }, File: "hour_time_test.flux", Source: "_time", Start: ast.Position{ Column: 59, Line: 74, }, }, }, Name: "_time", }, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 74, }, File: "hour_time_test.flux", Source: "date.hour(t: r._time)", Start: ast.Position{ Column: 44, Line: 74, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 74, }, File: "hour_time_test.flux", Source: "date.hour", Start: ast.Position{ Column: 44, Line: 74, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 74, }, File: "hour_time_test.flux", Source: "date", Start: ast.Position{ Column: 44, Line: 74, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 74, }, File: "hour_time_test.flux", Source: "hour", Start: ast.Position{ Column: 49, Line: 74, }, }, }, Name: "hour", }, 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: 30, Line: 74, }, File: "hour_time_test.flux", Source: "r", Start: ast.Position{ Column: 29, Line: 74, }, }, }, 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: 22, Line: 74, }, File: "hour_time_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 74, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 74, }, File: "hour_time_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 74, }, }, }, 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: 74, }, File: "hour_time_test.flux", Source: "map(fn: (r) => ({r with _value: date.hour(t: r._time)}))", Start: ast.Position{ Column: 12, Line: 74, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 74, }, File: "hour_time_test.flux", Source: "map", Start: ast.Position{ Column: 12, Line: 74, }, }, }, 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: 24, Line: 71, }, File: "hour_time_test.flux", Source: "table=<-", Start: ast.Position{ Column: 16, Line: 71, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 71, }, File: "hour_time_test.flux", Source: "table", Start: ast.Position{ Column: 16, Line: 71, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 71, }, File: "hour_time_test.flux", Source: "<-", Start: ast.Position{ Column: 22, Line: 71, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 77, }, File: "hour_time_test.flux", Source: "_time_hour = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_hour})", Start: ast.Position{ Column: 6, Line: 76, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 76, }, File: "hour_time_test.flux", Source: "_time_hour", Start: ast.Position{ Column: 6, Line: 76, }, }, }, Name: "_time_hour", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 77, }, File: "hour_time_test.flux", Source: "() =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_hour})", Start: ast.Position{ Column: 19, Line: 76, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 77, }, File: "hour_time_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_hour})", Start: ast.Position{ Column: 5, Line: 77, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 77, }, File: "hour_time_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_hour}", Start: ast.Position{ Column: 6, Line: 77, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 77, }, File: "hour_time_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 7, Line: 77, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 77, }, File: "hour_time_test.flux", Source: "input", Start: ast.Position{ Column: 7, Line: 77, }, }, }, 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: 77, }, File: "hour_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 77, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 77, }, File: "hour_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 77, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 77, }, File: "hour_time_test.flux", Source: "csv", Start: ast.Position{ Column: 34, Line: 77, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 77, }, File: "hour_time_test.flux", Source: "inData", Start: ast.Position{ Column: 39, Line: 77, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 77, }, File: "hour_time_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 14, Line: 77, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 77, }, File: "hour_time_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 14, Line: 77, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 77, }, File: "hour_time_test.flux", Source: "testing", Start: ast.Position{ Column: 14, Line: 77, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 77, }, File: "hour_time_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 22, Line: 77, }, }, }, 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: 77, }, File: "hour_time_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 48, Line: 77, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 77, }, File: "hour_time_test.flux", Source: "want", Start: ast.Position{ Column: 48, Line: 77, }, }, }, 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: 77, }, File: "hour_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 77, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 77, }, File: "hour_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 77, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 77, }, File: "hour_time_test.flux", Source: "csv", Start: ast.Position{ Column: 70, Line: 77, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 77, }, File: "hour_time_test.flux", Source: "outData", Start: ast.Position{ Column: 75, Line: 77, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 77, }, File: "hour_time_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 54, Line: 77, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 77, }, File: "hour_time_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 54, Line: 77, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 77, }, File: "hour_time_test.flux", Source: "testing", Start: ast.Position{ Column: 54, Line: 77, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 77, }, File: "hour_time_test.flux", Source: "loadMem", Start: ast.Position{ Column: 62, Line: 77, }, }, }, 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: 77, }, File: "hour_time_test.flux", Source: "fn: t_time_hour", Start: ast.Position{ Column: 85, Line: 77, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 77, }, File: "hour_time_test.flux", Source: "fn", Start: ast.Position{ Column: 85, Line: 77, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 77, }, File: "hour_time_test.flux", Source: "t_time_hour", Start: ast.Position{ Column: 89, Line: 77, }, }, }, Name: "t_time_hour", }, }}, 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: 77, }, File: "hour_time_test.flux", Source: "test _time_hour = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_hour})", Start: ast.Position{ Column: 1, Line: 76, }, }, }, }}, 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: 4, }, File: "hour_time_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: "hour_time_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "hour_time_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "hour_time_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "hour_time_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "hour_time_test.flux", Source: "package date_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: 18, Line: 1, }, File: "hour_time_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 113, Line: 41, }, File: "microsecond_duration_test.flux", Source: "package date_test\n\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => 2030-01-01T00:00:00Z\n\ninData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"\noutData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,999999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,999999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,999999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n\"\nt_duration_microsecond = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.microsecond(t: duration(v: r._value))}))\n\ntest _duration_microsecond = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_microsecond})", 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: 40, Line: 7, }, File: "microsecond_duration_test.flux", Source: "now = () => 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: "microsecond_duration_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: 40, Line: 7, }, File: "microsecond_duration_test.flux", Source: "() => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "microsecond_duration_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 20, Line: 7, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "microsecond_duration_test.flux", Source: "option now = () => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 21, }, File: "microsecond_duration_test.flux", Source: "inData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\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: "microsecond_duration_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: 21, }, File: "microsecond_duration_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 5, Line: 10, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "microsecond_duration_test.flux", Source: "outData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,999999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,999999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,999999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n\"", Start: ast.Position{ Column: 1, Line: 22, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 22, }, File: "microsecond_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 22, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "microsecond_duration_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,999999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,999999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,999999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n\"", Start: ast.Position{ Column: 5, Line: 23, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,999999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,999999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,999999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 89, Line: 38, }, File: "microsecond_duration_test.flux", Source: "t_duration_microsecond = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.microsecond(t: duration(v: r._value))}))", Start: ast.Position{ Column: 1, Line: 35, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 35, }, File: "microsecond_duration_test.flux", Source: "t_duration_microsecond", Start: ast.Position{ Column: 1, Line: 35, }, }, }, Name: "t_duration_microsecond", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 89, Line: 38, }, File: "microsecond_duration_test.flux", Source: "(table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.microsecond(t: duration(v: r._value))}))", Start: ast.Position{ Column: 26, Line: 35, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 36, }, File: "microsecond_duration_test.flux", Source: "table", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 37, }, File: "microsecond_duration_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "microsecond_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "microsecond_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 37, }, File: "microsecond_duration_test.flux", Source: "start", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "microsecond_duration_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 25, Line: 37, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 37, }, File: "microsecond_duration_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 12, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 37, }, File: "microsecond_duration_test.flux", Source: "range", Start: ast.Position{ Column: 12, Line: 37, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 89, Line: 38, }, File: "microsecond_duration_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.microsecond(t: duration(v: r._value))}))", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 88, Line: 38, }, File: "microsecond_duration_test.flux", Source: "fn: (r) => ({r with _value: date.microsecond(t: duration(v: r._value))})", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 88, Line: 38, }, File: "microsecond_duration_test.flux", Source: "fn: (r) => ({r with _value: date.microsecond(t: duration(v: r._value))})", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 38, }, File: "microsecond_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 88, Line: 38, }, File: "microsecond_duration_test.flux", Source: "(r) => ({r with _value: date.microsecond(t: duration(v: r._value))})", Start: ast.Position{ Column: 20, Line: 38, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 88, Line: 38, }, File: "microsecond_duration_test.flux", Source: "({r with _value: date.microsecond(t: duration(v: r._value))})", Start: ast.Position{ Column: 27, Line: 38, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 38, }, File: "microsecond_duration_test.flux", Source: "{r with _value: date.microsecond(t: duration(v: r._value))}", Start: ast.Position{ Column: 28, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 86, Line: 38, }, File: "microsecond_duration_test.flux", Source: "_value: date.microsecond(t: duration(v: r._value))", Start: ast.Position{ Column: 36, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 38, }, File: "microsecond_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 36, 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: 85, Line: 38, }, File: "microsecond_duration_test.flux", Source: "t: duration(v: r._value)", Start: ast.Position{ Column: 61, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 85, Line: 38, }, File: "microsecond_duration_test.flux", Source: "t: duration(v: r._value)", Start: ast.Position{ Column: 61, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 38, }, File: "microsecond_duration_test.flux", Source: "t", Start: ast.Position{ Column: 61, Line: 38, }, }, }, Name: "t", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 38, }, File: "microsecond_duration_test.flux", Source: "v: r._value", Start: ast.Position{ Column: 73, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 38, }, File: "microsecond_duration_test.flux", Source: "v: r._value", Start: ast.Position{ Column: 73, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 38, }, File: "microsecond_duration_test.flux", Source: "v", Start: ast.Position{ Column: 73, Line: 38, }, }, }, Name: "v", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 38, }, File: "microsecond_duration_test.flux", Source: "r._value", Start: ast.Position{ Column: 76, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 38, }, File: "microsecond_duration_test.flux", Source: "r", Start: ast.Position{ Column: 76, Line: 38, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 38, }, File: "microsecond_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 78, Line: 38, }, }, }, Name: "_value", }, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 85, Line: 38, }, File: "microsecond_duration_test.flux", Source: "duration(v: r._value)", Start: ast.Position{ Column: 64, Line: 38, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 38, }, File: "microsecond_duration_test.flux", Source: "duration", Start: ast.Position{ Column: 64, Line: 38, }, }, }, Name: "duration", }, Lparen: nil, Rparen: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 86, Line: 38, }, File: "microsecond_duration_test.flux", Source: "date.microsecond(t: duration(v: r._value))", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 38, }, File: "microsecond_duration_test.flux", Source: "date.microsecond", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 38, }, File: "microsecond_duration_test.flux", Source: "date", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 38, }, File: "microsecond_duration_test.flux", Source: "microsecond", Start: ast.Position{ Column: 49, Line: 38, }, }, }, Name: "microsecond", }, 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: 30, Line: 38, }, File: "microsecond_duration_test.flux", Source: "r", Start: ast.Position{ Column: 29, 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: 22, Line: 38, }, File: "microsecond_duration_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 38, }, File: "microsecond_duration_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 38, }, }, }, 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: 89, Line: 38, }, File: "microsecond_duration_test.flux", Source: "map(fn: (r) => ({r with _value: date.microsecond(t: duration(v: r._value))}))", Start: ast.Position{ Column: 12, Line: 38, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 38, }, File: "microsecond_duration_test.flux", Source: "map", Start: ast.Position{ Column: 12, Line: 38, }, }, }, 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: 35, Line: 35, }, File: "microsecond_duration_test.flux", Source: "table=<-", Start: ast.Position{ Column: 27, Line: 35, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 32, Line: 35, }, File: "microsecond_duration_test.flux", Source: "table", Start: ast.Position{ Column: 27, Line: 35, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 35, }, File: "microsecond_duration_test.flux", Source: "<-", Start: ast.Position{ Column: 33, Line: 35, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 113, Line: 41, }, File: "microsecond_duration_test.flux", Source: "_duration_microsecond = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_microsecond})", Start: ast.Position{ Column: 6, Line: 40, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 40, }, File: "microsecond_duration_test.flux", Source: "_duration_microsecond", Start: ast.Position{ Column: 6, Line: 40, }, }, }, Name: "_duration_microsecond", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 113, Line: 41, }, File: "microsecond_duration_test.flux", Source: "() =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_microsecond})", Start: ast.Position{ Column: 30, Line: 40, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 113, Line: 41, }, File: "microsecond_duration_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_microsecond})", Start: ast.Position{ Column: 5, Line: 41, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 112, Line: 41, }, File: "microsecond_duration_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_microsecond}", Start: ast.Position{ Column: 6, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 41, }, File: "microsecond_duration_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 7, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 41, }, File: "microsecond_duration_test.flux", Source: "input", Start: ast.Position{ Column: 7, 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: 45, Line: 41, }, File: "microsecond_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 41, }, File: "microsecond_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 41, }, File: "microsecond_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 41, }, File: "microsecond_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 39, Line: 41, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 41, }, File: "microsecond_duration_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 41, }, File: "microsecond_duration_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 41, }, File: "microsecond_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 41, }, File: "microsecond_duration_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 22, 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: 83, Line: 41, }, File: "microsecond_duration_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 48, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 41, }, File: "microsecond_duration_test.flux", Source: "want", Start: ast.Position{ Column: 48, 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: 82, Line: 41, }, File: "microsecond_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 41, }, File: "microsecond_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 41, }, File: "microsecond_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 41, }, File: "microsecond_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 75, Line: 41, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 41, }, File: "microsecond_duration_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 41, }, File: "microsecond_duration_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 41, }, File: "microsecond_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 41, }, File: "microsecond_duration_test.flux", Source: "loadMem", Start: ast.Position{ Column: 62, 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: 111, Line: 41, }, File: "microsecond_duration_test.flux", Source: "fn: t_duration_microsecond", Start: ast.Position{ Column: 85, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 41, }, File: "microsecond_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 85, Line: 41, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 111, Line: 41, }, File: "microsecond_duration_test.flux", Source: "t_duration_microsecond", Start: ast.Position{ Column: 89, Line: 41, }, }, }, Name: "t_duration_microsecond", }, }}, 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: 113, Line: 41, }, File: "microsecond_duration_test.flux", Source: "test _duration_microsecond = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_microsecond})", 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: 4, }, File: "microsecond_duration_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: "microsecond_duration_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "microsecond_duration_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "microsecond_duration_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "microsecond_duration_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "microsecond_duration_test.flux", Source: "package date_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: 18, Line: 1, }, File: "microsecond_duration_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 109, Line: 59, }, File: "microsecond_time_test.flux", Source: "package date_test\n\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => 2030-01-01T00:00:00Z\n\ninData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,1\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,1\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,1\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,1\n,,1,2018-05-22T19:07:00.819823471Z,_m,QQ,1\n,,1,2018-05-22T19:08:00.587284314Z,_m,QQ,1\n,,1,2018-05-22T19:09:00.984375238Z,_m,QQ,1\n,,1,2018-05-22T19:10:00.723847562Z,_m,QQ,1\n,,1,2018-05-22T19:13:00.192983472Z,_m,QQ,1\n,,1,2018-05-22T19:15:00.712938413Z,_m,QQ,1\n,,1,2018-05-22T19:20:00.062103483Z,_m,QQ,1\n,,1,2018-05-22T19:23:00.786432256Z,_m,QQ,1\n,,1,2018-05-22T19:25:00.823748524Z,_m,QQ,1\n\"\noutData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,254819\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,748691\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,947182\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,538816\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,676423\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,982342\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:07:00.819823471Z,819823\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:08:00.587284314Z,587284\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:09:00.984375238Z,984375\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:10:00.723847562Z,723847\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:13:00.192983472Z,192983\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:15:00.712938413Z,712938\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:20:00.062103483Z,062103\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:23:00.786432256Z,786432\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:25:00.823748524Z,823748\n\"\nt_time_microsecond = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.microsecond(t: r._time)}))\n\ntest _time_microsecond = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_microsecond})", 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: 40, Line: 7, }, File: "microsecond_time_test.flux", Source: "now = () => 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: "microsecond_time_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: 40, Line: 7, }, File: "microsecond_time_test.flux", Source: "() => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "microsecond_time_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 20, Line: 7, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "microsecond_time_test.flux", Source: "option now = () => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 30, }, File: "microsecond_time_test.flux", Source: "inData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,1\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,1\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,1\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,1\n,,1,2018-05-22T19:07:00.819823471Z,_m,QQ,1\n,,1,2018-05-22T19:08:00.587284314Z,_m,QQ,1\n,,1,2018-05-22T19:09:00.984375238Z,_m,QQ,1\n,,1,2018-05-22T19:10:00.723847562Z,_m,QQ,1\n,,1,2018-05-22T19:13:00.192983472Z,_m,QQ,1\n,,1,2018-05-22T19:15:00.712938413Z,_m,QQ,1\n,,1,2018-05-22T19:20:00.062103483Z,_m,QQ,1\n,,1,2018-05-22T19:23:00.786432256Z,_m,QQ,1\n,,1,2018-05-22T19:25:00.823748524Z,_m,QQ,1\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: "microsecond_time_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: 30, }, File: "microsecond_time_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,1\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,1\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,1\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,1\n,,1,2018-05-22T19:07:00.819823471Z,_m,QQ,1\n,,1,2018-05-22T19:08:00.587284314Z,_m,QQ,1\n,,1,2018-05-22T19:09:00.984375238Z,_m,QQ,1\n,,1,2018-05-22T19:10:00.723847562Z,_m,QQ,1\n,,1,2018-05-22T19:13:00.192983472Z,_m,QQ,1\n,,1,2018-05-22T19:15:00.712938413Z,_m,QQ,1\n,,1,2018-05-22T19:20:00.062103483Z,_m,QQ,1\n,,1,2018-05-22T19:23:00.786432256Z,_m,QQ,1\n,,1,2018-05-22T19:25:00.823748524Z,_m,QQ,1\n\"", Start: ast.Position{ Column: 5, Line: 10, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,1\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,1\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,1\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,1\n,,1,2018-05-22T19:07:00.819823471Z,_m,QQ,1\n,,1,2018-05-22T19:08:00.587284314Z,_m,QQ,1\n,,1,2018-05-22T19:09:00.984375238Z,_m,QQ,1\n,,1,2018-05-22T19:10:00.723847562Z,_m,QQ,1\n,,1,2018-05-22T19:13:00.192983472Z,_m,QQ,1\n,,1,2018-05-22T19:15:00.712938413Z,_m,QQ,1\n,,1,2018-05-22T19:20:00.062103483Z,_m,QQ,1\n,,1,2018-05-22T19:23:00.786432256Z,_m,QQ,1\n,,1,2018-05-22T19:25:00.823748524Z,_m,QQ,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 52, }, File: "microsecond_time_test.flux", Source: "outData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,254819\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,748691\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,947182\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,538816\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,676423\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,982342\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:07:00.819823471Z,819823\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:08:00.587284314Z,587284\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:09:00.984375238Z,984375\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:10:00.723847562Z,723847\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:13:00.192983472Z,192983\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:15:00.712938413Z,712938\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:20:00.062103483Z,062103\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:23:00.786432256Z,786432\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:25:00.823748524Z,823748\n\"", Start: ast.Position{ Column: 1, Line: 31, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 31, }, File: "microsecond_time_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 31, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 52, }, File: "microsecond_time_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,254819\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,748691\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,947182\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,538816\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,676423\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,982342\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:07:00.819823471Z,819823\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:08:00.587284314Z,587284\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:09:00.984375238Z,984375\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:10:00.723847562Z,723847\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:13:00.192983472Z,192983\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:15:00.712938413Z,712938\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:20:00.062103483Z,062103\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:23:00.786432256Z,786432\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:25:00.823748524Z,823748\n\"", Start: ast.Position{ Column: 5, Line: 32, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,254819\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,748691\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,947182\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,538816\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,676423\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,982342\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:07:00.819823471Z,819823\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:08:00.587284314Z,587284\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:09:00.984375238Z,984375\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:10:00.723847562Z,723847\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:13:00.192983472Z,192983\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:15:00.712938413Z,712938\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:20:00.062103483Z,062103\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:23:00.786432256Z,786432\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:25:00.823748524Z,823748\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 56, }, File: "microsecond_time_test.flux", Source: "t_time_microsecond = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.microsecond(t: r._time)}))", Start: ast.Position{ Column: 1, Line: 53, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 53, }, File: "microsecond_time_test.flux", Source: "t_time_microsecond", Start: ast.Position{ Column: 1, Line: 53, }, }, }, Name: "t_time_microsecond", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 56, }, File: "microsecond_time_test.flux", Source: "(table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.microsecond(t: r._time)}))", Start: ast.Position{ Column: 22, Line: 53, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 54, }, File: "microsecond_time_test.flux", Source: "table", Start: ast.Position{ Column: 5, Line: 54, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 55, }, File: "microsecond_time_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 5, Line: 54, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 55, }, File: "microsecond_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 55, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 55, }, File: "microsecond_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 55, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 55, }, File: "microsecond_time_test.flux", Source: "start", Start: ast.Position{ Column: 18, Line: 55, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 55, }, File: "microsecond_time_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 25, Line: 55, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 55, }, File: "microsecond_time_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 12, Line: 55, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 55, }, File: "microsecond_time_test.flux", Source: "range", Start: ast.Position{ Column: 12, Line: 55, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 56, }, File: "microsecond_time_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.microsecond(t: r._time)}))", Start: ast.Position{ Column: 5, Line: 54, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 56, }, File: "microsecond_time_test.flux", Source: "fn: (r) => ({r with _value: date.microsecond(t: r._time)})", Start: ast.Position{ Column: 16, Line: 56, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 56, }, File: "microsecond_time_test.flux", Source: "fn: (r) => ({r with _value: date.microsecond(t: r._time)})", Start: ast.Position{ Column: 16, Line: 56, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 56, }, File: "microsecond_time_test.flux", Source: "fn", Start: ast.Position{ Column: 16, Line: 56, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 56, }, File: "microsecond_time_test.flux", Source: "(r) => ({r with _value: date.microsecond(t: r._time)})", Start: ast.Position{ Column: 20, Line: 56, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 56, }, File: "microsecond_time_test.flux", Source: "({r with _value: date.microsecond(t: r._time)})", Start: ast.Position{ Column: 27, Line: 56, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 56, }, File: "microsecond_time_test.flux", Source: "{r with _value: date.microsecond(t: r._time)}", Start: ast.Position{ Column: 28, Line: 56, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 56, }, File: "microsecond_time_test.flux", Source: "_value: date.microsecond(t: r._time)", Start: ast.Position{ Column: 36, Line: 56, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 56, }, File: "microsecond_time_test.flux", Source: "_value", Start: ast.Position{ Column: 36, Line: 56, }, }, }, 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: 71, Line: 56, }, File: "microsecond_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 61, Line: 56, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 56, }, File: "microsecond_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 61, Line: 56, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 56, }, File: "microsecond_time_test.flux", Source: "t", Start: ast.Position{ Column: 61, Line: 56, }, }, }, Name: "t", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 56, }, File: "microsecond_time_test.flux", Source: "r._time", Start: ast.Position{ Column: 64, Line: 56, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 56, }, File: "microsecond_time_test.flux", Source: "r", Start: ast.Position{ Column: 64, Line: 56, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 56, }, File: "microsecond_time_test.flux", Source: "_time", Start: ast.Position{ Column: 66, Line: 56, }, }, }, Name: "_time", }, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 56, }, File: "microsecond_time_test.flux", Source: "date.microsecond(t: r._time)", Start: ast.Position{ Column: 44, Line: 56, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 56, }, File: "microsecond_time_test.flux", Source: "date.microsecond", Start: ast.Position{ Column: 44, Line: 56, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 56, }, File: "microsecond_time_test.flux", Source: "date", Start: ast.Position{ Column: 44, Line: 56, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 56, }, File: "microsecond_time_test.flux", Source: "microsecond", Start: ast.Position{ Column: 49, Line: 56, }, }, }, Name: "microsecond", }, 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: 30, Line: 56, }, File: "microsecond_time_test.flux", Source: "r", Start: ast.Position{ Column: 29, Line: 56, }, }, }, 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: 22, Line: 56, }, File: "microsecond_time_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 56, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 56, }, File: "microsecond_time_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 56, }, }, }, 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: 75, Line: 56, }, File: "microsecond_time_test.flux", Source: "map(fn: (r) => ({r with _value: date.microsecond(t: r._time)}))", Start: ast.Position{ Column: 12, Line: 56, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 56, }, File: "microsecond_time_test.flux", Source: "map", Start: ast.Position{ Column: 12, Line: 56, }, }, }, 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: 31, Line: 53, }, File: "microsecond_time_test.flux", Source: "table=<-", Start: ast.Position{ Column: 23, Line: 53, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 53, }, File: "microsecond_time_test.flux", Source: "table", Start: ast.Position{ Column: 23, Line: 53, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 53, }, File: "microsecond_time_test.flux", Source: "<-", Start: ast.Position{ Column: 29, Line: 53, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 109, Line: 59, }, File: "microsecond_time_test.flux", Source: "_time_microsecond = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_microsecond})", Start: ast.Position{ Column: 6, Line: 58, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 58, }, File: "microsecond_time_test.flux", Source: "_time_microsecond", Start: ast.Position{ Column: 6, Line: 58, }, }, }, Name: "_time_microsecond", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 109, Line: 59, }, File: "microsecond_time_test.flux", Source: "() =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_microsecond})", Start: ast.Position{ Column: 26, Line: 58, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 109, Line: 59, }, File: "microsecond_time_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_microsecond})", Start: ast.Position{ Column: 5, Line: 59, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 59, }, File: "microsecond_time_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_microsecond}", Start: ast.Position{ Column: 6, Line: 59, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 59, }, File: "microsecond_time_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 7, Line: 59, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 59, }, File: "microsecond_time_test.flux", Source: "input", Start: ast.Position{ Column: 7, Line: 59, }, }, }, 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: 59, }, File: "microsecond_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 59, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 59, }, File: "microsecond_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 59, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 59, }, File: "microsecond_time_test.flux", Source: "csv", Start: ast.Position{ Column: 34, Line: 59, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 59, }, File: "microsecond_time_test.flux", Source: "inData", Start: ast.Position{ Column: 39, Line: 59, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 59, }, File: "microsecond_time_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 14, Line: 59, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 59, }, File: "microsecond_time_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 14, Line: 59, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 59, }, File: "microsecond_time_test.flux", Source: "testing", Start: ast.Position{ Column: 14, Line: 59, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 59, }, File: "microsecond_time_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 22, Line: 59, }, }, }, 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: 59, }, File: "microsecond_time_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 48, Line: 59, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 59, }, File: "microsecond_time_test.flux", Source: "want", Start: ast.Position{ Column: 48, Line: 59, }, }, }, 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: 59, }, File: "microsecond_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 59, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 59, }, File: "microsecond_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 59, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 59, }, File: "microsecond_time_test.flux", Source: "csv", Start: ast.Position{ Column: 70, Line: 59, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 59, }, File: "microsecond_time_test.flux", Source: "outData", Start: ast.Position{ Column: 75, Line: 59, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 59, }, File: "microsecond_time_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 54, Line: 59, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 59, }, File: "microsecond_time_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 54, Line: 59, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 59, }, File: "microsecond_time_test.flux", Source: "testing", Start: ast.Position{ Column: 54, Line: 59, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 59, }, File: "microsecond_time_test.flux", Source: "loadMem", Start: ast.Position{ Column: 62, Line: 59, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 59, }, File: "microsecond_time_test.flux", Source: "fn: t_time_microsecond", Start: ast.Position{ Column: 85, Line: 59, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 59, }, File: "microsecond_time_test.flux", Source: "fn", Start: ast.Position{ Column: 85, Line: 59, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 59, }, File: "microsecond_time_test.flux", Source: "t_time_microsecond", Start: ast.Position{ Column: 89, Line: 59, }, }, }, Name: "t_time_microsecond", }, }}, 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: 109, Line: 59, }, File: "microsecond_time_test.flux", Source: "test _time_microsecond = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_microsecond})", Start: ast.Position{ Column: 1, Line: 58, }, }, }, }}, 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: 4, }, File: "microsecond_time_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: "microsecond_time_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "microsecond_time_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "microsecond_time_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "microsecond_time_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "microsecond_time_test.flux", Source: "package date_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: 18, Line: 1, }, File: "microsecond_time_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 113, Line: 41, }, File: "millisecond_duration_test.flux", Source: "package date_test\n\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => 2030-01-01T00:00:00Z\n\ninData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"\noutData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n\"\nt_duration_millisecond = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.millisecond(t: duration(v: r._value))}))\n\ntest _duration_millisecond = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_millisecond})", 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: 40, Line: 7, }, File: "millisecond_duration_test.flux", Source: "now = () => 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: "millisecond_duration_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: 40, Line: 7, }, File: "millisecond_duration_test.flux", Source: "() => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "millisecond_duration_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 20, Line: 7, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "millisecond_duration_test.flux", Source: "option now = () => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 21, }, File: "millisecond_duration_test.flux", Source: "inData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\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: "millisecond_duration_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: 21, }, File: "millisecond_duration_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 5, Line: 10, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "millisecond_duration_test.flux", Source: "outData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n\"", Start: ast.Position{ Column: 1, Line: 22, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 22, }, File: "millisecond_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 22, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "millisecond_duration_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n\"", Start: ast.Position{ Column: 5, Line: 23, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 89, Line: 38, }, File: "millisecond_duration_test.flux", Source: "t_duration_millisecond = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.millisecond(t: duration(v: r._value))}))", Start: ast.Position{ Column: 1, Line: 35, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 35, }, File: "millisecond_duration_test.flux", Source: "t_duration_millisecond", Start: ast.Position{ Column: 1, Line: 35, }, }, }, Name: "t_duration_millisecond", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 89, Line: 38, }, File: "millisecond_duration_test.flux", Source: "(table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.millisecond(t: duration(v: r._value))}))", Start: ast.Position{ Column: 26, Line: 35, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 36, }, File: "millisecond_duration_test.flux", Source: "table", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 37, }, File: "millisecond_duration_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "millisecond_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "millisecond_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 37, }, File: "millisecond_duration_test.flux", Source: "start", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "millisecond_duration_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 25, Line: 37, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 37, }, File: "millisecond_duration_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 12, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 37, }, File: "millisecond_duration_test.flux", Source: "range", Start: ast.Position{ Column: 12, Line: 37, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 89, Line: 38, }, File: "millisecond_duration_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.millisecond(t: duration(v: r._value))}))", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 88, Line: 38, }, File: "millisecond_duration_test.flux", Source: "fn: (r) => ({r with _value: date.millisecond(t: duration(v: r._value))})", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 88, Line: 38, }, File: "millisecond_duration_test.flux", Source: "fn: (r) => ({r with _value: date.millisecond(t: duration(v: r._value))})", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 38, }, File: "millisecond_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 88, Line: 38, }, File: "millisecond_duration_test.flux", Source: "(r) => ({r with _value: date.millisecond(t: duration(v: r._value))})", Start: ast.Position{ Column: 20, Line: 38, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 88, Line: 38, }, File: "millisecond_duration_test.flux", Source: "({r with _value: date.millisecond(t: duration(v: r._value))})", Start: ast.Position{ Column: 27, Line: 38, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 38, }, File: "millisecond_duration_test.flux", Source: "{r with _value: date.millisecond(t: duration(v: r._value))}", Start: ast.Position{ Column: 28, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 86, Line: 38, }, File: "millisecond_duration_test.flux", Source: "_value: date.millisecond(t: duration(v: r._value))", Start: ast.Position{ Column: 36, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 38, }, File: "millisecond_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 36, 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: 85, Line: 38, }, File: "millisecond_duration_test.flux", Source: "t: duration(v: r._value)", Start: ast.Position{ Column: 61, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 85, Line: 38, }, File: "millisecond_duration_test.flux", Source: "t: duration(v: r._value)", Start: ast.Position{ Column: 61, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 38, }, File: "millisecond_duration_test.flux", Source: "t", Start: ast.Position{ Column: 61, Line: 38, }, }, }, Name: "t", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 38, }, File: "millisecond_duration_test.flux", Source: "v: r._value", Start: ast.Position{ Column: 73, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 38, }, File: "millisecond_duration_test.flux", Source: "v: r._value", Start: ast.Position{ Column: 73, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 38, }, File: "millisecond_duration_test.flux", Source: "v", Start: ast.Position{ Column: 73, Line: 38, }, }, }, Name: "v", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 38, }, File: "millisecond_duration_test.flux", Source: "r._value", Start: ast.Position{ Column: 76, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 38, }, File: "millisecond_duration_test.flux", Source: "r", Start: ast.Position{ Column: 76, Line: 38, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 38, }, File: "millisecond_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 78, Line: 38, }, }, }, Name: "_value", }, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 85, Line: 38, }, File: "millisecond_duration_test.flux", Source: "duration(v: r._value)", Start: ast.Position{ Column: 64, Line: 38, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 38, }, File: "millisecond_duration_test.flux", Source: "duration", Start: ast.Position{ Column: 64, Line: 38, }, }, }, Name: "duration", }, Lparen: nil, Rparen: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 86, Line: 38, }, File: "millisecond_duration_test.flux", Source: "date.millisecond(t: duration(v: r._value))", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 38, }, File: "millisecond_duration_test.flux", Source: "date.millisecond", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 38, }, File: "millisecond_duration_test.flux", Source: "date", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 38, }, File: "millisecond_duration_test.flux", Source: "millisecond", Start: ast.Position{ Column: 49, Line: 38, }, }, }, Name: "millisecond", }, 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: 30, Line: 38, }, File: "millisecond_duration_test.flux", Source: "r", Start: ast.Position{ Column: 29, 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: 22, Line: 38, }, File: "millisecond_duration_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 38, }, File: "millisecond_duration_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 38, }, }, }, 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: 89, Line: 38, }, File: "millisecond_duration_test.flux", Source: "map(fn: (r) => ({r with _value: date.millisecond(t: duration(v: r._value))}))", Start: ast.Position{ Column: 12, Line: 38, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 38, }, File: "millisecond_duration_test.flux", Source: "map", Start: ast.Position{ Column: 12, Line: 38, }, }, }, 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: 35, Line: 35, }, File: "millisecond_duration_test.flux", Source: "table=<-", Start: ast.Position{ Column: 27, Line: 35, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 32, Line: 35, }, File: "millisecond_duration_test.flux", Source: "table", Start: ast.Position{ Column: 27, Line: 35, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 35, }, File: "millisecond_duration_test.flux", Source: "<-", Start: ast.Position{ Column: 33, Line: 35, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 113, Line: 41, }, File: "millisecond_duration_test.flux", Source: "_duration_millisecond = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_millisecond})", Start: ast.Position{ Column: 6, Line: 40, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 40, }, File: "millisecond_duration_test.flux", Source: "_duration_millisecond", Start: ast.Position{ Column: 6, Line: 40, }, }, }, Name: "_duration_millisecond", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 113, Line: 41, }, File: "millisecond_duration_test.flux", Source: "() =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_millisecond})", Start: ast.Position{ Column: 30, Line: 40, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 113, Line: 41, }, File: "millisecond_duration_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_millisecond})", Start: ast.Position{ Column: 5, Line: 41, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 112, Line: 41, }, File: "millisecond_duration_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_millisecond}", Start: ast.Position{ Column: 6, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 41, }, File: "millisecond_duration_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 7, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 41, }, File: "millisecond_duration_test.flux", Source: "input", Start: ast.Position{ Column: 7, 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: 45, Line: 41, }, File: "millisecond_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 41, }, File: "millisecond_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 41, }, File: "millisecond_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 41, }, File: "millisecond_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 39, Line: 41, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 41, }, File: "millisecond_duration_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 41, }, File: "millisecond_duration_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 41, }, File: "millisecond_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 41, }, File: "millisecond_duration_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 22, 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: 83, Line: 41, }, File: "millisecond_duration_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 48, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 41, }, File: "millisecond_duration_test.flux", Source: "want", Start: ast.Position{ Column: 48, 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: 82, Line: 41, }, File: "millisecond_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 41, }, File: "millisecond_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 41, }, File: "millisecond_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 41, }, File: "millisecond_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 75, Line: 41, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 41, }, File: "millisecond_duration_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 41, }, File: "millisecond_duration_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 41, }, File: "millisecond_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 41, }, File: "millisecond_duration_test.flux", Source: "loadMem", Start: ast.Position{ Column: 62, 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: 111, Line: 41, }, File: "millisecond_duration_test.flux", Source: "fn: t_duration_millisecond", Start: ast.Position{ Column: 85, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 41, }, File: "millisecond_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 85, Line: 41, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 111, Line: 41, }, File: "millisecond_duration_test.flux", Source: "t_duration_millisecond", Start: ast.Position{ Column: 89, Line: 41, }, }, }, Name: "t_duration_millisecond", }, }}, 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: 113, Line: 41, }, File: "millisecond_duration_test.flux", Source: "test _duration_millisecond = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_millisecond})", 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: 4, }, File: "millisecond_duration_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: "millisecond_duration_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "millisecond_duration_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "millisecond_duration_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "millisecond_duration_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "millisecond_duration_test.flux", Source: "package date_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: 18, Line: 1, }, File: "millisecond_duration_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 109, Line: 59, }, File: "millisecond_test.flux", Source: "package date_test\n\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => 2030-01-01T00:00:00Z\n\ninData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,1\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,1\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,1\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,1\n,,1,2018-05-22T19:07:00.819823471Z,_m,QQ,1\n,,1,2018-05-22T19:08:00.587284314Z,_m,QQ,1\n,,1,2018-05-22T19:09:00.984375238Z,_m,QQ,1\n,,1,2018-05-22T19:10:00.723847562Z,_m,QQ,1\n,,1,2018-05-22T19:13:00.192983472Z,_m,QQ,1\n,,1,2018-05-22T19:15:00.712938413Z,_m,QQ,1\n,,1,2018-05-22T19:20:00.062103483Z,_m,QQ,1\n,,1,2018-05-22T19:23:00.786432256Z,_m,QQ,1\n,,1,2018-05-22T19:25:00.823748524Z,_m,QQ,1\n\"\noutData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,254\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,748\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,947\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,538\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,676\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,982\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:07:00.819823471Z,819\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:08:00.587284314Z,587\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:09:00.984375238Z,984\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:10:00.723847562Z,723\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:13:00.192983472Z,192\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:15:00.712938413Z,712\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:20:00.062103483Z,062\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:23:00.786432256Z,786\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:25:00.823748524Z,823\n\"\nt_time_millisecond = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.millisecond(t: r._time)}))\n\ntest _time_millisecond = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_millisecond})", 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: 40, Line: 7, }, File: "millisecond_test.flux", Source: "now = () => 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: "millisecond_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: 40, Line: 7, }, File: "millisecond_test.flux", Source: "() => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "millisecond_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 20, Line: 7, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "millisecond_test.flux", Source: "option now = () => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 30, }, File: "millisecond_test.flux", Source: "inData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,1\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,1\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,1\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,1\n,,1,2018-05-22T19:07:00.819823471Z,_m,QQ,1\n,,1,2018-05-22T19:08:00.587284314Z,_m,QQ,1\n,,1,2018-05-22T19:09:00.984375238Z,_m,QQ,1\n,,1,2018-05-22T19:10:00.723847562Z,_m,QQ,1\n,,1,2018-05-22T19:13:00.192983472Z,_m,QQ,1\n,,1,2018-05-22T19:15:00.712938413Z,_m,QQ,1\n,,1,2018-05-22T19:20:00.062103483Z,_m,QQ,1\n,,1,2018-05-22T19:23:00.786432256Z,_m,QQ,1\n,,1,2018-05-22T19:25:00.823748524Z,_m,QQ,1\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: "millisecond_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: 30, }, File: "millisecond_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,1\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,1\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,1\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,1\n,,1,2018-05-22T19:07:00.819823471Z,_m,QQ,1\n,,1,2018-05-22T19:08:00.587284314Z,_m,QQ,1\n,,1,2018-05-22T19:09:00.984375238Z,_m,QQ,1\n,,1,2018-05-22T19:10:00.723847562Z,_m,QQ,1\n,,1,2018-05-22T19:13:00.192983472Z,_m,QQ,1\n,,1,2018-05-22T19:15:00.712938413Z,_m,QQ,1\n,,1,2018-05-22T19:20:00.062103483Z,_m,QQ,1\n,,1,2018-05-22T19:23:00.786432256Z,_m,QQ,1\n,,1,2018-05-22T19:25:00.823748524Z,_m,QQ,1\n\"", Start: ast.Position{ Column: 5, Line: 10, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,1\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,1\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,1\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,1\n,,1,2018-05-22T19:07:00.819823471Z,_m,QQ,1\n,,1,2018-05-22T19:08:00.587284314Z,_m,QQ,1\n,,1,2018-05-22T19:09:00.984375238Z,_m,QQ,1\n,,1,2018-05-22T19:10:00.723847562Z,_m,QQ,1\n,,1,2018-05-22T19:13:00.192983472Z,_m,QQ,1\n,,1,2018-05-22T19:15:00.712938413Z,_m,QQ,1\n,,1,2018-05-22T19:20:00.062103483Z,_m,QQ,1\n,,1,2018-05-22T19:23:00.786432256Z,_m,QQ,1\n,,1,2018-05-22T19:25:00.823748524Z,_m,QQ,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 52, }, File: "millisecond_test.flux", Source: "outData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,254\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,748\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,947\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,538\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,676\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,982\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:07:00.819823471Z,819\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:08:00.587284314Z,587\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:09:00.984375238Z,984\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:10:00.723847562Z,723\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:13:00.192983472Z,192\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:15:00.712938413Z,712\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:20:00.062103483Z,062\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:23:00.786432256Z,786\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:25:00.823748524Z,823\n\"", Start: ast.Position{ Column: 1, Line: 31, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 31, }, File: "millisecond_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 31, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 52, }, File: "millisecond_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,254\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,748\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,947\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,538\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,676\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,982\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:07:00.819823471Z,819\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:08:00.587284314Z,587\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:09:00.984375238Z,984\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:10:00.723847562Z,723\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:13:00.192983472Z,192\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:15:00.712938413Z,712\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:20:00.062103483Z,062\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:23:00.786432256Z,786\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:25:00.823748524Z,823\n\"", Start: ast.Position{ Column: 5, Line: 32, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,254\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,748\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,947\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,538\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,676\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,982\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:07:00.819823471Z,819\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:08:00.587284314Z,587\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:09:00.984375238Z,984\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:10:00.723847562Z,723\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:13:00.192983472Z,192\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:15:00.712938413Z,712\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:20:00.062103483Z,062\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:23:00.786432256Z,786\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:25:00.823748524Z,823\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 56, }, File: "millisecond_test.flux", Source: "t_time_millisecond = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.millisecond(t: r._time)}))", Start: ast.Position{ Column: 1, Line: 53, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 53, }, File: "millisecond_test.flux", Source: "t_time_millisecond", Start: ast.Position{ Column: 1, Line: 53, }, }, }, Name: "t_time_millisecond", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 56, }, File: "millisecond_test.flux", Source: "(table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.millisecond(t: r._time)}))", Start: ast.Position{ Column: 22, Line: 53, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 54, }, File: "millisecond_test.flux", Source: "table", Start: ast.Position{ Column: 5, Line: 54, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 55, }, File: "millisecond_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 5, Line: 54, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 55, }, File: "millisecond_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 55, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 55, }, File: "millisecond_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 55, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 55, }, File: "millisecond_test.flux", Source: "start", Start: ast.Position{ Column: 18, Line: 55, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 55, }, File: "millisecond_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 25, Line: 55, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 55, }, File: "millisecond_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 12, Line: 55, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 55, }, File: "millisecond_test.flux", Source: "range", Start: ast.Position{ Column: 12, Line: 55, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 75, Line: 56, }, File: "millisecond_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.millisecond(t: r._time)}))", Start: ast.Position{ Column: 5, Line: 54, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 56, }, File: "millisecond_test.flux", Source: "fn: (r) => ({r with _value: date.millisecond(t: r._time)})", Start: ast.Position{ Column: 16, Line: 56, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 56, }, File: "millisecond_test.flux", Source: "fn: (r) => ({r with _value: date.millisecond(t: r._time)})", Start: ast.Position{ Column: 16, Line: 56, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 56, }, File: "millisecond_test.flux", Source: "fn", Start: ast.Position{ Column: 16, Line: 56, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 56, }, File: "millisecond_test.flux", Source: "(r) => ({r with _value: date.millisecond(t: r._time)})", Start: ast.Position{ Column: 20, Line: 56, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 56, }, File: "millisecond_test.flux", Source: "({r with _value: date.millisecond(t: r._time)})", Start: ast.Position{ Column: 27, Line: 56, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 56, }, File: "millisecond_test.flux", Source: "{r with _value: date.millisecond(t: r._time)}", Start: ast.Position{ Column: 28, Line: 56, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 56, }, File: "millisecond_test.flux", Source: "_value: date.millisecond(t: r._time)", Start: ast.Position{ Column: 36, Line: 56, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 56, }, File: "millisecond_test.flux", Source: "_value", Start: ast.Position{ Column: 36, Line: 56, }, }, }, 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: 71, Line: 56, }, File: "millisecond_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 61, Line: 56, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 56, }, File: "millisecond_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 61, Line: 56, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 56, }, File: "millisecond_test.flux", Source: "t", Start: ast.Position{ Column: 61, Line: 56, }, }, }, Name: "t", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 56, }, File: "millisecond_test.flux", Source: "r._time", Start: ast.Position{ Column: 64, Line: 56, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 56, }, File: "millisecond_test.flux", Source: "r", Start: ast.Position{ Column: 64, Line: 56, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 56, }, File: "millisecond_test.flux", Source: "_time", Start: ast.Position{ Column: 66, Line: 56, }, }, }, Name: "_time", }, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 56, }, File: "millisecond_test.flux", Source: "date.millisecond(t: r._time)", Start: ast.Position{ Column: 44, Line: 56, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 56, }, File: "millisecond_test.flux", Source: "date.millisecond", Start: ast.Position{ Column: 44, Line: 56, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 56, }, File: "millisecond_test.flux", Source: "date", Start: ast.Position{ Column: 44, Line: 56, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 56, }, File: "millisecond_test.flux", Source: "millisecond", Start: ast.Position{ Column: 49, Line: 56, }, }, }, Name: "millisecond", }, 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: 30, Line: 56, }, File: "millisecond_test.flux", Source: "r", Start: ast.Position{ Column: 29, Line: 56, }, }, }, 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: 22, Line: 56, }, File: "millisecond_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 56, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 56, }, File: "millisecond_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 56, }, }, }, 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: 75, Line: 56, }, File: "millisecond_test.flux", Source: "map(fn: (r) => ({r with _value: date.millisecond(t: r._time)}))", Start: ast.Position{ Column: 12, Line: 56, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 56, }, File: "millisecond_test.flux", Source: "map", Start: ast.Position{ Column: 12, Line: 56, }, }, }, 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: 31, Line: 53, }, File: "millisecond_test.flux", Source: "table=<-", Start: ast.Position{ Column: 23, Line: 53, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 53, }, File: "millisecond_test.flux", Source: "table", Start: ast.Position{ Column: 23, Line: 53, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 53, }, File: "millisecond_test.flux", Source: "<-", Start: ast.Position{ Column: 29, Line: 53, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 109, Line: 59, }, File: "millisecond_test.flux", Source: "_time_millisecond = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_millisecond})", Start: ast.Position{ Column: 6, Line: 58, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 58, }, File: "millisecond_test.flux", Source: "_time_millisecond", Start: ast.Position{ Column: 6, Line: 58, }, }, }, Name: "_time_millisecond", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 109, Line: 59, }, File: "millisecond_test.flux", Source: "() =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_millisecond})", Start: ast.Position{ Column: 26, Line: 58, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 109, Line: 59, }, File: "millisecond_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_millisecond})", Start: ast.Position{ Column: 5, Line: 59, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 59, }, File: "millisecond_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_millisecond}", Start: ast.Position{ Column: 6, Line: 59, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 59, }, File: "millisecond_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 7, Line: 59, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 59, }, File: "millisecond_test.flux", Source: "input", Start: ast.Position{ Column: 7, Line: 59, }, }, }, 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: 59, }, File: "millisecond_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 59, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 59, }, File: "millisecond_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 59, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 59, }, File: "millisecond_test.flux", Source: "csv", Start: ast.Position{ Column: 34, Line: 59, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 59, }, File: "millisecond_test.flux", Source: "inData", Start: ast.Position{ Column: 39, Line: 59, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 59, }, File: "millisecond_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 14, Line: 59, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 59, }, File: "millisecond_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 14, Line: 59, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 59, }, File: "millisecond_test.flux", Source: "testing", Start: ast.Position{ Column: 14, Line: 59, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 59, }, File: "millisecond_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 22, Line: 59, }, }, }, 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: 59, }, File: "millisecond_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 48, Line: 59, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 59, }, File: "millisecond_test.flux", Source: "want", Start: ast.Position{ Column: 48, Line: 59, }, }, }, 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: 59, }, File: "millisecond_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 59, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 59, }, File: "millisecond_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 59, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 59, }, File: "millisecond_test.flux", Source: "csv", Start: ast.Position{ Column: 70, Line: 59, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 59, }, File: "millisecond_test.flux", Source: "outData", Start: ast.Position{ Column: 75, Line: 59, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 59, }, File: "millisecond_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 54, Line: 59, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 59, }, File: "millisecond_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 54, Line: 59, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 59, }, File: "millisecond_test.flux", Source: "testing", Start: ast.Position{ Column: 54, Line: 59, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 59, }, File: "millisecond_test.flux", Source: "loadMem", Start: ast.Position{ Column: 62, Line: 59, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 59, }, File: "millisecond_test.flux", Source: "fn: t_time_millisecond", Start: ast.Position{ Column: 85, Line: 59, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 59, }, File: "millisecond_test.flux", Source: "fn", Start: ast.Position{ Column: 85, Line: 59, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 59, }, File: "millisecond_test.flux", Source: "t_time_millisecond", Start: ast.Position{ Column: 89, Line: 59, }, }, }, Name: "t_time_millisecond", }, }}, 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: 109, Line: 59, }, File: "millisecond_test.flux", Source: "test _time_millisecond = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_millisecond})", Start: ast.Position{ Column: 1, Line: 58, }, }, }, }}, 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: 4, }, File: "millisecond_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: "millisecond_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "millisecond_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "millisecond_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "millisecond_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "millisecond_test.flux", Source: "package date_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: 18, Line: 1, }, File: "millisecond_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 41, }, File: "minute_duration_test.flux", Source: "package date_test\n\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => 2030-01-01T00:00:00Z\n\ninData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"\noutData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n\"\nt_duration_minute = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.minute(t: duration(v: r._value))}))\n\ntest _duration_minute = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_minute})", 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: 40, Line: 7, }, File: "minute_duration_test.flux", Source: "now = () => 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: "minute_duration_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: 40, Line: 7, }, File: "minute_duration_test.flux", Source: "() => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "minute_duration_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 20, Line: 7, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "minute_duration_test.flux", Source: "option now = () => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 21, }, File: "minute_duration_test.flux", Source: "inData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\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: "minute_duration_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: 21, }, File: "minute_duration_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 5, Line: 10, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "minute_duration_test.flux", Source: "outData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n\"", Start: ast.Position{ Column: 1, Line: 22, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 22, }, File: "minute_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 22, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "minute_duration_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n\"", Start: ast.Position{ Column: 5, Line: 23, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 38, }, File: "minute_duration_test.flux", Source: "t_duration_minute = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.minute(t: duration(v: r._value))}))", Start: ast.Position{ Column: 1, Line: 35, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 35, }, File: "minute_duration_test.flux", Source: "t_duration_minute", Start: ast.Position{ Column: 1, Line: 35, }, }, }, Name: "t_duration_minute", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 38, }, File: "minute_duration_test.flux", Source: "(table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.minute(t: duration(v: r._value))}))", Start: ast.Position{ Column: 21, Line: 35, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 36, }, File: "minute_duration_test.flux", Source: "table", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 37, }, File: "minute_duration_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "minute_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "minute_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 37, }, File: "minute_duration_test.flux", Source: "start", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "minute_duration_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 25, Line: 37, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 37, }, File: "minute_duration_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 12, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 37, }, File: "minute_duration_test.flux", Source: "range", Start: ast.Position{ Column: 12, Line: 37, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 38, }, File: "minute_duration_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.minute(t: duration(v: r._value))}))", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 38, }, File: "minute_duration_test.flux", Source: "fn: (r) => ({r with _value: date.minute(t: duration(v: r._value))})", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 38, }, File: "minute_duration_test.flux", Source: "fn: (r) => ({r with _value: date.minute(t: duration(v: r._value))})", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 38, }, File: "minute_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 38, }, File: "minute_duration_test.flux", Source: "(r) => ({r with _value: date.minute(t: duration(v: r._value))})", Start: ast.Position{ Column: 20, Line: 38, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 38, }, File: "minute_duration_test.flux", Source: "({r with _value: date.minute(t: duration(v: r._value))})", Start: ast.Position{ Column: 27, Line: 38, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 38, }, File: "minute_duration_test.flux", Source: "{r with _value: date.minute(t: duration(v: r._value))}", Start: ast.Position{ Column: 28, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 38, }, File: "minute_duration_test.flux", Source: "_value: date.minute(t: duration(v: r._value))", Start: ast.Position{ Column: 36, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 38, }, File: "minute_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 36, 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: 80, Line: 38, }, File: "minute_duration_test.flux", Source: "t: duration(v: r._value)", Start: ast.Position{ Column: 56, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 38, }, File: "minute_duration_test.flux", Source: "t: duration(v: r._value)", Start: ast.Position{ Column: 56, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 57, Line: 38, }, File: "minute_duration_test.flux", Source: "t", Start: ast.Position{ Column: 56, Line: 38, }, }, }, Name: "t", }, 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: 38, }, File: "minute_duration_test.flux", Source: "v: r._value", Start: ast.Position{ Column: 68, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 38, }, File: "minute_duration_test.flux", Source: "v: r._value", Start: ast.Position{ Column: 68, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 38, }, File: "minute_duration_test.flux", Source: "v", Start: ast.Position{ Column: 68, Line: 38, }, }, }, Name: "v", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 38, }, File: "minute_duration_test.flux", Source: "r._value", Start: ast.Position{ Column: 71, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 38, }, File: "minute_duration_test.flux", Source: "r", Start: ast.Position{ Column: 71, Line: 38, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 38, }, File: "minute_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 73, Line: 38, }, }, }, Name: "_value", }, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 38, }, File: "minute_duration_test.flux", Source: "duration(v: r._value)", Start: ast.Position{ Column: 59, Line: 38, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 38, }, File: "minute_duration_test.flux", Source: "duration", Start: ast.Position{ Column: 59, Line: 38, }, }, }, Name: "duration", }, Lparen: nil, Rparen: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 38, }, File: "minute_duration_test.flux", Source: "date.minute(t: duration(v: r._value))", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 55, Line: 38, }, File: "minute_duration_test.flux", Source: "date.minute", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 38, }, File: "minute_duration_test.flux", Source: "date", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 55, Line: 38, }, File: "minute_duration_test.flux", Source: "minute", Start: ast.Position{ Column: 49, Line: 38, }, }, }, Name: "minute", }, 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: 30, Line: 38, }, File: "minute_duration_test.flux", Source: "r", Start: ast.Position{ Column: 29, 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: 22, Line: 38, }, File: "minute_duration_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 38, }, File: "minute_duration_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 38, }, }, }, 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: 84, Line: 38, }, File: "minute_duration_test.flux", Source: "map(fn: (r) => ({r with _value: date.minute(t: duration(v: r._value))}))", Start: ast.Position{ Column: 12, Line: 38, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 38, }, File: "minute_duration_test.flux", Source: "map", Start: ast.Position{ Column: 12, Line: 38, }, }, }, 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: 30, Line: 35, }, File: "minute_duration_test.flux", Source: "table=<-", Start: ast.Position{ Column: 22, Line: 35, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 35, }, File: "minute_duration_test.flux", Source: "table", Start: ast.Position{ Column: 22, Line: 35, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 35, }, File: "minute_duration_test.flux", Source: "<-", Start: ast.Position{ Column: 28, Line: 35, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 41, }, File: "minute_duration_test.flux", Source: "_duration_minute = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_minute})", Start: ast.Position{ Column: 6, Line: 40, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 40, }, File: "minute_duration_test.flux", Source: "_duration_minute", Start: ast.Position{ Column: 6, Line: 40, }, }, }, Name: "_duration_minute", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 41, }, File: "minute_duration_test.flux", Source: "() =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_minute})", Start: ast.Position{ Column: 25, Line: 40, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 41, }, File: "minute_duration_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_minute})", Start: ast.Position{ Column: 5, Line: 41, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 41, }, File: "minute_duration_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_minute}", Start: ast.Position{ Column: 6, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 41, }, File: "minute_duration_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 7, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 41, }, File: "minute_duration_test.flux", Source: "input", Start: ast.Position{ Column: 7, 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: 45, Line: 41, }, File: "minute_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 41, }, File: "minute_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 41, }, File: "minute_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 41, }, File: "minute_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 39, Line: 41, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 41, }, File: "minute_duration_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 41, }, File: "minute_duration_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 41, }, File: "minute_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 41, }, File: "minute_duration_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 22, 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: 83, Line: 41, }, File: "minute_duration_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 48, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 41, }, File: "minute_duration_test.flux", Source: "want", Start: ast.Position{ Column: 48, 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: 82, Line: 41, }, File: "minute_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 41, }, File: "minute_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 41, }, File: "minute_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 41, }, File: "minute_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 75, Line: 41, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 41, }, File: "minute_duration_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 41, }, File: "minute_duration_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 41, }, File: "minute_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 41, }, File: "minute_duration_test.flux", Source: "loadMem", Start: ast.Position{ Column: 62, 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: 106, Line: 41, }, File: "minute_duration_test.flux", Source: "fn: t_duration_minute", Start: ast.Position{ Column: 85, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 41, }, File: "minute_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 85, Line: 41, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 41, }, File: "minute_duration_test.flux", Source: "t_duration_minute", Start: ast.Position{ Column: 89, Line: 41, }, }, }, Name: "t_duration_minute", }, }}, 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: 41, }, File: "minute_duration_test.flux", Source: "test _duration_minute = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_minute})", 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: 4, }, File: "minute_duration_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: "minute_duration_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "minute_duration_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "minute_duration_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "minute_duration_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "minute_duration_test.flux", Source: "package date_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: 18, Line: 1, }, File: "minute_duration_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 73, }, File: "minute_time_test.flux", Source: "package date_test\n\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => 2030-01-01T00:00:00Z\n\ninData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00Z,_m,FF,1\n,,0,2018-05-22T19:02:00Z,_m,FF,1\n,,0,2018-05-22T19:03:00Z,_m,FF,1\n,,0,2018-05-22T19:04:00Z,_m,FF,1\n,,0,2018-05-22T19:05:00Z,_m,FF,1\n,,0,2018-05-22T19:06:00Z,_m,FF,1\n,,1,2018-05-22T19:07:00Z,_m,QQ,1\n,,1,2018-05-22T19:08:00Z,_m,QQ,1\n,,1,2018-05-22T19:09:00Z,_m,QQ,1\n,,1,2018-05-22T19:10:00Z,_m,QQ,1\n,,1,2018-05-22T19:13:00Z,_m,QQ,1\n,,1,2018-05-22T19:15:00Z,_m,QQ,1\n,,1,2018-05-22T19:20:00Z,_m,QQ,1\n,,1,2018-05-22T19:23:00Z,_m,QQ,1\n,,1,2018-05-22T19:25:00Z,_m,QQ,1\n,,2,2018-05-22T19:28:00Z,_m,RR,1\n,,2,2018-05-22T19:36:00Z,_m,RR,1\n,,2,2018-05-22T19:38:00Z,_m,RR,1\n,,2,2018-05-22T19:47:00Z,_m,RR,1\n,,3,2018-05-22T19:48:00Z,_m,SR,1\n,,3,2018-05-22T19:59:00Z,_m,SR,1\n,,3,2018-05-22T20:00:00Z,_m,SR,1\n\"\noutData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00Z,5\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:07:00Z,7\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:08:00Z,8\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:09:00Z,9\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:10:00Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:13:00Z,13\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:15:00Z,15\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:20:00Z,20\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:23:00Z,23\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:25:00Z,25\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:28:00Z,28\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:36:00Z,36\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:38:00Z,38\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:47:00Z,47\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:48:00Z,48\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:59:00Z,59\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T20:00:00Z,00\n\"\nt_time_minute = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.minute(t: r._time)}))\n\ntest _time_minute = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_minute})", 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: 40, Line: 7, }, File: "minute_time_test.flux", Source: "now = () => 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: "minute_time_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: 40, Line: 7, }, File: "minute_time_test.flux", Source: "() => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "minute_time_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 20, Line: 7, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "minute_time_test.flux", Source: "option now = () => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 37, }, File: "minute_time_test.flux", Source: "inData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00Z,_m,FF,1\n,,0,2018-05-22T19:02:00Z,_m,FF,1\n,,0,2018-05-22T19:03:00Z,_m,FF,1\n,,0,2018-05-22T19:04:00Z,_m,FF,1\n,,0,2018-05-22T19:05:00Z,_m,FF,1\n,,0,2018-05-22T19:06:00Z,_m,FF,1\n,,1,2018-05-22T19:07:00Z,_m,QQ,1\n,,1,2018-05-22T19:08:00Z,_m,QQ,1\n,,1,2018-05-22T19:09:00Z,_m,QQ,1\n,,1,2018-05-22T19:10:00Z,_m,QQ,1\n,,1,2018-05-22T19:13:00Z,_m,QQ,1\n,,1,2018-05-22T19:15:00Z,_m,QQ,1\n,,1,2018-05-22T19:20:00Z,_m,QQ,1\n,,1,2018-05-22T19:23:00Z,_m,QQ,1\n,,1,2018-05-22T19:25:00Z,_m,QQ,1\n,,2,2018-05-22T19:28:00Z,_m,RR,1\n,,2,2018-05-22T19:36:00Z,_m,RR,1\n,,2,2018-05-22T19:38:00Z,_m,RR,1\n,,2,2018-05-22T19:47:00Z,_m,RR,1\n,,3,2018-05-22T19:48:00Z,_m,SR,1\n,,3,2018-05-22T19:59:00Z,_m,SR,1\n,,3,2018-05-22T20:00:00Z,_m,SR,1\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: "minute_time_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: 37, }, File: "minute_time_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00Z,_m,FF,1\n,,0,2018-05-22T19:02:00Z,_m,FF,1\n,,0,2018-05-22T19:03:00Z,_m,FF,1\n,,0,2018-05-22T19:04:00Z,_m,FF,1\n,,0,2018-05-22T19:05:00Z,_m,FF,1\n,,0,2018-05-22T19:06:00Z,_m,FF,1\n,,1,2018-05-22T19:07:00Z,_m,QQ,1\n,,1,2018-05-22T19:08:00Z,_m,QQ,1\n,,1,2018-05-22T19:09:00Z,_m,QQ,1\n,,1,2018-05-22T19:10:00Z,_m,QQ,1\n,,1,2018-05-22T19:13:00Z,_m,QQ,1\n,,1,2018-05-22T19:15:00Z,_m,QQ,1\n,,1,2018-05-22T19:20:00Z,_m,QQ,1\n,,1,2018-05-22T19:23:00Z,_m,QQ,1\n,,1,2018-05-22T19:25:00Z,_m,QQ,1\n,,2,2018-05-22T19:28:00Z,_m,RR,1\n,,2,2018-05-22T19:36:00Z,_m,RR,1\n,,2,2018-05-22T19:38:00Z,_m,RR,1\n,,2,2018-05-22T19:47:00Z,_m,RR,1\n,,3,2018-05-22T19:48:00Z,_m,SR,1\n,,3,2018-05-22T19:59:00Z,_m,SR,1\n,,3,2018-05-22T20:00:00Z,_m,SR,1\n\"", Start: ast.Position{ Column: 5, Line: 10, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00Z,_m,FF,1\n,,0,2018-05-22T19:02:00Z,_m,FF,1\n,,0,2018-05-22T19:03:00Z,_m,FF,1\n,,0,2018-05-22T19:04:00Z,_m,FF,1\n,,0,2018-05-22T19:05:00Z,_m,FF,1\n,,0,2018-05-22T19:06:00Z,_m,FF,1\n,,1,2018-05-22T19:07:00Z,_m,QQ,1\n,,1,2018-05-22T19:08:00Z,_m,QQ,1\n,,1,2018-05-22T19:09:00Z,_m,QQ,1\n,,1,2018-05-22T19:10:00Z,_m,QQ,1\n,,1,2018-05-22T19:13:00Z,_m,QQ,1\n,,1,2018-05-22T19:15:00Z,_m,QQ,1\n,,1,2018-05-22T19:20:00Z,_m,QQ,1\n,,1,2018-05-22T19:23:00Z,_m,QQ,1\n,,1,2018-05-22T19:25:00Z,_m,QQ,1\n,,2,2018-05-22T19:28:00Z,_m,RR,1\n,,2,2018-05-22T19:36:00Z,_m,RR,1\n,,2,2018-05-22T19:38:00Z,_m,RR,1\n,,2,2018-05-22T19:47:00Z,_m,RR,1\n,,3,2018-05-22T19:48:00Z,_m,SR,1\n,,3,2018-05-22T19:59:00Z,_m,SR,1\n,,3,2018-05-22T20:00:00Z,_m,SR,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 66, }, File: "minute_time_test.flux", Source: "outData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00Z,5\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:07:00Z,7\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:08:00Z,8\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:09:00Z,9\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:10:00Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:13:00Z,13\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:15:00Z,15\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:20:00Z,20\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:23:00Z,23\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:25:00Z,25\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:28:00Z,28\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:36:00Z,36\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:38:00Z,38\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:47:00Z,47\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:48:00Z,48\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:59:00Z,59\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T20:00:00Z,00\n\"", Start: ast.Position{ Column: 1, Line: 38, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 38, }, File: "minute_time_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 38, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 66, }, File: "minute_time_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00Z,5\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:07:00Z,7\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:08:00Z,8\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:09:00Z,9\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:10:00Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:13:00Z,13\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:15:00Z,15\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:20:00Z,20\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:23:00Z,23\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:25:00Z,25\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:28:00Z,28\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:36:00Z,36\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:38:00Z,38\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:47:00Z,47\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:48:00Z,48\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:59:00Z,59\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T20:00:00Z,00\n\"", Start: ast.Position{ Column: 5, Line: 39, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00Z,5\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:07:00Z,7\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:08:00Z,8\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:09:00Z,9\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:10:00Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:13:00Z,13\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:15:00Z,15\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:20:00Z,20\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:23:00Z,23\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:25:00Z,25\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:28:00Z,28\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:36:00Z,36\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:38:00Z,38\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:47:00Z,47\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:48:00Z,48\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:59:00Z,59\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T20:00:00Z,00\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 70, }, File: "minute_time_test.flux", Source: "t_time_minute = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.minute(t: r._time)}))", Start: ast.Position{ Column: 1, Line: 67, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 67, }, File: "minute_time_test.flux", Source: "t_time_minute", Start: ast.Position{ Column: 1, Line: 67, }, }, }, Name: "t_time_minute", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 70, }, File: "minute_time_test.flux", Source: "(table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.minute(t: r._time)}))", Start: ast.Position{ Column: 17, Line: 67, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 68, }, File: "minute_time_test.flux", Source: "table", Start: ast.Position{ Column: 5, Line: 68, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 69, }, File: "minute_time_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 5, Line: 68, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 69, }, File: "minute_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 69, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 69, }, File: "minute_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 69, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 69, }, File: "minute_time_test.flux", Source: "start", Start: ast.Position{ Column: 18, Line: 69, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 69, }, File: "minute_time_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 25, Line: 69, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 69, }, File: "minute_time_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 12, Line: 69, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 69, }, File: "minute_time_test.flux", Source: "range", Start: ast.Position{ Column: 12, Line: 69, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 70, }, File: "minute_time_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.minute(t: r._time)}))", Start: ast.Position{ Column: 5, Line: 68, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 70, }, File: "minute_time_test.flux", Source: "fn: (r) => ({r with _value: date.minute(t: r._time)})", Start: ast.Position{ Column: 16, Line: 70, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 70, }, File: "minute_time_test.flux", Source: "fn: (r) => ({r with _value: date.minute(t: r._time)})", Start: ast.Position{ Column: 16, Line: 70, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 70, }, File: "minute_time_test.flux", Source: "fn", Start: ast.Position{ Column: 16, Line: 70, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 70, }, File: "minute_time_test.flux", Source: "(r) => ({r with _value: date.minute(t: r._time)})", Start: ast.Position{ Column: 20, Line: 70, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 70, }, File: "minute_time_test.flux", Source: "({r with _value: date.minute(t: r._time)})", Start: ast.Position{ Column: 27, Line: 70, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 70, }, File: "minute_time_test.flux", Source: "{r with _value: date.minute(t: r._time)}", Start: ast.Position{ Column: 28, Line: 70, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 70, }, File: "minute_time_test.flux", Source: "_value: date.minute(t: r._time)", Start: ast.Position{ Column: 36, Line: 70, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 70, }, File: "minute_time_test.flux", Source: "_value", Start: ast.Position{ Column: 36, Line: 70, }, }, }, 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: 66, Line: 70, }, File: "minute_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 56, Line: 70, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 70, }, File: "minute_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 56, Line: 70, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 57, Line: 70, }, File: "minute_time_test.flux", Source: "t", Start: ast.Position{ Column: 56, Line: 70, }, }, }, Name: "t", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 70, }, File: "minute_time_test.flux", Source: "r._time", Start: ast.Position{ Column: 59, Line: 70, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 70, }, File: "minute_time_test.flux", Source: "r", Start: ast.Position{ Column: 59, Line: 70, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 70, }, File: "minute_time_test.flux", Source: "_time", Start: ast.Position{ Column: 61, Line: 70, }, }, }, Name: "_time", }, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 70, }, File: "minute_time_test.flux", Source: "date.minute(t: r._time)", Start: ast.Position{ Column: 44, Line: 70, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 55, Line: 70, }, File: "minute_time_test.flux", Source: "date.minute", Start: ast.Position{ Column: 44, Line: 70, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 70, }, File: "minute_time_test.flux", Source: "date", Start: ast.Position{ Column: 44, Line: 70, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 55, Line: 70, }, File: "minute_time_test.flux", Source: "minute", Start: ast.Position{ Column: 49, Line: 70, }, }, }, Name: "minute", }, 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: 30, Line: 70, }, File: "minute_time_test.flux", Source: "r", Start: ast.Position{ Column: 29, Line: 70, }, }, }, 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: 22, Line: 70, }, File: "minute_time_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 70, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 70, }, File: "minute_time_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 70, }, }, }, 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: 70, Line: 70, }, File: "minute_time_test.flux", Source: "map(fn: (r) => ({r with _value: date.minute(t: r._time)}))", Start: ast.Position{ Column: 12, Line: 70, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 70, }, File: "minute_time_test.flux", Source: "map", Start: ast.Position{ Column: 12, Line: 70, }, }, }, 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: 26, Line: 67, }, File: "minute_time_test.flux", Source: "table=<-", Start: ast.Position{ Column: 18, Line: 67, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 67, }, File: "minute_time_test.flux", Source: "table", Start: ast.Position{ Column: 18, Line: 67, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 26, Line: 67, }, File: "minute_time_test.flux", Source: "<-", Start: ast.Position{ Column: 24, Line: 67, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 73, }, File: "minute_time_test.flux", Source: "_time_minute = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_minute})", Start: ast.Position{ Column: 6, Line: 72, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 72, }, File: "minute_time_test.flux", Source: "_time_minute", Start: ast.Position{ Column: 6, Line: 72, }, }, }, Name: "_time_minute", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 73, }, File: "minute_time_test.flux", Source: "() =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_minute})", Start: ast.Position{ Column: 21, Line: 72, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 73, }, File: "minute_time_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_minute})", Start: ast.Position{ Column: 5, Line: 73, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 73, }, File: "minute_time_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_minute}", Start: ast.Position{ Column: 6, Line: 73, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 73, }, File: "minute_time_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 7, Line: 73, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 73, }, File: "minute_time_test.flux", Source: "input", Start: ast.Position{ Column: 7, Line: 73, }, }, }, 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: 73, }, File: "minute_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 73, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 73, }, File: "minute_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 73, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 73, }, File: "minute_time_test.flux", Source: "csv", Start: ast.Position{ Column: 34, Line: 73, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 73, }, File: "minute_time_test.flux", Source: "inData", Start: ast.Position{ Column: 39, Line: 73, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 73, }, File: "minute_time_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 14, Line: 73, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 73, }, File: "minute_time_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 14, Line: 73, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 73, }, File: "minute_time_test.flux", Source: "testing", Start: ast.Position{ Column: 14, Line: 73, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 73, }, File: "minute_time_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 22, Line: 73, }, }, }, 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: 73, }, File: "minute_time_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 48, Line: 73, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 73, }, File: "minute_time_test.flux", Source: "want", Start: ast.Position{ Column: 48, Line: 73, }, }, }, 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: 73, }, File: "minute_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 73, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 73, }, File: "minute_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 73, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 73, }, File: "minute_time_test.flux", Source: "csv", Start: ast.Position{ Column: 70, Line: 73, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 73, }, File: "minute_time_test.flux", Source: "outData", Start: ast.Position{ Column: 75, Line: 73, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 73, }, File: "minute_time_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 54, Line: 73, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 73, }, File: "minute_time_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 54, Line: 73, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 73, }, File: "minute_time_test.flux", Source: "testing", Start: ast.Position{ Column: 54, Line: 73, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 73, }, File: "minute_time_test.flux", Source: "loadMem", Start: ast.Position{ Column: 62, Line: 73, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 73, }, File: "minute_time_test.flux", Source: "fn: t_time_minute", Start: ast.Position{ Column: 85, Line: 73, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 73, }, File: "minute_time_test.flux", Source: "fn", Start: ast.Position{ Column: 85, Line: 73, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 73, }, File: "minute_time_test.flux", Source: "t_time_minute", Start: ast.Position{ Column: 89, Line: 73, }, }, }, Name: "t_time_minute", }, }}, 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: 104, Line: 73, }, File: "minute_time_test.flux", Source: "test _time_minute = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_minute})", Start: ast.Position{ Column: 1, Line: 72, }, }, }, }}, 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: 4, }, File: "minute_time_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: "minute_time_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "minute_time_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "minute_time_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "minute_time_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "minute_time_test.flux", Source: "package date_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: 18, Line: 1, }, File: "minute_time_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 111, Line: 41, }, File: "month_day_duration_test.flux", Source: "package date_test\n\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => 2030-01-01T00:00:00Z\n\ninData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"\noutData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,31\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,31\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,31\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n\"\nt_duration_month_day = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.monthDay(t: duration(v: r._value))}))\n\ntest _duration_month_day = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_month_day})", 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: 40, Line: 7, }, File: "month_day_duration_test.flux", Source: "now = () => 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: "month_day_duration_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: 40, Line: 7, }, File: "month_day_duration_test.flux", Source: "() => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "month_day_duration_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 20, Line: 7, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "month_day_duration_test.flux", Source: "option now = () => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 21, }, File: "month_day_duration_test.flux", Source: "inData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\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: "month_day_duration_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: 21, }, File: "month_day_duration_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 5, Line: 10, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "month_day_duration_test.flux", Source: "outData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,31\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,31\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,31\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n\"", Start: ast.Position{ Column: 1, Line: 22, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 22, }, File: "month_day_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 22, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "month_day_duration_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,31\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,31\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,31\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n\"", Start: ast.Position{ Column: 5, Line: 23, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,31\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,31\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,31\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 86, Line: 38, }, File: "month_day_duration_test.flux", Source: "t_duration_month_day = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.monthDay(t: duration(v: r._value))}))", Start: ast.Position{ Column: 1, Line: 35, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 35, }, File: "month_day_duration_test.flux", Source: "t_duration_month_day", Start: ast.Position{ Column: 1, Line: 35, }, }, }, Name: "t_duration_month_day", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 86, Line: 38, }, File: "month_day_duration_test.flux", Source: "(table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.monthDay(t: duration(v: r._value))}))", Start: ast.Position{ Column: 24, Line: 35, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 36, }, File: "month_day_duration_test.flux", Source: "table", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 37, }, File: "month_day_duration_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "month_day_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "month_day_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 37, }, File: "month_day_duration_test.flux", Source: "start", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "month_day_duration_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 25, Line: 37, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 37, }, File: "month_day_duration_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 12, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 37, }, File: "month_day_duration_test.flux", Source: "range", Start: ast.Position{ Column: 12, Line: 37, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 86, Line: 38, }, File: "month_day_duration_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.monthDay(t: duration(v: r._value))}))", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 85, Line: 38, }, File: "month_day_duration_test.flux", Source: "fn: (r) => ({r with _value: date.monthDay(t: duration(v: r._value))})", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 85, Line: 38, }, File: "month_day_duration_test.flux", Source: "fn: (r) => ({r with _value: date.monthDay(t: duration(v: r._value))})", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 38, }, File: "month_day_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 85, Line: 38, }, File: "month_day_duration_test.flux", Source: "(r) => ({r with _value: date.monthDay(t: duration(v: r._value))})", Start: ast.Position{ Column: 20, Line: 38, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 85, Line: 38, }, File: "month_day_duration_test.flux", Source: "({r with _value: date.monthDay(t: duration(v: r._value))})", Start: ast.Position{ Column: 27, Line: 38, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 38, }, File: "month_day_duration_test.flux", Source: "{r with _value: date.monthDay(t: duration(v: r._value))}", Start: ast.Position{ Column: 28, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 38, }, File: "month_day_duration_test.flux", Source: "_value: date.monthDay(t: duration(v: r._value))", Start: ast.Position{ Column: 36, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 38, }, File: "month_day_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 36, 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: 82, Line: 38, }, File: "month_day_duration_test.flux", Source: "t: duration(v: r._value)", Start: ast.Position{ Column: 58, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 38, }, File: "month_day_duration_test.flux", Source: "t: duration(v: r._value)", Start: ast.Position{ Column: 58, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 38, }, File: "month_day_duration_test.flux", Source: "t", Start: ast.Position{ Column: 58, Line: 38, }, }, }, Name: "t", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 38, }, File: "month_day_duration_test.flux", Source: "v: r._value", Start: ast.Position{ Column: 70, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 38, }, File: "month_day_duration_test.flux", Source: "v: r._value", Start: ast.Position{ Column: 70, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 38, }, File: "month_day_duration_test.flux", Source: "v", Start: ast.Position{ Column: 70, Line: 38, }, }, }, Name: "v", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 38, }, File: "month_day_duration_test.flux", Source: "r._value", Start: ast.Position{ Column: 73, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 38, }, File: "month_day_duration_test.flux", Source: "r", Start: ast.Position{ Column: 73, Line: 38, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 38, }, File: "month_day_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 75, Line: 38, }, }, }, Name: "_value", }, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 38, }, File: "month_day_duration_test.flux", Source: "duration(v: r._value)", Start: ast.Position{ Column: 61, Line: 38, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 38, }, File: "month_day_duration_test.flux", Source: "duration", Start: ast.Position{ Column: 61, Line: 38, }, }, }, Name: "duration", }, Lparen: nil, Rparen: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 38, }, File: "month_day_duration_test.flux", Source: "date.monthDay(t: duration(v: r._value))", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 57, Line: 38, }, File: "month_day_duration_test.flux", Source: "date.monthDay", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 38, }, File: "month_day_duration_test.flux", Source: "date", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 57, Line: 38, }, File: "month_day_duration_test.flux", Source: "monthDay", Start: ast.Position{ Column: 49, Line: 38, }, }, }, Name: "monthDay", }, 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: 30, Line: 38, }, File: "month_day_duration_test.flux", Source: "r", Start: ast.Position{ Column: 29, 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: 22, Line: 38, }, File: "month_day_duration_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 38, }, File: "month_day_duration_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 38, }, }, }, 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: 86, Line: 38, }, File: "month_day_duration_test.flux", Source: "map(fn: (r) => ({r with _value: date.monthDay(t: duration(v: r._value))}))", Start: ast.Position{ Column: 12, Line: 38, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 38, }, File: "month_day_duration_test.flux", Source: "map", Start: ast.Position{ Column: 12, Line: 38, }, }, }, 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: 33, Line: 35, }, File: "month_day_duration_test.flux", Source: "table=<-", Start: ast.Position{ Column: 25, Line: 35, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 35, }, File: "month_day_duration_test.flux", Source: "table", Start: ast.Position{ Column: 25, Line: 35, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 35, }, File: "month_day_duration_test.flux", Source: "<-", Start: ast.Position{ Column: 31, Line: 35, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 111, Line: 41, }, File: "month_day_duration_test.flux", Source: "_duration_month_day = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_month_day})", Start: ast.Position{ Column: 6, Line: 40, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 40, }, File: "month_day_duration_test.flux", Source: "_duration_month_day", Start: ast.Position{ Column: 6, Line: 40, }, }, }, Name: "_duration_month_day", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 111, Line: 41, }, File: "month_day_duration_test.flux", Source: "() =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_month_day})", Start: ast.Position{ Column: 28, Line: 40, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 111, Line: 41, }, File: "month_day_duration_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_month_day})", Start: ast.Position{ Column: 5, Line: 41, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 110, Line: 41, }, File: "month_day_duration_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_month_day}", Start: ast.Position{ Column: 6, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 41, }, File: "month_day_duration_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 7, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 41, }, File: "month_day_duration_test.flux", Source: "input", Start: ast.Position{ Column: 7, 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: 45, Line: 41, }, File: "month_day_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 41, }, File: "month_day_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 41, }, File: "month_day_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 41, }, File: "month_day_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 39, Line: 41, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 41, }, File: "month_day_duration_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 41, }, File: "month_day_duration_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 41, }, File: "month_day_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 41, }, File: "month_day_duration_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 22, 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: 83, Line: 41, }, File: "month_day_duration_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 48, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 41, }, File: "month_day_duration_test.flux", Source: "want", Start: ast.Position{ Column: 48, 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: 82, Line: 41, }, File: "month_day_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 41, }, File: "month_day_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 41, }, File: "month_day_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 41, }, File: "month_day_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 75, Line: 41, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 41, }, File: "month_day_duration_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 41, }, File: "month_day_duration_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 41, }, File: "month_day_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 41, }, File: "month_day_duration_test.flux", Source: "loadMem", Start: ast.Position{ Column: 62, 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: 109, Line: 41, }, File: "month_day_duration_test.flux", Source: "fn: t_duration_month_day", Start: ast.Position{ Column: 85, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 41, }, File: "month_day_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 85, Line: 41, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 109, Line: 41, }, File: "month_day_duration_test.flux", Source: "t_duration_month_day", Start: ast.Position{ Column: 89, Line: 41, }, }, }, Name: "t_duration_month_day", }, }}, 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: 111, Line: 41, }, File: "month_day_duration_test.flux", Source: "test _duration_month_day = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_month_day})", 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: 4, }, File: "month_day_duration_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: "month_day_duration_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "month_day_duration_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "month_day_duration_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "month_day_duration_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "month_day_duration_test.flux", Source: "package date_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: 18, Line: 1, }, File: "month_day_duration_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 91, }, File: "month_day_time_test.flux", Source: "package date_test\n\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => 2030-01-01T00:00:00Z\n\ninData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-01T19:53:00Z,_m,FF,1\n,,0,2018-05-02T19:53:10Z,_m,FF,1\n,,0,2018-05-03T19:53:20Z,_m,FF,1\n,,0,2018-05-04T19:53:30Z,_m,FF,1\n,,0,2018-05-05T19:53:40Z,_m,FF,1\n,,0,2018-05-06T19:53:50Z,_m,FF,1\n,,1,2018-05-07T19:53:00Z,_m,QQ,1\n,,1,2018-05-08T19:53:10Z,_m,QQ,1\n,,1,2018-05-09T19:53:20Z,_m,QQ,1\n,,1,2018-05-10T19:53:30Z,_m,QQ,1\n,,1,2018-05-11T19:53:40Z,_m,QQ,1\n,,1,2018-05-12T19:53:50Z,_m,QQ,1\n,,1,2018-05-13T19:54:00Z,_m,QQ,1\n,,1,2018-05-14T19:54:10Z,_m,QQ,1\n,,1,2018-05-15T19:54:20Z,_m,QQ,1\n,,2,2018-05-16T19:53:00Z,_m,RR,1\n,,2,2018-05-17T19:53:10Z,_m,RR,1\n,,2,2018-05-18T19:53:20Z,_m,RR,1\n,,2,2018-05-19T19:53:30Z,_m,RR,1\n,,3,2018-05-20T19:53:40Z,_m,SR,1\n,,3,2018-05-21T19:53:50Z,_m,SR,1\n,,3,2018-05-22T19:54:00Z,_m,SR,1\n,,3,2018-05-23T19:54:00Z,_m,SR,1\n,,3,2018-05-24T19:54:00Z,_m,SR,1\n,,3,2018-05-25T19:54:00Z,_m,SR,1\n,,3,2018-05-26T19:54:00Z,_m,SR,1\n,,3,2018-05-27T19:54:00Z,_m,SR,1\n,,3,2018-05-28T19:54:00Z,_m,SR,1\n,,3,2018-05-29T19:54:00Z,_m,SR,1\n,,3,2018-05-30T19:54:00Z,_m,SR,1\n,,3,2018-05-31T19:54:00Z,_m,SR,1\n\"\noutData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-01T19:53:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-02T19:53:10Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-03T19:53:20Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-04T19:53:30Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-05T19:53:40Z,5\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-06T19:53:50Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-07T19:53:00Z,7\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-08T19:53:10Z,8\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-09T19:53:20Z,9\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-10T19:53:30Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-11T19:53:40Z,11\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-12T19:53:50Z,12\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-13T19:54:00Z,13\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-14T19:54:10Z,14\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-15T19:54:20Z,15\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-16T19:53:00Z,16\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-17T19:53:10Z,17\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-18T19:53:20Z,18\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-19T19:53:30Z,19\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-20T19:53:40Z,20\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-21T19:53:50Z,21\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:54:00Z,22\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-23T19:54:00Z,23\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-24T19:54:00Z,24\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-25T19:54:00Z,25\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-26T19:54:00Z,26\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-27T19:54:00Z,27\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-28T19:54:00Z,28\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-29T19:54:00Z,29\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-30T19:54:00Z,30\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-31T19:54:00Z,31\n\"\nt_time_month_day = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.monthDay(t: r._time)}))\n\ntest _time_month_day = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_month_day})", 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: 40, Line: 7, }, File: "month_day_time_test.flux", Source: "now = () => 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: "month_day_time_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: 40, Line: 7, }, File: "month_day_time_test.flux", Source: "() => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "month_day_time_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 20, Line: 7, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "month_day_time_test.flux", Source: "option now = () => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 46, }, File: "month_day_time_test.flux", Source: "inData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-01T19:53:00Z,_m,FF,1\n,,0,2018-05-02T19:53:10Z,_m,FF,1\n,,0,2018-05-03T19:53:20Z,_m,FF,1\n,,0,2018-05-04T19:53:30Z,_m,FF,1\n,,0,2018-05-05T19:53:40Z,_m,FF,1\n,,0,2018-05-06T19:53:50Z,_m,FF,1\n,,1,2018-05-07T19:53:00Z,_m,QQ,1\n,,1,2018-05-08T19:53:10Z,_m,QQ,1\n,,1,2018-05-09T19:53:20Z,_m,QQ,1\n,,1,2018-05-10T19:53:30Z,_m,QQ,1\n,,1,2018-05-11T19:53:40Z,_m,QQ,1\n,,1,2018-05-12T19:53:50Z,_m,QQ,1\n,,1,2018-05-13T19:54:00Z,_m,QQ,1\n,,1,2018-05-14T19:54:10Z,_m,QQ,1\n,,1,2018-05-15T19:54:20Z,_m,QQ,1\n,,2,2018-05-16T19:53:00Z,_m,RR,1\n,,2,2018-05-17T19:53:10Z,_m,RR,1\n,,2,2018-05-18T19:53:20Z,_m,RR,1\n,,2,2018-05-19T19:53:30Z,_m,RR,1\n,,3,2018-05-20T19:53:40Z,_m,SR,1\n,,3,2018-05-21T19:53:50Z,_m,SR,1\n,,3,2018-05-22T19:54:00Z,_m,SR,1\n,,3,2018-05-23T19:54:00Z,_m,SR,1\n,,3,2018-05-24T19:54:00Z,_m,SR,1\n,,3,2018-05-25T19:54:00Z,_m,SR,1\n,,3,2018-05-26T19:54:00Z,_m,SR,1\n,,3,2018-05-27T19:54:00Z,_m,SR,1\n,,3,2018-05-28T19:54:00Z,_m,SR,1\n,,3,2018-05-29T19:54:00Z,_m,SR,1\n,,3,2018-05-30T19:54:00Z,_m,SR,1\n,,3,2018-05-31T19:54:00Z,_m,SR,1\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: "month_day_time_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: 46, }, File: "month_day_time_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-01T19:53:00Z,_m,FF,1\n,,0,2018-05-02T19:53:10Z,_m,FF,1\n,,0,2018-05-03T19:53:20Z,_m,FF,1\n,,0,2018-05-04T19:53:30Z,_m,FF,1\n,,0,2018-05-05T19:53:40Z,_m,FF,1\n,,0,2018-05-06T19:53:50Z,_m,FF,1\n,,1,2018-05-07T19:53:00Z,_m,QQ,1\n,,1,2018-05-08T19:53:10Z,_m,QQ,1\n,,1,2018-05-09T19:53:20Z,_m,QQ,1\n,,1,2018-05-10T19:53:30Z,_m,QQ,1\n,,1,2018-05-11T19:53:40Z,_m,QQ,1\n,,1,2018-05-12T19:53:50Z,_m,QQ,1\n,,1,2018-05-13T19:54:00Z,_m,QQ,1\n,,1,2018-05-14T19:54:10Z,_m,QQ,1\n,,1,2018-05-15T19:54:20Z,_m,QQ,1\n,,2,2018-05-16T19:53:00Z,_m,RR,1\n,,2,2018-05-17T19:53:10Z,_m,RR,1\n,,2,2018-05-18T19:53:20Z,_m,RR,1\n,,2,2018-05-19T19:53:30Z,_m,RR,1\n,,3,2018-05-20T19:53:40Z,_m,SR,1\n,,3,2018-05-21T19:53:50Z,_m,SR,1\n,,3,2018-05-22T19:54:00Z,_m,SR,1\n,,3,2018-05-23T19:54:00Z,_m,SR,1\n,,3,2018-05-24T19:54:00Z,_m,SR,1\n,,3,2018-05-25T19:54:00Z,_m,SR,1\n,,3,2018-05-26T19:54:00Z,_m,SR,1\n,,3,2018-05-27T19:54:00Z,_m,SR,1\n,,3,2018-05-28T19:54:00Z,_m,SR,1\n,,3,2018-05-29T19:54:00Z,_m,SR,1\n,,3,2018-05-30T19:54:00Z,_m,SR,1\n,,3,2018-05-31T19:54:00Z,_m,SR,1\n\"", Start: ast.Position{ Column: 5, Line: 10, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-01T19:53:00Z,_m,FF,1\n,,0,2018-05-02T19:53:10Z,_m,FF,1\n,,0,2018-05-03T19:53:20Z,_m,FF,1\n,,0,2018-05-04T19:53:30Z,_m,FF,1\n,,0,2018-05-05T19:53:40Z,_m,FF,1\n,,0,2018-05-06T19:53:50Z,_m,FF,1\n,,1,2018-05-07T19:53:00Z,_m,QQ,1\n,,1,2018-05-08T19:53:10Z,_m,QQ,1\n,,1,2018-05-09T19:53:20Z,_m,QQ,1\n,,1,2018-05-10T19:53:30Z,_m,QQ,1\n,,1,2018-05-11T19:53:40Z,_m,QQ,1\n,,1,2018-05-12T19:53:50Z,_m,QQ,1\n,,1,2018-05-13T19:54:00Z,_m,QQ,1\n,,1,2018-05-14T19:54:10Z,_m,QQ,1\n,,1,2018-05-15T19:54:20Z,_m,QQ,1\n,,2,2018-05-16T19:53:00Z,_m,RR,1\n,,2,2018-05-17T19:53:10Z,_m,RR,1\n,,2,2018-05-18T19:53:20Z,_m,RR,1\n,,2,2018-05-19T19:53:30Z,_m,RR,1\n,,3,2018-05-20T19:53:40Z,_m,SR,1\n,,3,2018-05-21T19:53:50Z,_m,SR,1\n,,3,2018-05-22T19:54:00Z,_m,SR,1\n,,3,2018-05-23T19:54:00Z,_m,SR,1\n,,3,2018-05-24T19:54:00Z,_m,SR,1\n,,3,2018-05-25T19:54:00Z,_m,SR,1\n,,3,2018-05-26T19:54:00Z,_m,SR,1\n,,3,2018-05-27T19:54:00Z,_m,SR,1\n,,3,2018-05-28T19:54:00Z,_m,SR,1\n,,3,2018-05-29T19:54:00Z,_m,SR,1\n,,3,2018-05-30T19:54:00Z,_m,SR,1\n,,3,2018-05-31T19:54:00Z,_m,SR,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 84, }, File: "month_day_time_test.flux", Source: "outData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-01T19:53:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-02T19:53:10Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-03T19:53:20Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-04T19:53:30Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-05T19:53:40Z,5\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-06T19:53:50Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-07T19:53:00Z,7\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-08T19:53:10Z,8\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-09T19:53:20Z,9\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-10T19:53:30Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-11T19:53:40Z,11\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-12T19:53:50Z,12\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-13T19:54:00Z,13\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-14T19:54:10Z,14\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-15T19:54:20Z,15\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-16T19:53:00Z,16\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-17T19:53:10Z,17\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-18T19:53:20Z,18\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-19T19:53:30Z,19\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-20T19:53:40Z,20\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-21T19:53:50Z,21\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:54:00Z,22\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-23T19:54:00Z,23\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-24T19:54:00Z,24\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-25T19:54:00Z,25\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-26T19:54:00Z,26\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-27T19:54:00Z,27\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-28T19:54:00Z,28\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-29T19:54:00Z,29\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-30T19:54:00Z,30\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-31T19:54:00Z,31\n\"", Start: ast.Position{ Column: 1, Line: 47, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 47, }, File: "month_day_time_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 47, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 84, }, File: "month_day_time_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-01T19:53:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-02T19:53:10Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-03T19:53:20Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-04T19:53:30Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-05T19:53:40Z,5\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-06T19:53:50Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-07T19:53:00Z,7\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-08T19:53:10Z,8\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-09T19:53:20Z,9\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-10T19:53:30Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-11T19:53:40Z,11\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-12T19:53:50Z,12\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-13T19:54:00Z,13\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-14T19:54:10Z,14\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-15T19:54:20Z,15\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-16T19:53:00Z,16\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-17T19:53:10Z,17\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-18T19:53:20Z,18\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-19T19:53:30Z,19\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-20T19:53:40Z,20\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-21T19:53:50Z,21\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:54:00Z,22\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-23T19:54:00Z,23\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-24T19:54:00Z,24\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-25T19:54:00Z,25\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-26T19:54:00Z,26\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-27T19:54:00Z,27\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-28T19:54:00Z,28\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-29T19:54:00Z,29\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-30T19:54:00Z,30\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-31T19:54:00Z,31\n\"", Start: ast.Position{ Column: 5, Line: 48, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-01T19:53:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-02T19:53:10Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-03T19:53:20Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-04T19:53:30Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-05T19:53:40Z,5\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-06T19:53:50Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-07T19:53:00Z,7\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-08T19:53:10Z,8\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-09T19:53:20Z,9\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-10T19:53:30Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-11T19:53:40Z,11\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-12T19:53:50Z,12\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-13T19:54:00Z,13\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-14T19:54:10Z,14\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-15T19:54:20Z,15\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-16T19:53:00Z,16\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-17T19:53:10Z,17\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-18T19:53:20Z,18\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-19T19:53:30Z,19\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-20T19:53:40Z,20\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-21T19:53:50Z,21\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:54:00Z,22\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-23T19:54:00Z,23\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-24T19:54:00Z,24\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-25T19:54:00Z,25\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-26T19:54:00Z,26\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-27T19:54:00Z,27\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-28T19:54:00Z,28\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-29T19:54:00Z,29\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-30T19:54:00Z,30\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-31T19:54:00Z,31\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 88, }, File: "month_day_time_test.flux", Source: "t_time_month_day = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.monthDay(t: r._time)}))", Start: ast.Position{ Column: 1, Line: 85, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 85, }, File: "month_day_time_test.flux", Source: "t_time_month_day", Start: ast.Position{ Column: 1, Line: 85, }, }, }, Name: "t_time_month_day", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 88, }, File: "month_day_time_test.flux", Source: "(table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.monthDay(t: r._time)}))", Start: ast.Position{ Column: 20, Line: 85, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 86, }, File: "month_day_time_test.flux", Source: "table", Start: ast.Position{ Column: 5, Line: 86, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 87, }, File: "month_day_time_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 5, Line: 86, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 87, }, File: "month_day_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 87, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 87, }, File: "month_day_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 87, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 87, }, File: "month_day_time_test.flux", Source: "start", Start: ast.Position{ Column: 18, Line: 87, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 87, }, File: "month_day_time_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 25, Line: 87, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 87, }, File: "month_day_time_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 12, Line: 87, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 87, }, File: "month_day_time_test.flux", Source: "range", Start: ast.Position{ Column: 12, Line: 87, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 88, }, File: "month_day_time_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.monthDay(t: r._time)}))", Start: ast.Position{ Column: 5, Line: 86, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 88, }, File: "month_day_time_test.flux", Source: "fn: (r) => ({r with _value: date.monthDay(t: r._time)})", Start: ast.Position{ Column: 16, Line: 88, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 88, }, File: "month_day_time_test.flux", Source: "fn: (r) => ({r with _value: date.monthDay(t: r._time)})", Start: ast.Position{ Column: 16, Line: 88, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 88, }, File: "month_day_time_test.flux", Source: "fn", Start: ast.Position{ Column: 16, Line: 88, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 88, }, File: "month_day_time_test.flux", Source: "(r) => ({r with _value: date.monthDay(t: r._time)})", Start: ast.Position{ Column: 20, Line: 88, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 88, }, File: "month_day_time_test.flux", Source: "({r with _value: date.monthDay(t: r._time)})", Start: ast.Position{ Column: 27, Line: 88, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 88, }, File: "month_day_time_test.flux", Source: "{r with _value: date.monthDay(t: r._time)}", Start: ast.Position{ Column: 28, Line: 88, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 88, }, File: "month_day_time_test.flux", Source: "_value: date.monthDay(t: r._time)", Start: ast.Position{ Column: 36, Line: 88, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 88, }, File: "month_day_time_test.flux", Source: "_value", Start: ast.Position{ Column: 36, Line: 88, }, }, }, 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: 68, Line: 88, }, File: "month_day_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 58, Line: 88, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 88, }, File: "month_day_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 58, Line: 88, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 88, }, File: "month_day_time_test.flux", Source: "t", Start: ast.Position{ Column: 58, Line: 88, }, }, }, Name: "t", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 88, }, File: "month_day_time_test.flux", Source: "r._time", Start: ast.Position{ Column: 61, Line: 88, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 62, Line: 88, }, File: "month_day_time_test.flux", Source: "r", Start: ast.Position{ Column: 61, Line: 88, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 88, }, File: "month_day_time_test.flux", Source: "_time", Start: ast.Position{ Column: 63, Line: 88, }, }, }, Name: "_time", }, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 88, }, File: "month_day_time_test.flux", Source: "date.monthDay(t: r._time)", Start: ast.Position{ Column: 44, Line: 88, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 57, Line: 88, }, File: "month_day_time_test.flux", Source: "date.monthDay", Start: ast.Position{ Column: 44, Line: 88, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 88, }, File: "month_day_time_test.flux", Source: "date", Start: ast.Position{ Column: 44, Line: 88, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 57, Line: 88, }, File: "month_day_time_test.flux", Source: "monthDay", Start: ast.Position{ Column: 49, Line: 88, }, }, }, Name: "monthDay", }, 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: 30, Line: 88, }, File: "month_day_time_test.flux", Source: "r", Start: ast.Position{ Column: 29, Line: 88, }, }, }, 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: 22, Line: 88, }, File: "month_day_time_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 88, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 88, }, File: "month_day_time_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 88, }, }, }, 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: 72, Line: 88, }, File: "month_day_time_test.flux", Source: "map(fn: (r) => ({r with _value: date.monthDay(t: r._time)}))", Start: ast.Position{ Column: 12, Line: 88, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 88, }, File: "month_day_time_test.flux", Source: "map", Start: ast.Position{ Column: 12, Line: 88, }, }, }, 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: 29, Line: 85, }, File: "month_day_time_test.flux", Source: "table=<-", Start: ast.Position{ Column: 21, Line: 85, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 26, Line: 85, }, File: "month_day_time_test.flux", Source: "table", Start: ast.Position{ Column: 21, Line: 85, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 85, }, File: "month_day_time_test.flux", Source: "<-", Start: ast.Position{ Column: 27, Line: 85, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 91, }, File: "month_day_time_test.flux", Source: "_time_month_day = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_month_day})", Start: ast.Position{ Column: 6, Line: 90, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 90, }, File: "month_day_time_test.flux", Source: "_time_month_day", Start: ast.Position{ Column: 6, Line: 90, }, }, }, Name: "_time_month_day", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 91, }, File: "month_day_time_test.flux", Source: "() =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_month_day})", Start: ast.Position{ Column: 24, Line: 90, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 91, }, File: "month_day_time_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_month_day})", Start: ast.Position{ Column: 5, Line: 91, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 91, }, File: "month_day_time_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_month_day}", Start: ast.Position{ Column: 6, Line: 91, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 91, }, File: "month_day_time_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 7, Line: 91, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 91, }, File: "month_day_time_test.flux", Source: "input", Start: ast.Position{ Column: 7, Line: 91, }, }, }, 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: 91, }, File: "month_day_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 91, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 91, }, File: "month_day_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 91, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 91, }, File: "month_day_time_test.flux", Source: "csv", Start: ast.Position{ Column: 34, Line: 91, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 91, }, File: "month_day_time_test.flux", Source: "inData", Start: ast.Position{ Column: 39, Line: 91, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 91, }, File: "month_day_time_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 14, Line: 91, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 91, }, File: "month_day_time_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 14, Line: 91, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 91, }, File: "month_day_time_test.flux", Source: "testing", Start: ast.Position{ Column: 14, Line: 91, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 91, }, File: "month_day_time_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 22, Line: 91, }, }, }, 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: 91, }, File: "month_day_time_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 48, Line: 91, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 91, }, File: "month_day_time_test.flux", Source: "want", Start: ast.Position{ Column: 48, Line: 91, }, }, }, 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: 91, }, File: "month_day_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 91, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 91, }, File: "month_day_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 91, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 91, }, File: "month_day_time_test.flux", Source: "csv", Start: ast.Position{ Column: 70, Line: 91, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 91, }, File: "month_day_time_test.flux", Source: "outData", Start: ast.Position{ Column: 75, Line: 91, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 91, }, File: "month_day_time_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 54, Line: 91, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 91, }, File: "month_day_time_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 54, Line: 91, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 91, }, File: "month_day_time_test.flux", Source: "testing", Start: ast.Position{ Column: 54, Line: 91, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 91, }, File: "month_day_time_test.flux", Source: "loadMem", Start: ast.Position{ Column: 62, Line: 91, }, }, }, 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: 91, }, File: "month_day_time_test.flux", Source: "fn: t_time_month_day", Start: ast.Position{ Column: 85, Line: 91, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 91, }, File: "month_day_time_test.flux", Source: "fn", Start: ast.Position{ Column: 85, Line: 91, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 91, }, File: "month_day_time_test.flux", Source: "t_time_month_day", Start: ast.Position{ Column: 89, Line: 91, }, }, }, Name: "t_time_month_day", }, }}, 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: 91, }, File: "month_day_time_test.flux", Source: "test _time_month_day = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_month_day})", Start: ast.Position{ Column: 1, Line: 90, }, }, }, }}, 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: 4, }, File: "month_day_time_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: "month_day_time_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "month_day_time_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "month_day_time_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "month_day_time_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "month_day_time_test.flux", Source: "package date_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: 18, Line: 1, }, File: "month_day_time_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 41, }, File: "month_duration_test.flux", Source: "package date_test\n\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => 2030-01-01T00:00:00Z\n\ninData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"\noutData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,12\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,12\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,12\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n\"\nt_duration_month = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.month(t: duration(v: r._value))}))\n\ntest _duration_month = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_month})", 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: 40, Line: 7, }, File: "month_duration_test.flux", Source: "now = () => 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: "month_duration_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: 40, Line: 7, }, File: "month_duration_test.flux", Source: "() => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "month_duration_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 20, Line: 7, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "month_duration_test.flux", Source: "option now = () => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 21, }, File: "month_duration_test.flux", Source: "inData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\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: "month_duration_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: 21, }, File: "month_duration_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 5, Line: 10, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "month_duration_test.flux", Source: "outData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,12\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,12\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,12\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n\"", Start: ast.Position{ Column: 1, Line: 22, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 22, }, File: "month_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 22, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "month_duration_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,12\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,12\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,12\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n\"", Start: ast.Position{ Column: 5, Line: 23, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,12\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,12\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,12\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 38, }, File: "month_duration_test.flux", Source: "t_duration_month = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.month(t: duration(v: r._value))}))", Start: ast.Position{ Column: 1, Line: 35, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 35, }, File: "month_duration_test.flux", Source: "t_duration_month", Start: ast.Position{ Column: 1, Line: 35, }, }, }, Name: "t_duration_month", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 38, }, File: "month_duration_test.flux", Source: "(table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.month(t: duration(v: r._value))}))", Start: ast.Position{ Column: 20, Line: 35, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 36, }, File: "month_duration_test.flux", Source: "table", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 37, }, File: "month_duration_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "month_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "month_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 37, }, File: "month_duration_test.flux", Source: "start", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "month_duration_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 25, Line: 37, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 37, }, File: "month_duration_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 12, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 37, }, File: "month_duration_test.flux", Source: "range", Start: ast.Position{ Column: 12, Line: 37, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 38, }, File: "month_duration_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.month(t: duration(v: r._value))}))", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 38, }, File: "month_duration_test.flux", Source: "fn: (r) => ({r with _value: date.month(t: duration(v: r._value))})", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 38, }, File: "month_duration_test.flux", Source: "fn: (r) => ({r with _value: date.month(t: duration(v: r._value))})", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 38, }, File: "month_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 38, }, File: "month_duration_test.flux", Source: "(r) => ({r with _value: date.month(t: duration(v: r._value))})", Start: ast.Position{ Column: 20, Line: 38, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 38, }, File: "month_duration_test.flux", Source: "({r with _value: date.month(t: duration(v: r._value))})", Start: ast.Position{ Column: 27, Line: 38, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 38, }, File: "month_duration_test.flux", Source: "{r with _value: date.month(t: duration(v: r._value))}", Start: ast.Position{ Column: 28, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 38, }, File: "month_duration_test.flux", Source: "_value: date.month(t: duration(v: r._value))", Start: ast.Position{ Column: 36, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 38, }, File: "month_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 36, 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: 79, Line: 38, }, File: "month_duration_test.flux", Source: "t: duration(v: r._value)", Start: ast.Position{ Column: 55, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 38, }, File: "month_duration_test.flux", Source: "t: duration(v: r._value)", Start: ast.Position{ Column: 55, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 56, Line: 38, }, File: "month_duration_test.flux", Source: "t", Start: ast.Position{ Column: 55, Line: 38, }, }, }, Name: "t", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 38, }, File: "month_duration_test.flux", Source: "v: r._value", Start: ast.Position{ Column: 67, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 38, }, File: "month_duration_test.flux", Source: "v: r._value", Start: ast.Position{ Column: 67, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 38, }, File: "month_duration_test.flux", Source: "v", Start: ast.Position{ Column: 67, Line: 38, }, }, }, Name: "v", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 38, }, File: "month_duration_test.flux", Source: "r._value", Start: ast.Position{ Column: 70, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 38, }, File: "month_duration_test.flux", Source: "r", Start: ast.Position{ Column: 70, Line: 38, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 38, }, File: "month_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 72, Line: 38, }, }, }, Name: "_value", }, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 38, }, File: "month_duration_test.flux", Source: "duration(v: r._value)", Start: ast.Position{ Column: 58, Line: 38, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 38, }, File: "month_duration_test.flux", Source: "duration", Start: ast.Position{ Column: 58, Line: 38, }, }, }, Name: "duration", }, Lparen: nil, Rparen: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 38, }, File: "month_duration_test.flux", Source: "date.month(t: duration(v: r._value))", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 38, }, File: "month_duration_test.flux", Source: "date.month", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 38, }, File: "month_duration_test.flux", Source: "date", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 38, }, File: "month_duration_test.flux", Source: "month", Start: ast.Position{ Column: 49, Line: 38, }, }, }, Name: "month", }, 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: 30, Line: 38, }, File: "month_duration_test.flux", Source: "r", Start: ast.Position{ Column: 29, 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: 22, Line: 38, }, File: "month_duration_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 38, }, File: "month_duration_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 38, }, }, }, 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: 83, Line: 38, }, File: "month_duration_test.flux", Source: "map(fn: (r) => ({r with _value: date.month(t: duration(v: r._value))}))", Start: ast.Position{ Column: 12, Line: 38, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 38, }, File: "month_duration_test.flux", Source: "map", Start: ast.Position{ Column: 12, Line: 38, }, }, }, 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: 29, Line: 35, }, File: "month_duration_test.flux", Source: "table=<-", Start: ast.Position{ Column: 21, Line: 35, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 26, Line: 35, }, File: "month_duration_test.flux", Source: "table", Start: ast.Position{ Column: 21, Line: 35, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 35, }, File: "month_duration_test.flux", Source: "<-", Start: ast.Position{ Column: 27, Line: 35, }, }, }}, }}, 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: "month_duration_test.flux", Source: "_duration_month = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_month})", Start: ast.Position{ Column: 6, Line: 40, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 40, }, File: "month_duration_test.flux", Source: "_duration_month", Start: ast.Position{ Column: 6, Line: 40, }, }, }, Name: "_duration_month", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 41, }, File: "month_duration_test.flux", Source: "() =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_month})", Start: ast.Position{ Column: 24, Line: 40, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 41, }, File: "month_duration_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_month})", Start: ast.Position{ Column: 5, Line: 41, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 41, }, File: "month_duration_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_month}", Start: ast.Position{ Column: 6, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 41, }, File: "month_duration_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 7, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 41, }, File: "month_duration_test.flux", Source: "input", Start: ast.Position{ Column: 7, 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: 45, Line: 41, }, File: "month_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 41, }, File: "month_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 41, }, File: "month_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 41, }, File: "month_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 39, Line: 41, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 41, }, File: "month_duration_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 41, }, File: "month_duration_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 41, }, File: "month_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 41, }, File: "month_duration_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 22, 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: 83, Line: 41, }, File: "month_duration_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 48, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 41, }, File: "month_duration_test.flux", Source: "want", Start: ast.Position{ Column: 48, 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: 82, Line: 41, }, File: "month_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 41, }, File: "month_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 41, }, File: "month_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 41, }, File: "month_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 75, Line: 41, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 41, }, File: "month_duration_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 41, }, File: "month_duration_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 41, }, File: "month_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 41, }, File: "month_duration_test.flux", Source: "loadMem", Start: ast.Position{ Column: 62, 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: "month_duration_test.flux", Source: "fn: t_duration_month", Start: ast.Position{ Column: 85, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 41, }, File: "month_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 85, 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: "month_duration_test.flux", Source: "t_duration_month", Start: ast.Position{ Column: 89, Line: 41, }, }, }, Name: "t_duration_month", }, }}, 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: "month_duration_test.flux", Source: "test _duration_month = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_month})", 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: 4, }, File: "month_duration_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: "month_duration_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "month_duration_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "month_duration_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "month_duration_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "month_duration_test.flux", Source: "package date_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: 18, Line: 1, }, File: "month_duration_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 53, }, File: "month_time_test.flux", Source: "package date_test\n\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => 2030-01-01T00:00:00Z\n\ninData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-01-22T19:53:00Z,_m,FF,1\n,,0,2018-02-22T19:53:10Z,_m,FF,1\n,,0,2018-03-22T19:53:20Z,_m,FF,1\n,,0,2018-04-22T19:53:30Z,_m,FF,1\n,,0,2018-05-22T19:53:40Z,_m,FF,1\n,,0,2018-06-22T19:53:50Z,_m,FF,1\n,,1,2018-07-22T19:53:00Z,_m,QQ,1\n,,1,2018-08-22T19:53:10Z,_m,QQ,1\n,,1,2018-09-22T19:53:20Z,_m,QQ,1\n,,1,2018-10-22T19:53:30Z,_m,QQ,1\n,,1,2018-11-22T19:53:40Z,_m,QQ,1\n,,1,2018-12-22T19:53:50Z,_m,QQ,1\n\"\noutData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-01-22T19:53:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-02-22T19:53:10Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-03-22T19:53:20Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-04-22T19:53:30Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:40Z,5\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-06-22T19:53:50Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-07-22T19:53:00Z,7\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-08-22T19:53:10Z,8\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-09-22T19:53:20Z,9\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-10-22T19:53:30Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-11-22T19:53:40Z,11\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-12-22T19:53:50Z,12\n\"\nt_time_month = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.month(t: r._time)}))\n\ntest _time_month = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_month})", 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: 40, Line: 7, }, File: "month_time_test.flux", Source: "now = () => 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: "month_time_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: 40, Line: 7, }, File: "month_time_test.flux", Source: "() => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "month_time_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 20, Line: 7, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "month_time_test.flux", Source: "option now = () => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 27, }, File: "month_time_test.flux", Source: "inData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-01-22T19:53:00Z,_m,FF,1\n,,0,2018-02-22T19:53:10Z,_m,FF,1\n,,0,2018-03-22T19:53:20Z,_m,FF,1\n,,0,2018-04-22T19:53:30Z,_m,FF,1\n,,0,2018-05-22T19:53:40Z,_m,FF,1\n,,0,2018-06-22T19:53:50Z,_m,FF,1\n,,1,2018-07-22T19:53:00Z,_m,QQ,1\n,,1,2018-08-22T19:53:10Z,_m,QQ,1\n,,1,2018-09-22T19:53:20Z,_m,QQ,1\n,,1,2018-10-22T19:53:30Z,_m,QQ,1\n,,1,2018-11-22T19:53:40Z,_m,QQ,1\n,,1,2018-12-22T19:53:50Z,_m,QQ,1\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: "month_time_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: 27, }, File: "month_time_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-01-22T19:53:00Z,_m,FF,1\n,,0,2018-02-22T19:53:10Z,_m,FF,1\n,,0,2018-03-22T19:53:20Z,_m,FF,1\n,,0,2018-04-22T19:53:30Z,_m,FF,1\n,,0,2018-05-22T19:53:40Z,_m,FF,1\n,,0,2018-06-22T19:53:50Z,_m,FF,1\n,,1,2018-07-22T19:53:00Z,_m,QQ,1\n,,1,2018-08-22T19:53:10Z,_m,QQ,1\n,,1,2018-09-22T19:53:20Z,_m,QQ,1\n,,1,2018-10-22T19:53:30Z,_m,QQ,1\n,,1,2018-11-22T19:53:40Z,_m,QQ,1\n,,1,2018-12-22T19:53:50Z,_m,QQ,1\n\"", Start: ast.Position{ Column: 5, Line: 10, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-01-22T19:53:00Z,_m,FF,1\n,,0,2018-02-22T19:53:10Z,_m,FF,1\n,,0,2018-03-22T19:53:20Z,_m,FF,1\n,,0,2018-04-22T19:53:30Z,_m,FF,1\n,,0,2018-05-22T19:53:40Z,_m,FF,1\n,,0,2018-06-22T19:53:50Z,_m,FF,1\n,,1,2018-07-22T19:53:00Z,_m,QQ,1\n,,1,2018-08-22T19:53:10Z,_m,QQ,1\n,,1,2018-09-22T19:53:20Z,_m,QQ,1\n,,1,2018-10-22T19:53:30Z,_m,QQ,1\n,,1,2018-11-22T19:53:40Z,_m,QQ,1\n,,1,2018-12-22T19:53:50Z,_m,QQ,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 46, }, File: "month_time_test.flux", Source: "outData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-01-22T19:53:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-02-22T19:53:10Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-03-22T19:53:20Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-04-22T19:53:30Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:40Z,5\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-06-22T19:53:50Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-07-22T19:53:00Z,7\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-08-22T19:53:10Z,8\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-09-22T19:53:20Z,9\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-10-22T19:53:30Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-11-22T19:53:40Z,11\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-12-22T19:53:50Z,12\n\"", Start: ast.Position{ Column: 1, Line: 28, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 28, }, File: "month_time_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 28, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 46, }, File: "month_time_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-01-22T19:53:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-02-22T19:53:10Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-03-22T19:53:20Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-04-22T19:53:30Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:40Z,5\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-06-22T19:53:50Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-07-22T19:53:00Z,7\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-08-22T19:53:10Z,8\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-09-22T19:53:20Z,9\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-10-22T19:53:30Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-11-22T19:53:40Z,11\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-12-22T19:53:50Z,12\n\"", Start: ast.Position{ Column: 5, Line: 29, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-01-22T19:53:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-02-22T19:53:10Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-03-22T19:53:20Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-04-22T19:53:30Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:40Z,5\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-06-22T19:53:50Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-07-22T19:53:00Z,7\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-08-22T19:53:10Z,8\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-09-22T19:53:20Z,9\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-10-22T19:53:30Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-11-22T19:53:40Z,11\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-12-22T19:53:50Z,12\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 50, }, File: "month_time_test.flux", Source: "t_time_month = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.month(t: r._time)}))", Start: ast.Position{ Column: 1, Line: 47, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 13, Line: 47, }, File: "month_time_test.flux", Source: "t_time_month", Start: ast.Position{ Column: 1, Line: 47, }, }, }, Name: "t_time_month", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 50, }, File: "month_time_test.flux", Source: "(table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.month(t: r._time)}))", Start: ast.Position{ Column: 16, Line: 47, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 48, }, File: "month_time_test.flux", Source: "table", Start: ast.Position{ Column: 5, Line: 48, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 49, }, File: "month_time_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 5, Line: 48, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 49, }, File: "month_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, 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: "month_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 49, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 49, }, File: "month_time_test.flux", Source: "start", Start: ast.Position{ Column: 18, Line: 49, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 49, }, File: "month_time_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 25, Line: 49, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 49, }, File: "month_time_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 12, Line: 49, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 49, }, File: "month_time_test.flux", Source: "range", Start: ast.Position{ Column: 12, Line: 49, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 50, }, File: "month_time_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.month(t: r._time)}))", Start: ast.Position{ Column: 5, Line: 48, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 50, }, File: "month_time_test.flux", Source: "fn: (r) => ({r with _value: date.month(t: r._time)})", Start: ast.Position{ Column: 16, Line: 50, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 50, }, File: "month_time_test.flux", Source: "fn: (r) => ({r with _value: date.month(t: r._time)})", Start: ast.Position{ Column: 16, Line: 50, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 50, }, File: "month_time_test.flux", Source: "fn", Start: ast.Position{ Column: 16, Line: 50, }, }, }, 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: 50, }, File: "month_time_test.flux", Source: "(r) => ({r with _value: date.month(t: r._time)})", Start: ast.Position{ Column: 20, Line: 50, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 50, }, File: "month_time_test.flux", Source: "({r with _value: date.month(t: r._time)})", Start: ast.Position{ Column: 27, Line: 50, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 50, }, File: "month_time_test.flux", Source: "{r with _value: date.month(t: r._time)}", Start: ast.Position{ Column: 28, Line: 50, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 50, }, File: "month_time_test.flux", Source: "_value: date.month(t: r._time)", Start: ast.Position{ Column: 36, Line: 50, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 50, }, File: "month_time_test.flux", Source: "_value", Start: ast.Position{ Column: 36, Line: 50, }, }, }, 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: 50, }, File: "month_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 55, Line: 50, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 50, }, File: "month_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 55, Line: 50, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 56, Line: 50, }, File: "month_time_test.flux", Source: "t", Start: ast.Position{ Column: 55, Line: 50, }, }, }, Name: "t", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 50, }, File: "month_time_test.flux", Source: "r._time", Start: ast.Position{ Column: 58, Line: 50, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 50, }, File: "month_time_test.flux", Source: "r", Start: ast.Position{ Column: 58, Line: 50, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 50, }, File: "month_time_test.flux", Source: "_time", Start: ast.Position{ Column: 60, Line: 50, }, }, }, Name: "_time", }, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 50, }, File: "month_time_test.flux", Source: "date.month(t: r._time)", Start: ast.Position{ Column: 44, Line: 50, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 50, }, File: "month_time_test.flux", Source: "date.month", Start: ast.Position{ Column: 44, Line: 50, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 50, }, File: "month_time_test.flux", Source: "date", Start: ast.Position{ Column: 44, Line: 50, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 54, Line: 50, }, File: "month_time_test.flux", Source: "month", Start: ast.Position{ Column: 49, Line: 50, }, }, }, Name: "month", }, 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: 30, Line: 50, }, File: "month_time_test.flux", Source: "r", Start: ast.Position{ Column: 29, Line: 50, }, }, }, 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: 22, Line: 50, }, File: "month_time_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 50, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 50, }, File: "month_time_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 50, }, }, }, 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: 50, }, File: "month_time_test.flux", Source: "map(fn: (r) => ({r with _value: date.month(t: r._time)}))", Start: ast.Position{ Column: 12, Line: 50, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 50, }, File: "month_time_test.flux", Source: "map", Start: ast.Position{ Column: 12, Line: 50, }, }, }, 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: 25, Line: 47, }, File: "month_time_test.flux", Source: "table=<-", Start: ast.Position{ Column: 17, Line: 47, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 47, }, File: "month_time_test.flux", Source: "table", Start: ast.Position{ Column: 17, Line: 47, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 47, }, File: "month_time_test.flux", Source: "<-", Start: ast.Position{ Column: 23, Line: 47, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 53, }, File: "month_time_test.flux", Source: "_time_month = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_month})", Start: ast.Position{ Column: 6, Line: 52, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 52, }, File: "month_time_test.flux", Source: "_time_month", Start: ast.Position{ Column: 6, Line: 52, }, }, }, Name: "_time_month", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 53, }, File: "month_time_test.flux", Source: "() =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_month})", Start: ast.Position{ Column: 20, Line: 52, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 53, }, File: "month_time_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_month})", Start: ast.Position{ Column: 5, Line: 53, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 53, }, File: "month_time_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_month}", Start: ast.Position{ Column: 6, 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: "month_time_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 7, Line: 53, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 53, }, File: "month_time_test.flux", Source: "input", Start: ast.Position{ Column: 7, Line: 53, }, }, }, 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: 53, }, File: "month_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, 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: "month_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 53, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 53, }, File: "month_time_test.flux", Source: "csv", Start: ast.Position{ Column: 34, Line: 53, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 53, }, File: "month_time_test.flux", Source: "inData", Start: ast.Position{ Column: 39, Line: 53, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 53, }, File: "month_time_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 14, Line: 53, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 53, }, File: "month_time_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 14, Line: 53, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 53, }, File: "month_time_test.flux", Source: "testing", Start: ast.Position{ Column: 14, Line: 53, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 53, }, File: "month_time_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 22, Line: 53, }, }, }, 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: 53, }, File: "month_time_test.flux", Source: "want: testing.loadMem(csv: outData)", 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: 52, Line: 53, }, File: "month_time_test.flux", Source: "want", Start: ast.Position{ Column: 48, Line: 53, }, }, }, 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: 53, }, File: "month_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 53, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 53, }, File: "month_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 53, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 53, }, File: "month_time_test.flux", Source: "csv", Start: ast.Position{ Column: 70, Line: 53, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 53, }, File: "month_time_test.flux", Source: "outData", Start: ast.Position{ Column: 75, Line: 53, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 53, }, File: "month_time_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 54, Line: 53, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 53, }, File: "month_time_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 54, Line: 53, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 53, }, File: "month_time_test.flux", Source: "testing", Start: ast.Position{ Column: 54, Line: 53, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 53, }, File: "month_time_test.flux", Source: "loadMem", Start: ast.Position{ Column: 62, Line: 53, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 53, }, File: "month_time_test.flux", Source: "fn: t_time_month", Start: ast.Position{ Column: 85, Line: 53, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 53, }, File: "month_time_test.flux", Source: "fn", Start: ast.Position{ Column: 85, Line: 53, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 53, }, File: "month_time_test.flux", Source: "t_time_month", Start: ast.Position{ Column: 89, Line: 53, }, }, }, Name: "t_time_month", }, }}, 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: 103, Line: 53, }, File: "month_time_test.flux", Source: "test _time_month = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_month})", Start: ast.Position{ Column: 1, Line: 52, }, }, }, }}, 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: 4, }, File: "month_time_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: "month_time_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "month_time_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "month_time_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "month_time_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "month_time_test.flux", Source: "package date_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: 18, Line: 1, }, File: "month_time_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 41, }, File: "nanosecond_duration_test.flux", Source: "package date_test\n\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => 2030-01-01T00:00:00Z\n\ninData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"\noutData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,999999997\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,999999998\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,999999999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,2\n\"\nt_time_nanosecond = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.nanosecond(t: duration(v: r._value))}))\n\ntest _time_nanosecond = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_nanosecond})", 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: 40, Line: 7, }, File: "nanosecond_duration_test.flux", Source: "now = () => 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: "nanosecond_duration_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: 40, Line: 7, }, File: "nanosecond_duration_test.flux", Source: "() => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "nanosecond_duration_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 20, Line: 7, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "nanosecond_duration_test.flux", Source: "option now = () => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 21, }, File: "nanosecond_duration_test.flux", Source: "inData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\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: "nanosecond_duration_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: 21, }, File: "nanosecond_duration_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 5, Line: 10, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "nanosecond_duration_test.flux", Source: "outData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,999999997\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,999999998\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,999999999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,2\n\"", Start: ast.Position{ Column: 1, Line: 22, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 22, }, File: "nanosecond_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 22, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "nanosecond_duration_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,999999997\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,999999998\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,999999999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,2\n\"", Start: ast.Position{ Column: 5, Line: 23, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,999999997\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,999999998\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,999999999\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,2\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 88, Line: 38, }, File: "nanosecond_duration_test.flux", Source: "t_time_nanosecond = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.nanosecond(t: duration(v: r._value))}))", Start: ast.Position{ Column: 1, Line: 35, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 35, }, File: "nanosecond_duration_test.flux", Source: "t_time_nanosecond", Start: ast.Position{ Column: 1, Line: 35, }, }, }, Name: "t_time_nanosecond", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 88, Line: 38, }, File: "nanosecond_duration_test.flux", Source: "(table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.nanosecond(t: duration(v: r._value))}))", Start: ast.Position{ Column: 21, Line: 35, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 36, }, File: "nanosecond_duration_test.flux", Source: "table", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "start", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 25, Line: 37, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 12, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 37, }, File: "nanosecond_duration_test.flux", Source: "range", Start: ast.Position{ Column: 12, Line: 37, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 88, Line: 38, }, File: "nanosecond_duration_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.nanosecond(t: duration(v: r._value))}))", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 38, }, File: "nanosecond_duration_test.flux", Source: "fn: (r) => ({r with _value: date.nanosecond(t: duration(v: r._value))})", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 38, }, File: "nanosecond_duration_test.flux", Source: "fn: (r) => ({r with _value: date.nanosecond(t: duration(v: r._value))})", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 38, }, File: "nanosecond_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 38, }, File: "nanosecond_duration_test.flux", Source: "(r) => ({r with _value: date.nanosecond(t: duration(v: r._value))})", Start: ast.Position{ Column: 20, Line: 38, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 38, }, File: "nanosecond_duration_test.flux", Source: "({r with _value: date.nanosecond(t: duration(v: r._value))})", Start: ast.Position{ Column: 27, Line: 38, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 86, Line: 38, }, File: "nanosecond_duration_test.flux", Source: "{r with _value: date.nanosecond(t: duration(v: r._value))}", Start: ast.Position{ Column: 28, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 85, Line: 38, }, File: "nanosecond_duration_test.flux", Source: "_value: date.nanosecond(t: duration(v: r._value))", Start: ast.Position{ Column: 36, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 38, }, File: "nanosecond_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 36, 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: 84, Line: 38, }, File: "nanosecond_duration_test.flux", Source: "t: duration(v: r._value)", Start: ast.Position{ Column: 60, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 38, }, File: "nanosecond_duration_test.flux", Source: "t: duration(v: r._value)", Start: ast.Position{ Column: 60, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 38, }, File: "nanosecond_duration_test.flux", Source: "t", Start: ast.Position{ Column: 60, Line: 38, }, }, }, Name: "t", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 38, }, File: "nanosecond_duration_test.flux", Source: "v: r._value", Start: ast.Position{ Column: 72, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 38, }, File: "nanosecond_duration_test.flux", Source: "v: r._value", Start: ast.Position{ Column: 72, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 38, }, File: "nanosecond_duration_test.flux", Source: "v", Start: ast.Position{ Column: 72, Line: 38, }, }, }, Name: "v", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 38, }, File: "nanosecond_duration_test.flux", Source: "r._value", Start: ast.Position{ Column: 75, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 38, }, File: "nanosecond_duration_test.flux", Source: "r", Start: ast.Position{ Column: 75, Line: 38, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 38, }, File: "nanosecond_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 77, Line: 38, }, }, }, Name: "_value", }, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 38, }, File: "nanosecond_duration_test.flux", Source: "duration(v: r._value)", Start: ast.Position{ Column: 63, Line: 38, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 38, }, File: "nanosecond_duration_test.flux", Source: "duration", Start: ast.Position{ Column: 63, Line: 38, }, }, }, Name: "duration", }, Lparen: nil, Rparen: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 85, Line: 38, }, File: "nanosecond_duration_test.flux", Source: "date.nanosecond(t: duration(v: r._value))", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 38, }, File: "nanosecond_duration_test.flux", Source: "date.nanosecond", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 38, }, File: "nanosecond_duration_test.flux", Source: "date", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 38, }, File: "nanosecond_duration_test.flux", Source: "nanosecond", Start: ast.Position{ Column: 49, Line: 38, }, }, }, Name: "nanosecond", }, 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: 30, Line: 38, }, File: "nanosecond_duration_test.flux", Source: "r", Start: ast.Position{ Column: 29, 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: 22, Line: 38, }, File: "nanosecond_duration_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 38, }, File: "nanosecond_duration_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 38, }, }, }, 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: 88, Line: 38, }, File: "nanosecond_duration_test.flux", Source: "map(fn: (r) => ({r with _value: date.nanosecond(t: duration(v: r._value))}))", Start: ast.Position{ Column: 12, Line: 38, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 38, }, File: "nanosecond_duration_test.flux", Source: "map", Start: ast.Position{ Column: 12, Line: 38, }, }, }, 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: 30, Line: 35, }, File: "nanosecond_duration_test.flux", Source: "table=<-", Start: ast.Position{ Column: 22, Line: 35, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 35, }, File: "nanosecond_duration_test.flux", Source: "table", Start: ast.Position{ Column: 22, Line: 35, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 35, }, File: "nanosecond_duration_test.flux", Source: "<-", Start: ast.Position{ Column: 28, Line: 35, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 41, }, File: "nanosecond_duration_test.flux", Source: "_time_nanosecond = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_nanosecond})", Start: ast.Position{ Column: 6, Line: 40, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 40, }, File: "nanosecond_duration_test.flux", Source: "_time_nanosecond", Start: ast.Position{ Column: 6, Line: 40, }, }, }, Name: "_time_nanosecond", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 41, }, File: "nanosecond_duration_test.flux", Source: "() =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_nanosecond})", Start: ast.Position{ Column: 25, Line: 40, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 41, }, File: "nanosecond_duration_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_nanosecond})", Start: ast.Position{ Column: 5, Line: 41, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 41, }, File: "nanosecond_duration_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_nanosecond}", Start: ast.Position{ Column: 6, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 41, }, File: "nanosecond_duration_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 7, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 41, }, File: "nanosecond_duration_test.flux", Source: "input", Start: ast.Position{ Column: 7, 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: 45, Line: 41, }, File: "nanosecond_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 41, }, File: "nanosecond_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 41, }, File: "nanosecond_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 41, }, File: "nanosecond_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 39, Line: 41, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 41, }, File: "nanosecond_duration_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 41, }, File: "nanosecond_duration_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 41, }, File: "nanosecond_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 41, }, File: "nanosecond_duration_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 22, 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: 83, Line: 41, }, File: "nanosecond_duration_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 48, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 41, }, File: "nanosecond_duration_test.flux", Source: "want", Start: ast.Position{ Column: 48, 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: 82, Line: 41, }, File: "nanosecond_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 41, }, File: "nanosecond_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 41, }, File: "nanosecond_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 41, }, File: "nanosecond_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 75, Line: 41, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 41, }, File: "nanosecond_duration_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 41, }, File: "nanosecond_duration_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 41, }, File: "nanosecond_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 41, }, File: "nanosecond_duration_test.flux", Source: "loadMem", Start: ast.Position{ Column: 62, 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: 106, Line: 41, }, File: "nanosecond_duration_test.flux", Source: "fn: t_time_nanosecond", Start: ast.Position{ Column: 85, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 41, }, File: "nanosecond_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 85, Line: 41, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 41, }, File: "nanosecond_duration_test.flux", Source: "t_time_nanosecond", Start: ast.Position{ Column: 89, Line: 41, }, }, }, Name: "t_time_nanosecond", }, }}, 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: 41, }, File: "nanosecond_duration_test.flux", Source: "test _time_nanosecond = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_nanosecond})", 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: 4, }, File: "nanosecond_duration_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: "nanosecond_duration_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "nanosecond_duration_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "nanosecond_duration_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "nanosecond_duration_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "nanosecond_duration_test.flux", Source: "package date_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: 18, Line: 1, }, File: "nanosecond_duration_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 59, }, File: "nanosecond_time_test.flux", Source: "package date_test\n\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => 2030-01-01T00:00:00Z\n\ninData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,1\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,1\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,1\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,1\n,,1,2018-05-22T19:07:00.819823471Z,_m,QQ,1\n,,1,2018-05-22T19:08:00.587284314Z,_m,QQ,1\n,,1,2018-05-22T19:09:00.984375238Z,_m,QQ,1\n,,1,2018-05-22T19:10:00.723847562Z,_m,QQ,1\n,,1,2018-05-22T19:13:00.192983472Z,_m,QQ,1\n,,1,2018-05-22T19:15:00.712938413Z,_m,QQ,1\n,,1,2018-05-22T19:20:00.062103483Z,_m,QQ,1\n,,1,2018-05-22T19:23:00.786432256Z,_m,QQ,1\n,,1,2018-05-22T19:25:00.823748524Z,_m,QQ,1\n\"\noutData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,254819212\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,748691723\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,947182316\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,538816341\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,676423456\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,982342357\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:07:00.819823471Z,819823471\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:08:00.587284314Z,587284314\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:09:00.984375238Z,984375238\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:10:00.723847562Z,723847562\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:13:00.192983472Z,192983472\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:15:00.712938413Z,712938413\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:20:00.062103483Z,062103483\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:23:00.786432256Z,786432256\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:25:00.823748524Z,823748524\n\"\nt_time_nanosecond = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.nanosecond(t: r._time)}))\n\ntest _time_nanosecond = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_nanosecond})", 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: 40, Line: 7, }, File: "nanosecond_time_test.flux", Source: "now = () => 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: "nanosecond_time_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: 40, Line: 7, }, File: "nanosecond_time_test.flux", Source: "() => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "nanosecond_time_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 20, Line: 7, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "nanosecond_time_test.flux", Source: "option now = () => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 30, }, File: "nanosecond_time_test.flux", Source: "inData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,1\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,1\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,1\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,1\n,,1,2018-05-22T19:07:00.819823471Z,_m,QQ,1\n,,1,2018-05-22T19:08:00.587284314Z,_m,QQ,1\n,,1,2018-05-22T19:09:00.984375238Z,_m,QQ,1\n,,1,2018-05-22T19:10:00.723847562Z,_m,QQ,1\n,,1,2018-05-22T19:13:00.192983472Z,_m,QQ,1\n,,1,2018-05-22T19:15:00.712938413Z,_m,QQ,1\n,,1,2018-05-22T19:20:00.062103483Z,_m,QQ,1\n,,1,2018-05-22T19:23:00.786432256Z,_m,QQ,1\n,,1,2018-05-22T19:25:00.823748524Z,_m,QQ,1\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: "nanosecond_time_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: 30, }, File: "nanosecond_time_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,1\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,1\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,1\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,1\n,,1,2018-05-22T19:07:00.819823471Z,_m,QQ,1\n,,1,2018-05-22T19:08:00.587284314Z,_m,QQ,1\n,,1,2018-05-22T19:09:00.984375238Z,_m,QQ,1\n,,1,2018-05-22T19:10:00.723847562Z,_m,QQ,1\n,,1,2018-05-22T19:13:00.192983472Z,_m,QQ,1\n,,1,2018-05-22T19:15:00.712938413Z,_m,QQ,1\n,,1,2018-05-22T19:20:00.062103483Z,_m,QQ,1\n,,1,2018-05-22T19:23:00.786432256Z,_m,QQ,1\n,,1,2018-05-22T19:25:00.823748524Z,_m,QQ,1\n\"", Start: ast.Position{ Column: 5, Line: 10, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,1\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,1\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,1\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,1\n,,1,2018-05-22T19:07:00.819823471Z,_m,QQ,1\n,,1,2018-05-22T19:08:00.587284314Z,_m,QQ,1\n,,1,2018-05-22T19:09:00.984375238Z,_m,QQ,1\n,,1,2018-05-22T19:10:00.723847562Z,_m,QQ,1\n,,1,2018-05-22T19:13:00.192983472Z,_m,QQ,1\n,,1,2018-05-22T19:15:00.712938413Z,_m,QQ,1\n,,1,2018-05-22T19:20:00.062103483Z,_m,QQ,1\n,,1,2018-05-22T19:23:00.786432256Z,_m,QQ,1\n,,1,2018-05-22T19:25:00.823748524Z,_m,QQ,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 52, }, File: "nanosecond_time_test.flux", Source: "outData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,254819212\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,748691723\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,947182316\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,538816341\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,676423456\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,982342357\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:07:00.819823471Z,819823471\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:08:00.587284314Z,587284314\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:09:00.984375238Z,984375238\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:10:00.723847562Z,723847562\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:13:00.192983472Z,192983472\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:15:00.712938413Z,712938413\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:20:00.062103483Z,062103483\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:23:00.786432256Z,786432256\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:25:00.823748524Z,823748524\n\"", Start: ast.Position{ Column: 1, Line: 31, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 31, }, File: "nanosecond_time_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 31, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 52, }, File: "nanosecond_time_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,254819212\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,748691723\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,947182316\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,538816341\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,676423456\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,982342357\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:07:00.819823471Z,819823471\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:08:00.587284314Z,587284314\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:09:00.984375238Z,984375238\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:10:00.723847562Z,723847562\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:13:00.192983472Z,192983472\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:15:00.712938413Z,712938413\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:20:00.062103483Z,062103483\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:23:00.786432256Z,786432256\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:25:00.823748524Z,823748524\n\"", Start: ast.Position{ Column: 5, Line: 32, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,254819212\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,748691723\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,947182316\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,538816341\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,676423456\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,982342357\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:07:00.819823471Z,819823471\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:08:00.587284314Z,587284314\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:09:00.984375238Z,984375238\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:10:00.723847562Z,723847562\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:13:00.192983472Z,192983472\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:15:00.712938413Z,712938413\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:20:00.062103483Z,062103483\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:23:00.786432256Z,786432256\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:25:00.823748524Z,823748524\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 56, }, File: "nanosecond_time_test.flux", Source: "t_time_nanosecond = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.nanosecond(t: r._time)}))", Start: ast.Position{ Column: 1, Line: 53, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 53, }, File: "nanosecond_time_test.flux", Source: "t_time_nanosecond", Start: ast.Position{ Column: 1, Line: 53, }, }, }, Name: "t_time_nanosecond", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 56, }, File: "nanosecond_time_test.flux", Source: "(table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.nanosecond(t: r._time)}))", Start: ast.Position{ Column: 21, Line: 53, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 54, }, File: "nanosecond_time_test.flux", Source: "table", Start: ast.Position{ Column: 5, Line: 54, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 55, }, File: "nanosecond_time_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 5, Line: 54, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 55, }, File: "nanosecond_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 55, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 55, }, File: "nanosecond_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 55, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 55, }, File: "nanosecond_time_test.flux", Source: "start", Start: ast.Position{ Column: 18, Line: 55, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 55, }, File: "nanosecond_time_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 25, Line: 55, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 55, }, File: "nanosecond_time_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 12, Line: 55, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 55, }, File: "nanosecond_time_test.flux", Source: "range", Start: ast.Position{ Column: 12, Line: 55, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 74, Line: 56, }, File: "nanosecond_time_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.nanosecond(t: r._time)}))", Start: ast.Position{ Column: 5, Line: 54, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 56, }, File: "nanosecond_time_test.flux", Source: "fn: (r) => ({r with _value: date.nanosecond(t: r._time)})", Start: ast.Position{ Column: 16, Line: 56, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 56, }, File: "nanosecond_time_test.flux", Source: "fn: (r) => ({r with _value: date.nanosecond(t: r._time)})", Start: ast.Position{ Column: 16, Line: 56, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 56, }, File: "nanosecond_time_test.flux", Source: "fn", Start: ast.Position{ Column: 16, Line: 56, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 56, }, File: "nanosecond_time_test.flux", Source: "(r) => ({r with _value: date.nanosecond(t: r._time)})", Start: ast.Position{ Column: 20, Line: 56, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 56, }, File: "nanosecond_time_test.flux", Source: "({r with _value: date.nanosecond(t: r._time)})", Start: ast.Position{ Column: 27, Line: 56, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 56, }, File: "nanosecond_time_test.flux", Source: "{r with _value: date.nanosecond(t: r._time)}", Start: ast.Position{ Column: 28, Line: 56, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 56, }, File: "nanosecond_time_test.flux", Source: "_value: date.nanosecond(t: r._time)", Start: ast.Position{ Column: 36, Line: 56, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 56, }, File: "nanosecond_time_test.flux", Source: "_value", Start: ast.Position{ Column: 36, Line: 56, }, }, }, 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: 70, Line: 56, }, File: "nanosecond_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 60, Line: 56, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 56, }, File: "nanosecond_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 60, Line: 56, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 56, }, File: "nanosecond_time_test.flux", Source: "t", Start: ast.Position{ Column: 60, Line: 56, }, }, }, Name: "t", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 56, }, File: "nanosecond_time_test.flux", Source: "r._time", Start: ast.Position{ Column: 63, Line: 56, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 56, }, File: "nanosecond_time_test.flux", Source: "r", Start: ast.Position{ Column: 63, Line: 56, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 56, }, File: "nanosecond_time_test.flux", Source: "_time", Start: ast.Position{ Column: 65, Line: 56, }, }, }, Name: "_time", }, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 56, }, File: "nanosecond_time_test.flux", Source: "date.nanosecond(t: r._time)", Start: ast.Position{ Column: 44, Line: 56, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 56, }, File: "nanosecond_time_test.flux", Source: "date.nanosecond", Start: ast.Position{ Column: 44, Line: 56, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 56, }, File: "nanosecond_time_test.flux", Source: "date", Start: ast.Position{ Column: 44, Line: 56, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 59, Line: 56, }, File: "nanosecond_time_test.flux", Source: "nanosecond", Start: ast.Position{ Column: 49, Line: 56, }, }, }, Name: "nanosecond", }, 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: 30, Line: 56, }, File: "nanosecond_time_test.flux", Source: "r", Start: ast.Position{ Column: 29, Line: 56, }, }, }, 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: 22, Line: 56, }, File: "nanosecond_time_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 56, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 56, }, File: "nanosecond_time_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 56, }, }, }, 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: 74, Line: 56, }, File: "nanosecond_time_test.flux", Source: "map(fn: (r) => ({r with _value: date.nanosecond(t: r._time)}))", Start: ast.Position{ Column: 12, Line: 56, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 56, }, File: "nanosecond_time_test.flux", Source: "map", Start: ast.Position{ Column: 12, Line: 56, }, }, }, 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: 30, Line: 53, }, File: "nanosecond_time_test.flux", Source: "table=<-", Start: ast.Position{ Column: 22, Line: 53, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 53, }, File: "nanosecond_time_test.flux", Source: "table", Start: ast.Position{ Column: 22, Line: 53, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 53, }, File: "nanosecond_time_test.flux", Source: "<-", Start: ast.Position{ Column: 28, Line: 53, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 59, }, File: "nanosecond_time_test.flux", Source: "_time_nanosecond = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_nanosecond})", Start: ast.Position{ Column: 6, Line: 58, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 58, }, File: "nanosecond_time_test.flux", Source: "_time_nanosecond", Start: ast.Position{ Column: 6, Line: 58, }, }, }, Name: "_time_nanosecond", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 59, }, File: "nanosecond_time_test.flux", Source: "() =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_nanosecond})", Start: ast.Position{ Column: 25, Line: 58, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 59, }, File: "nanosecond_time_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_nanosecond})", Start: ast.Position{ Column: 5, Line: 59, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 59, }, File: "nanosecond_time_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_nanosecond}", Start: ast.Position{ Column: 6, Line: 59, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 59, }, File: "nanosecond_time_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 7, Line: 59, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 59, }, File: "nanosecond_time_test.flux", Source: "input", Start: ast.Position{ Column: 7, Line: 59, }, }, }, 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: 59, }, File: "nanosecond_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 59, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 59, }, File: "nanosecond_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 59, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 59, }, File: "nanosecond_time_test.flux", Source: "csv", Start: ast.Position{ Column: 34, Line: 59, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 59, }, File: "nanosecond_time_test.flux", Source: "inData", Start: ast.Position{ Column: 39, Line: 59, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 59, }, File: "nanosecond_time_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 14, Line: 59, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 59, }, File: "nanosecond_time_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 14, Line: 59, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 59, }, File: "nanosecond_time_test.flux", Source: "testing", Start: ast.Position{ Column: 14, Line: 59, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 59, }, File: "nanosecond_time_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 22, Line: 59, }, }, }, 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: 59, }, File: "nanosecond_time_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 48, Line: 59, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 59, }, File: "nanosecond_time_test.flux", Source: "want", Start: ast.Position{ Column: 48, Line: 59, }, }, }, 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: 59, }, File: "nanosecond_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 59, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 59, }, File: "nanosecond_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 59, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 59, }, File: "nanosecond_time_test.flux", Source: "csv", Start: ast.Position{ Column: 70, Line: 59, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 59, }, File: "nanosecond_time_test.flux", Source: "outData", Start: ast.Position{ Column: 75, Line: 59, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 59, }, File: "nanosecond_time_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 54, Line: 59, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 59, }, File: "nanosecond_time_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 54, Line: 59, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 59, }, File: "nanosecond_time_test.flux", Source: "testing", Start: ast.Position{ Column: 54, Line: 59, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 59, }, File: "nanosecond_time_test.flux", Source: "loadMem", Start: ast.Position{ Column: 62, Line: 59, }, }, }, 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: 59, }, File: "nanosecond_time_test.flux", Source: "fn: t_time_nanosecond", Start: ast.Position{ Column: 85, Line: 59, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 59, }, File: "nanosecond_time_test.flux", Source: "fn", Start: ast.Position{ Column: 85, Line: 59, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 59, }, File: "nanosecond_time_test.flux", Source: "t_time_nanosecond", Start: ast.Position{ Column: 89, Line: 59, }, }, }, Name: "t_time_nanosecond", }, }}, 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: 59, }, File: "nanosecond_time_test.flux", Source: "test _time_nanosecond = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_nanosecond})", Start: ast.Position{ Column: 1, Line: 58, }, }, }, }}, 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: 4, }, File: "nanosecond_time_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: "nanosecond_time_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "nanosecond_time_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "nanosecond_time_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "nanosecond_time_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "nanosecond_time_test.flux", Source: "package date_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: 18, Line: 1, }, File: "nanosecond_time_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 109, Line: 41, }, File: "quarter_duration_test.flux", Source: "package date_test\n\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => 2030-01-01T00:00:00Z\n\ninData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"\noutData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n\"\nt_duration_quarter = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.quarter(t: duration(v: r._value))}))\n\ntest _duration_quarter = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_quarter})", 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: 40, Line: 7, }, File: "quarter_duration_test.flux", Source: "now = () => 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: "quarter_duration_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: 40, Line: 7, }, File: "quarter_duration_test.flux", Source: "() => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "quarter_duration_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 20, Line: 7, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "quarter_duration_test.flux", Source: "option now = () => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 21, }, File: "quarter_duration_test.flux", Source: "inData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\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: "quarter_duration_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: 21, }, File: "quarter_duration_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 5, Line: 10, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "quarter_duration_test.flux", Source: "outData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n\"", Start: ast.Position{ Column: 1, Line: 22, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 22, }, File: "quarter_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 22, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "quarter_duration_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n\"", Start: ast.Position{ Column: 5, Line: 23, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 85, Line: 38, }, File: "quarter_duration_test.flux", Source: "t_duration_quarter = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.quarter(t: duration(v: r._value))}))", Start: ast.Position{ Column: 1, Line: 35, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 35, }, File: "quarter_duration_test.flux", Source: "t_duration_quarter", Start: ast.Position{ Column: 1, Line: 35, }, }, }, Name: "t_duration_quarter", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 85, Line: 38, }, File: "quarter_duration_test.flux", Source: "(table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.quarter(t: duration(v: r._value))}))", Start: ast.Position{ Column: 22, Line: 35, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 36, }, File: "quarter_duration_test.flux", Source: "table", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 37, }, File: "quarter_duration_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "quarter_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "quarter_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 37, }, File: "quarter_duration_test.flux", Source: "start", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "quarter_duration_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 25, Line: 37, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 37, }, File: "quarter_duration_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 12, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 37, }, File: "quarter_duration_test.flux", Source: "range", Start: ast.Position{ Column: 12, Line: 37, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 85, Line: 38, }, File: "quarter_duration_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.quarter(t: duration(v: r._value))}))", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 38, }, File: "quarter_duration_test.flux", Source: "fn: (r) => ({r with _value: date.quarter(t: duration(v: r._value))})", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 38, }, File: "quarter_duration_test.flux", Source: "fn: (r) => ({r with _value: date.quarter(t: duration(v: r._value))})", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 38, }, File: "quarter_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 38, }, File: "quarter_duration_test.flux", Source: "(r) => ({r with _value: date.quarter(t: duration(v: r._value))})", Start: ast.Position{ Column: 20, Line: 38, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 38, }, File: "quarter_duration_test.flux", Source: "({r with _value: date.quarter(t: duration(v: r._value))})", Start: ast.Position{ Column: 27, Line: 38, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 38, }, File: "quarter_duration_test.flux", Source: "{r with _value: date.quarter(t: duration(v: r._value))}", Start: ast.Position{ Column: 28, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 38, }, File: "quarter_duration_test.flux", Source: "_value: date.quarter(t: duration(v: r._value))", Start: ast.Position{ Column: 36, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 38, }, File: "quarter_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 36, 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: 81, Line: 38, }, File: "quarter_duration_test.flux", Source: "t: duration(v: r._value)", Start: ast.Position{ Column: 57, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 38, }, File: "quarter_duration_test.flux", Source: "t: duration(v: r._value)", Start: ast.Position{ Column: 57, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 38, }, File: "quarter_duration_test.flux", Source: "t", Start: ast.Position{ Column: 57, Line: 38, }, }, }, Name: "t", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 38, }, File: "quarter_duration_test.flux", Source: "v: r._value", Start: ast.Position{ Column: 69, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 38, }, File: "quarter_duration_test.flux", Source: "v: r._value", Start: ast.Position{ Column: 69, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 38, }, File: "quarter_duration_test.flux", Source: "v", Start: ast.Position{ Column: 69, Line: 38, }, }, }, Name: "v", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 38, }, File: "quarter_duration_test.flux", Source: "r._value", Start: ast.Position{ Column: 72, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 38, }, File: "quarter_duration_test.flux", Source: "r", Start: ast.Position{ Column: 72, Line: 38, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 38, }, File: "quarter_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 74, Line: 38, }, }, }, Name: "_value", }, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 38, }, File: "quarter_duration_test.flux", Source: "duration(v: r._value)", Start: ast.Position{ Column: 60, Line: 38, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 38, }, File: "quarter_duration_test.flux", Source: "duration", Start: ast.Position{ Column: 60, Line: 38, }, }, }, Name: "duration", }, Lparen: nil, Rparen: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 38, }, File: "quarter_duration_test.flux", Source: "date.quarter(t: duration(v: r._value))", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 56, Line: 38, }, File: "quarter_duration_test.flux", Source: "date.quarter", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 38, }, File: "quarter_duration_test.flux", Source: "date", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 56, Line: 38, }, File: "quarter_duration_test.flux", Source: "quarter", Start: ast.Position{ Column: 49, Line: 38, }, }, }, Name: "quarter", }, 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: 30, Line: 38, }, File: "quarter_duration_test.flux", Source: "r", Start: ast.Position{ Column: 29, 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: 22, Line: 38, }, File: "quarter_duration_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 38, }, File: "quarter_duration_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 38, }, }, }, 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: 85, Line: 38, }, File: "quarter_duration_test.flux", Source: "map(fn: (r) => ({r with _value: date.quarter(t: duration(v: r._value))}))", Start: ast.Position{ Column: 12, Line: 38, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 38, }, File: "quarter_duration_test.flux", Source: "map", Start: ast.Position{ Column: 12, Line: 38, }, }, }, 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: 31, Line: 35, }, File: "quarter_duration_test.flux", Source: "table=<-", Start: ast.Position{ Column: 23, Line: 35, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 35, }, File: "quarter_duration_test.flux", Source: "table", Start: ast.Position{ Column: 23, Line: 35, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 31, Line: 35, }, File: "quarter_duration_test.flux", Source: "<-", Start: ast.Position{ Column: 29, Line: 35, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 109, Line: 41, }, File: "quarter_duration_test.flux", Source: "_duration_quarter = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_quarter})", 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: "quarter_duration_test.flux", Source: "_duration_quarter", Start: ast.Position{ Column: 6, Line: 40, }, }, }, Name: "_duration_quarter", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 109, Line: 41, }, File: "quarter_duration_test.flux", Source: "() =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_quarter})", Start: ast.Position{ Column: 26, Line: 40, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 109, Line: 41, }, File: "quarter_duration_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_quarter})", Start: ast.Position{ Column: 5, Line: 41, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 41, }, File: "quarter_duration_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_quarter}", Start: ast.Position{ Column: 6, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 41, }, File: "quarter_duration_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 7, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 41, }, File: "quarter_duration_test.flux", Source: "input", Start: ast.Position{ Column: 7, 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: 45, Line: 41, }, File: "quarter_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 41, }, File: "quarter_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 41, }, File: "quarter_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 41, }, File: "quarter_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 39, Line: 41, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 41, }, File: "quarter_duration_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 41, }, File: "quarter_duration_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 41, }, File: "quarter_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 41, }, File: "quarter_duration_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 22, 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: 83, Line: 41, }, File: "quarter_duration_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 48, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 41, }, File: "quarter_duration_test.flux", Source: "want", Start: ast.Position{ Column: 48, 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: 82, Line: 41, }, File: "quarter_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 41, }, File: "quarter_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 41, }, File: "quarter_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 41, }, File: "quarter_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 75, Line: 41, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 41, }, File: "quarter_duration_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 41, }, File: "quarter_duration_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 41, }, File: "quarter_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 41, }, File: "quarter_duration_test.flux", Source: "loadMem", Start: ast.Position{ Column: 62, 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: 107, Line: 41, }, File: "quarter_duration_test.flux", Source: "fn: t_duration_quarter", Start: ast.Position{ Column: 85, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 41, }, File: "quarter_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 85, Line: 41, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 41, }, File: "quarter_duration_test.flux", Source: "t_duration_quarter", Start: ast.Position{ Column: 89, Line: 41, }, }, }, Name: "t_duration_quarter", }, }}, 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: 109, Line: 41, }, File: "quarter_duration_test.flux", Source: "test _duration_quarter = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_quarter})", 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: 4, }, File: "quarter_duration_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: "quarter_duration_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "quarter_duration_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "quarter_duration_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "quarter_duration_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "quarter_duration_test.flux", Source: "package date_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: 18, Line: 1, }, File: "quarter_duration_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 53, }, File: "quarter_time_test.flux", Source: "package date_test\n\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => 2030-01-01T00:00:00Z\n\ninData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-01-22T19:53:00Z,_m,FF,1\n,,0,2018-02-22T19:53:10Z,_m,FF,1\n,,0,2018-03-22T19:53:20Z,_m,FF,1\n,,0,2018-04-22T19:53:30Z,_m,FF,1\n,,0,2018-05-22T19:53:40Z,_m,FF,1\n,,0,2018-06-22T19:53:50Z,_m,FF,1\n,,1,2018-07-22T19:53:00Z,_m,QQ,1\n,,1,2018-08-22T19:53:10Z,_m,QQ,1\n,,1,2018-09-22T19:53:20Z,_m,QQ,1\n,,1,2018-10-22T19:53:30Z,_m,QQ,1\n,,1,2018-11-22T19:53:40Z,_m,QQ,1\n,,1,2018-12-22T19:53:50Z,_m,QQ,1\n\"\noutData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-01-22T19:53:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-02-22T19:53:10Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-03-22T19:53:20Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-04-22T19:53:30Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:40Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-06-22T19:53:50Z,2\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-07-22T19:53:00Z,3\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-08-22T19:53:10Z,3\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-09-22T19:53:20Z,3\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-10-22T19:53:30Z,4\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-11-22T19:53:40Z,4\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-12-22T19:53:50Z,4\n\"\nt_time_quarter = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.quarter(t: r._time)}))\n\ntest _time_quarter = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_quarter})", 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: 40, Line: 7, }, File: "quarter_time_test.flux", Source: "now = () => 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: "quarter_time_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: 40, Line: 7, }, File: "quarter_time_test.flux", Source: "() => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "quarter_time_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 20, Line: 7, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "quarter_time_test.flux", Source: "option now = () => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 27, }, File: "quarter_time_test.flux", Source: "inData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-01-22T19:53:00Z,_m,FF,1\n,,0,2018-02-22T19:53:10Z,_m,FF,1\n,,0,2018-03-22T19:53:20Z,_m,FF,1\n,,0,2018-04-22T19:53:30Z,_m,FF,1\n,,0,2018-05-22T19:53:40Z,_m,FF,1\n,,0,2018-06-22T19:53:50Z,_m,FF,1\n,,1,2018-07-22T19:53:00Z,_m,QQ,1\n,,1,2018-08-22T19:53:10Z,_m,QQ,1\n,,1,2018-09-22T19:53:20Z,_m,QQ,1\n,,1,2018-10-22T19:53:30Z,_m,QQ,1\n,,1,2018-11-22T19:53:40Z,_m,QQ,1\n,,1,2018-12-22T19:53:50Z,_m,QQ,1\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: "quarter_time_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: 27, }, File: "quarter_time_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-01-22T19:53:00Z,_m,FF,1\n,,0,2018-02-22T19:53:10Z,_m,FF,1\n,,0,2018-03-22T19:53:20Z,_m,FF,1\n,,0,2018-04-22T19:53:30Z,_m,FF,1\n,,0,2018-05-22T19:53:40Z,_m,FF,1\n,,0,2018-06-22T19:53:50Z,_m,FF,1\n,,1,2018-07-22T19:53:00Z,_m,QQ,1\n,,1,2018-08-22T19:53:10Z,_m,QQ,1\n,,1,2018-09-22T19:53:20Z,_m,QQ,1\n,,1,2018-10-22T19:53:30Z,_m,QQ,1\n,,1,2018-11-22T19:53:40Z,_m,QQ,1\n,,1,2018-12-22T19:53:50Z,_m,QQ,1\n\"", Start: ast.Position{ Column: 5, Line: 10, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-01-22T19:53:00Z,_m,FF,1\n,,0,2018-02-22T19:53:10Z,_m,FF,1\n,,0,2018-03-22T19:53:20Z,_m,FF,1\n,,0,2018-04-22T19:53:30Z,_m,FF,1\n,,0,2018-05-22T19:53:40Z,_m,FF,1\n,,0,2018-06-22T19:53:50Z,_m,FF,1\n,,1,2018-07-22T19:53:00Z,_m,QQ,1\n,,1,2018-08-22T19:53:10Z,_m,QQ,1\n,,1,2018-09-22T19:53:20Z,_m,QQ,1\n,,1,2018-10-22T19:53:30Z,_m,QQ,1\n,,1,2018-11-22T19:53:40Z,_m,QQ,1\n,,1,2018-12-22T19:53:50Z,_m,QQ,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 46, }, File: "quarter_time_test.flux", Source: "outData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-01-22T19:53:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-02-22T19:53:10Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-03-22T19:53:20Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-04-22T19:53:30Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:40Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-06-22T19:53:50Z,2\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-07-22T19:53:00Z,3\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-08-22T19:53:10Z,3\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-09-22T19:53:20Z,3\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-10-22T19:53:30Z,4\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-11-22T19:53:40Z,4\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-12-22T19:53:50Z,4\n\"", Start: ast.Position{ Column: 1, Line: 28, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 28, }, File: "quarter_time_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 28, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 46, }, File: "quarter_time_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-01-22T19:53:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-02-22T19:53:10Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-03-22T19:53:20Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-04-22T19:53:30Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:40Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-06-22T19:53:50Z,2\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-07-22T19:53:00Z,3\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-08-22T19:53:10Z,3\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-09-22T19:53:20Z,3\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-10-22T19:53:30Z,4\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-11-22T19:53:40Z,4\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-12-22T19:53:50Z,4\n\"", Start: ast.Position{ Column: 5, Line: 29, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-01-22T19:53:00Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-02-22T19:53:10Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-03-22T19:53:20Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-04-22T19:53:30Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:40Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-06-22T19:53:50Z,2\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-07-22T19:53:00Z,3\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-08-22T19:53:10Z,3\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-09-22T19:53:20Z,3\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-10-22T19:53:30Z,4\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-11-22T19:53:40Z,4\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-12-22T19:53:50Z,4\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 50, }, File: "quarter_time_test.flux", Source: "t_time_quarter = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.quarter(t: r._time)}))", Start: ast.Position{ Column: 1, Line: 47, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 47, }, File: "quarter_time_test.flux", Source: "t_time_quarter", Start: ast.Position{ Column: 1, Line: 47, }, }, }, Name: "t_time_quarter", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 50, }, File: "quarter_time_test.flux", Source: "(table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.quarter(t: r._time)}))", Start: ast.Position{ Column: 18, Line: 47, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 48, }, File: "quarter_time_test.flux", Source: "table", Start: ast.Position{ Column: 5, Line: 48, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 49, }, File: "quarter_time_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 5, Line: 48, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 49, }, File: "quarter_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, 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: "quarter_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 49, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 49, }, File: "quarter_time_test.flux", Source: "start", Start: ast.Position{ Column: 18, Line: 49, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 49, }, File: "quarter_time_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 25, Line: 49, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 49, }, File: "quarter_time_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 12, Line: 49, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 49, }, File: "quarter_time_test.flux", Source: "range", Start: ast.Position{ Column: 12, Line: 49, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 50, }, File: "quarter_time_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.quarter(t: r._time)}))", Start: ast.Position{ Column: 5, Line: 48, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 50, }, File: "quarter_time_test.flux", Source: "fn: (r) => ({r with _value: date.quarter(t: r._time)})", Start: ast.Position{ Column: 16, Line: 50, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 50, }, File: "quarter_time_test.flux", Source: "fn: (r) => ({r with _value: date.quarter(t: r._time)})", Start: ast.Position{ Column: 16, Line: 50, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 50, }, File: "quarter_time_test.flux", Source: "fn", Start: ast.Position{ Column: 16, Line: 50, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 50, }, File: "quarter_time_test.flux", Source: "(r) => ({r with _value: date.quarter(t: r._time)})", Start: ast.Position{ Column: 20, Line: 50, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 50, }, File: "quarter_time_test.flux", Source: "({r with _value: date.quarter(t: r._time)})", Start: ast.Position{ Column: 27, Line: 50, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 50, }, File: "quarter_time_test.flux", Source: "{r with _value: date.quarter(t: r._time)}", Start: ast.Position{ Column: 28, Line: 50, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 50, }, File: "quarter_time_test.flux", Source: "_value: date.quarter(t: r._time)", Start: ast.Position{ Column: 36, Line: 50, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 50, }, File: "quarter_time_test.flux", Source: "_value", Start: ast.Position{ Column: 36, Line: 50, }, }, }, 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: 67, Line: 50, }, File: "quarter_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 57, Line: 50, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 50, }, File: "quarter_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 57, Line: 50, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 50, }, File: "quarter_time_test.flux", Source: "t", Start: ast.Position{ Column: 57, Line: 50, }, }, }, Name: "t", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 50, }, File: "quarter_time_test.flux", Source: "r._time", Start: ast.Position{ Column: 60, Line: 50, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 50, }, File: "quarter_time_test.flux", Source: "r", Start: ast.Position{ Column: 60, Line: 50, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 50, }, File: "quarter_time_test.flux", Source: "_time", Start: ast.Position{ Column: 62, Line: 50, }, }, }, Name: "_time", }, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 50, }, File: "quarter_time_test.flux", Source: "date.quarter(t: r._time)", Start: ast.Position{ Column: 44, Line: 50, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 56, Line: 50, }, File: "quarter_time_test.flux", Source: "date.quarter", Start: ast.Position{ Column: 44, Line: 50, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 50, }, File: "quarter_time_test.flux", Source: "date", Start: ast.Position{ Column: 44, Line: 50, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 56, Line: 50, }, File: "quarter_time_test.flux", Source: "quarter", Start: ast.Position{ Column: 49, Line: 50, }, }, }, Name: "quarter", }, 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: 30, Line: 50, }, File: "quarter_time_test.flux", Source: "r", Start: ast.Position{ Column: 29, Line: 50, }, }, }, 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: 22, Line: 50, }, File: "quarter_time_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 50, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 50, }, File: "quarter_time_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 50, }, }, }, 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: 71, Line: 50, }, File: "quarter_time_test.flux", Source: "map(fn: (r) => ({r with _value: date.quarter(t: r._time)}))", Start: ast.Position{ Column: 12, Line: 50, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 50, }, File: "quarter_time_test.flux", Source: "map", Start: ast.Position{ Column: 12, Line: 50, }, }, }, 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: 27, Line: 47, }, File: "quarter_time_test.flux", Source: "table=<-", Start: ast.Position{ Column: 19, Line: 47, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 47, }, File: "quarter_time_test.flux", Source: "table", Start: ast.Position{ Column: 19, Line: 47, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 47, }, File: "quarter_time_test.flux", Source: "<-", Start: ast.Position{ Column: 25, Line: 47, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 53, }, File: "quarter_time_test.flux", Source: "_time_quarter = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_quarter})", Start: ast.Position{ Column: 6, Line: 52, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 19, Line: 52, }, File: "quarter_time_test.flux", Source: "_time_quarter", Start: ast.Position{ Column: 6, Line: 52, }, }, }, Name: "_time_quarter", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 53, }, File: "quarter_time_test.flux", Source: "() =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_quarter})", Start: ast.Position{ Column: 22, Line: 52, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 53, }, File: "quarter_time_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_quarter})", Start: ast.Position{ Column: 5, Line: 53, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 53, }, File: "quarter_time_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_quarter}", Start: ast.Position{ Column: 6, 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: "quarter_time_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 7, Line: 53, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 53, }, File: "quarter_time_test.flux", Source: "input", Start: ast.Position{ Column: 7, Line: 53, }, }, }, 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: 53, }, File: "quarter_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, 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: "quarter_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 53, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 53, }, File: "quarter_time_test.flux", Source: "csv", Start: ast.Position{ Column: 34, Line: 53, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 53, }, File: "quarter_time_test.flux", Source: "inData", Start: ast.Position{ Column: 39, Line: 53, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 53, }, File: "quarter_time_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 14, Line: 53, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 53, }, File: "quarter_time_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 14, Line: 53, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 53, }, File: "quarter_time_test.flux", Source: "testing", Start: ast.Position{ Column: 14, Line: 53, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 53, }, File: "quarter_time_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 22, Line: 53, }, }, }, 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: 53, }, File: "quarter_time_test.flux", Source: "want: testing.loadMem(csv: outData)", 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: 52, Line: 53, }, File: "quarter_time_test.flux", Source: "want", Start: ast.Position{ Column: 48, Line: 53, }, }, }, 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: 53, }, File: "quarter_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 53, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 53, }, File: "quarter_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 53, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 53, }, File: "quarter_time_test.flux", Source: "csv", Start: ast.Position{ Column: 70, Line: 53, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 53, }, File: "quarter_time_test.flux", Source: "outData", Start: ast.Position{ Column: 75, Line: 53, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 53, }, File: "quarter_time_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 54, Line: 53, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 53, }, File: "quarter_time_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 54, Line: 53, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 53, }, File: "quarter_time_test.flux", Source: "testing", Start: ast.Position{ Column: 54, Line: 53, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 53, }, File: "quarter_time_test.flux", Source: "loadMem", Start: ast.Position{ Column: 62, Line: 53, }, }, }, 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: 53, }, File: "quarter_time_test.flux", Source: "fn: t_time_quarter", Start: ast.Position{ Column: 85, Line: 53, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 53, }, File: "quarter_time_test.flux", Source: "fn", Start: ast.Position{ Column: 85, Line: 53, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 53, }, File: "quarter_time_test.flux", Source: "t_time_quarter", Start: ast.Position{ Column: 89, Line: 53, }, }, }, Name: "t_time_quarter", }, }}, 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: 53, }, File: "quarter_time_test.flux", Source: "test _time_quarter = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_quarter})", Start: ast.Position{ Column: 1, Line: 52, }, }, }, }}, 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: 4, }, File: "quarter_time_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: "quarter_time_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "quarter_time_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "quarter_time_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "quarter_time_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "quarter_time_test.flux", Source: "package date_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: 18, Line: 1, }, File: "quarter_time_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 41, }, File: "second_duration_test.flux", Source: "package date_test\n\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => 2030-01-01T00:00:00Z\n\ninData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"\noutData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n\"\nt_duration_second = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.second(t: duration(v: r._value))}))\n\ntest _duration_second = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_second})", 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: 40, Line: 7, }, File: "second_duration_test.flux", Source: "now = () => 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: "second_duration_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: 40, Line: 7, }, File: "second_duration_test.flux", Source: "() => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "second_duration_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 20, Line: 7, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "second_duration_test.flux", Source: "option now = () => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 21, }, File: "second_duration_test.flux", Source: "inData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\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: "second_duration_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: 21, }, File: "second_duration_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 5, Line: 10, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "second_duration_test.flux", Source: "outData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n\"", Start: ast.Position{ Column: 1, Line: 22, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 22, }, File: "second_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 22, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "second_duration_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n\"", Start: ast.Position{ Column: 5, Line: 23, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,59\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,0\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 38, }, File: "second_duration_test.flux", Source: "t_duration_second = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.second(t: duration(v: r._value))}))", Start: ast.Position{ Column: 1, Line: 35, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 35, }, File: "second_duration_test.flux", Source: "t_duration_second", Start: ast.Position{ Column: 1, Line: 35, }, }, }, Name: "t_duration_second", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 38, }, File: "second_duration_test.flux", Source: "(table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.second(t: duration(v: r._value))}))", Start: ast.Position{ Column: 21, Line: 35, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 36, }, File: "second_duration_test.flux", Source: "table", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 37, }, File: "second_duration_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "second_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "second_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 37, }, File: "second_duration_test.flux", Source: "start", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "second_duration_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 25, Line: 37, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 37, }, File: "second_duration_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 12, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 37, }, File: "second_duration_test.flux", Source: "range", Start: ast.Position{ Column: 12, Line: 37, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 38, }, File: "second_duration_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.second(t: duration(v: r._value))}))", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 38, }, File: "second_duration_test.flux", Source: "fn: (r) => ({r with _value: date.second(t: duration(v: r._value))})", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 38, }, File: "second_duration_test.flux", Source: "fn: (r) => ({r with _value: date.second(t: duration(v: r._value))})", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 38, }, File: "second_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 38, }, File: "second_duration_test.flux", Source: "(r) => ({r with _value: date.second(t: duration(v: r._value))})", Start: ast.Position{ Column: 20, Line: 38, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 38, }, File: "second_duration_test.flux", Source: "({r with _value: date.second(t: duration(v: r._value))})", Start: ast.Position{ Column: 27, Line: 38, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 38, }, File: "second_duration_test.flux", Source: "{r with _value: date.second(t: duration(v: r._value))}", Start: ast.Position{ Column: 28, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 38, }, File: "second_duration_test.flux", Source: "_value: date.second(t: duration(v: r._value))", Start: ast.Position{ Column: 36, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 38, }, File: "second_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 36, 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: 80, Line: 38, }, File: "second_duration_test.flux", Source: "t: duration(v: r._value)", Start: ast.Position{ Column: 56, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 38, }, File: "second_duration_test.flux", Source: "t: duration(v: r._value)", Start: ast.Position{ Column: 56, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 57, Line: 38, }, File: "second_duration_test.flux", Source: "t", Start: ast.Position{ Column: 56, Line: 38, }, }, }, Name: "t", }, 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: 38, }, File: "second_duration_test.flux", Source: "v: r._value", Start: ast.Position{ Column: 68, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 38, }, File: "second_duration_test.flux", Source: "v: r._value", Start: ast.Position{ Column: 68, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 38, }, File: "second_duration_test.flux", Source: "v", Start: ast.Position{ Column: 68, Line: 38, }, }, }, Name: "v", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 38, }, File: "second_duration_test.flux", Source: "r._value", Start: ast.Position{ Column: 71, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 72, Line: 38, }, File: "second_duration_test.flux", Source: "r", Start: ast.Position{ Column: 71, Line: 38, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 38, }, File: "second_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 73, Line: 38, }, }, }, Name: "_value", }, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 38, }, File: "second_duration_test.flux", Source: "duration(v: r._value)", Start: ast.Position{ Column: 59, Line: 38, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 38, }, File: "second_duration_test.flux", Source: "duration", Start: ast.Position{ Column: 59, Line: 38, }, }, }, Name: "duration", }, Lparen: nil, Rparen: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 38, }, File: "second_duration_test.flux", Source: "date.second(t: duration(v: r._value))", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 55, Line: 38, }, File: "second_duration_test.flux", Source: "date.second", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 38, }, File: "second_duration_test.flux", Source: "date", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 55, Line: 38, }, File: "second_duration_test.flux", Source: "second", Start: ast.Position{ Column: 49, Line: 38, }, }, }, Name: "second", }, 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: 30, Line: 38, }, File: "second_duration_test.flux", Source: "r", Start: ast.Position{ Column: 29, 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: 22, Line: 38, }, File: "second_duration_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 38, }, File: "second_duration_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 38, }, }, }, 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: 84, Line: 38, }, File: "second_duration_test.flux", Source: "map(fn: (r) => ({r with _value: date.second(t: duration(v: r._value))}))", Start: ast.Position{ Column: 12, Line: 38, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 38, }, File: "second_duration_test.flux", Source: "map", Start: ast.Position{ Column: 12, Line: 38, }, }, }, 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: 30, Line: 35, }, File: "second_duration_test.flux", Source: "table=<-", Start: ast.Position{ Column: 22, Line: 35, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 27, Line: 35, }, File: "second_duration_test.flux", Source: "table", Start: ast.Position{ Column: 22, Line: 35, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 35, }, File: "second_duration_test.flux", Source: "<-", Start: ast.Position{ Column: 28, Line: 35, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 41, }, File: "second_duration_test.flux", Source: "_duration_second = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_second})", Start: ast.Position{ Column: 6, Line: 40, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 40, }, File: "second_duration_test.flux", Source: "_duration_second", Start: ast.Position{ Column: 6, Line: 40, }, }, }, Name: "_duration_second", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 41, }, File: "second_duration_test.flux", Source: "() =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_second})", Start: ast.Position{ Column: 25, Line: 40, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 41, }, File: "second_duration_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_second})", Start: ast.Position{ Column: 5, Line: 41, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 107, Line: 41, }, File: "second_duration_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_second}", Start: ast.Position{ Column: 6, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 41, }, File: "second_duration_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 7, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 41, }, File: "second_duration_test.flux", Source: "input", Start: ast.Position{ Column: 7, 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: 45, Line: 41, }, File: "second_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 41, }, File: "second_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 41, }, File: "second_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 41, }, File: "second_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 39, Line: 41, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 41, }, File: "second_duration_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 41, }, File: "second_duration_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 41, }, File: "second_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 41, }, File: "second_duration_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 22, 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: 83, Line: 41, }, File: "second_duration_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 48, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 41, }, File: "second_duration_test.flux", Source: "want", Start: ast.Position{ Column: 48, 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: 82, Line: 41, }, File: "second_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 41, }, File: "second_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 41, }, File: "second_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 41, }, File: "second_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 75, Line: 41, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 41, }, File: "second_duration_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 41, }, File: "second_duration_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 41, }, File: "second_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 41, }, File: "second_duration_test.flux", Source: "loadMem", Start: ast.Position{ Column: 62, 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: 106, Line: 41, }, File: "second_duration_test.flux", Source: "fn: t_duration_second", Start: ast.Position{ Column: 85, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 41, }, File: "second_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 85, Line: 41, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 41, }, File: "second_duration_test.flux", Source: "t_duration_second", Start: ast.Position{ Column: 89, Line: 41, }, }, }, Name: "t_duration_second", }, }}, 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: 41, }, File: "second_duration_test.flux", Source: "test _duration_second = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_second})", 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: 4, }, File: "second_duration_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: "second_duration_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "second_duration_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "second_duration_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "second_duration_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "second_duration_test.flux", Source: "package date_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: 18, Line: 1, }, File: "second_duration_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 73, }, File: "second_time_test.flux", Source: "package date_test\n\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => 2030-01-01T00:00:00Z\n\ninData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:00Z,_m,FF,1\n,,0,2018-05-22T19:53:10Z,_m,FF,1\n,,0,2018-05-22T19:53:20Z,_m,FF,1\n,,0,2018-05-22T19:53:30Z,_m,FF,1\n,,0,2018-05-22T19:53:40Z,_m,FF,1\n,,0,2018-05-22T19:53:50Z,_m,FF,1\n,,1,2018-05-22T19:53:00Z,_m,QQ,1\n,,1,2018-05-22T19:53:10Z,_m,QQ,1\n,,1,2018-05-22T19:53:20Z,_m,QQ,1\n,,1,2018-05-22T19:53:30Z,_m,QQ,1\n,,1,2018-05-22T19:53:40Z,_m,QQ,1\n,,1,2018-05-22T19:53:50Z,_m,QQ,1\n,,1,2018-05-22T19:54:00Z,_m,QQ,1\n,,1,2018-05-22T19:54:10Z,_m,QQ,1\n,,1,2018-05-22T19:54:20Z,_m,QQ,1\n,,2,2018-05-22T19:53:00Z,_m,RR,1\n,,2,2018-05-22T19:53:10Z,_m,RR,1\n,,2,2018-05-22T19:53:20Z,_m,RR,1\n,,2,2018-05-22T19:53:30Z,_m,RR,1\n,,3,2018-05-22T19:53:40Z,_m,SR,1\n,,3,2018-05-22T19:53:50Z,_m,SR,1\n,,3,2018-05-22T19:54:00Z,_m,SR,1\n\"\noutData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:00Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:10Z,10\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:20Z,20\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:30Z,30\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:40Z,40\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:50Z,50\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:00Z,0\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:10Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:20Z,20\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:30Z,30\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:40Z,40\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:50Z,50\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:54:00Z,0\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:54:10Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:54:20Z,20\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:00Z,0\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:10Z,10\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:20Z,20\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:30Z,30\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:53:40Z,40\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:53:50Z,50\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:54:00Z,0\n\"\nt_time_second = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.second(t: r._time)}))\n\ntest _time_second = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_second})", 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: 40, Line: 7, }, File: "second_time_test.flux", Source: "now = () => 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: "second_time_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: 40, Line: 7, }, File: "second_time_test.flux", Source: "() => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "second_time_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 20, Line: 7, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "second_time_test.flux", Source: "option now = () => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 37, }, File: "second_time_test.flux", Source: "inData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:00Z,_m,FF,1\n,,0,2018-05-22T19:53:10Z,_m,FF,1\n,,0,2018-05-22T19:53:20Z,_m,FF,1\n,,0,2018-05-22T19:53:30Z,_m,FF,1\n,,0,2018-05-22T19:53:40Z,_m,FF,1\n,,0,2018-05-22T19:53:50Z,_m,FF,1\n,,1,2018-05-22T19:53:00Z,_m,QQ,1\n,,1,2018-05-22T19:53:10Z,_m,QQ,1\n,,1,2018-05-22T19:53:20Z,_m,QQ,1\n,,1,2018-05-22T19:53:30Z,_m,QQ,1\n,,1,2018-05-22T19:53:40Z,_m,QQ,1\n,,1,2018-05-22T19:53:50Z,_m,QQ,1\n,,1,2018-05-22T19:54:00Z,_m,QQ,1\n,,1,2018-05-22T19:54:10Z,_m,QQ,1\n,,1,2018-05-22T19:54:20Z,_m,QQ,1\n,,2,2018-05-22T19:53:00Z,_m,RR,1\n,,2,2018-05-22T19:53:10Z,_m,RR,1\n,,2,2018-05-22T19:53:20Z,_m,RR,1\n,,2,2018-05-22T19:53:30Z,_m,RR,1\n,,3,2018-05-22T19:53:40Z,_m,SR,1\n,,3,2018-05-22T19:53:50Z,_m,SR,1\n,,3,2018-05-22T19:54:00Z,_m,SR,1\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: "second_time_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: 37, }, File: "second_time_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:00Z,_m,FF,1\n,,0,2018-05-22T19:53:10Z,_m,FF,1\n,,0,2018-05-22T19:53:20Z,_m,FF,1\n,,0,2018-05-22T19:53:30Z,_m,FF,1\n,,0,2018-05-22T19:53:40Z,_m,FF,1\n,,0,2018-05-22T19:53:50Z,_m,FF,1\n,,1,2018-05-22T19:53:00Z,_m,QQ,1\n,,1,2018-05-22T19:53:10Z,_m,QQ,1\n,,1,2018-05-22T19:53:20Z,_m,QQ,1\n,,1,2018-05-22T19:53:30Z,_m,QQ,1\n,,1,2018-05-22T19:53:40Z,_m,QQ,1\n,,1,2018-05-22T19:53:50Z,_m,QQ,1\n,,1,2018-05-22T19:54:00Z,_m,QQ,1\n,,1,2018-05-22T19:54:10Z,_m,QQ,1\n,,1,2018-05-22T19:54:20Z,_m,QQ,1\n,,2,2018-05-22T19:53:00Z,_m,RR,1\n,,2,2018-05-22T19:53:10Z,_m,RR,1\n,,2,2018-05-22T19:53:20Z,_m,RR,1\n,,2,2018-05-22T19:53:30Z,_m,RR,1\n,,3,2018-05-22T19:53:40Z,_m,SR,1\n,,3,2018-05-22T19:53:50Z,_m,SR,1\n,,3,2018-05-22T19:54:00Z,_m,SR,1\n\"", Start: ast.Position{ Column: 5, Line: 10, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:00Z,_m,FF,1\n,,0,2018-05-22T19:53:10Z,_m,FF,1\n,,0,2018-05-22T19:53:20Z,_m,FF,1\n,,0,2018-05-22T19:53:30Z,_m,FF,1\n,,0,2018-05-22T19:53:40Z,_m,FF,1\n,,0,2018-05-22T19:53:50Z,_m,FF,1\n,,1,2018-05-22T19:53:00Z,_m,QQ,1\n,,1,2018-05-22T19:53:10Z,_m,QQ,1\n,,1,2018-05-22T19:53:20Z,_m,QQ,1\n,,1,2018-05-22T19:53:30Z,_m,QQ,1\n,,1,2018-05-22T19:53:40Z,_m,QQ,1\n,,1,2018-05-22T19:53:50Z,_m,QQ,1\n,,1,2018-05-22T19:54:00Z,_m,QQ,1\n,,1,2018-05-22T19:54:10Z,_m,QQ,1\n,,1,2018-05-22T19:54:20Z,_m,QQ,1\n,,2,2018-05-22T19:53:00Z,_m,RR,1\n,,2,2018-05-22T19:53:10Z,_m,RR,1\n,,2,2018-05-22T19:53:20Z,_m,RR,1\n,,2,2018-05-22T19:53:30Z,_m,RR,1\n,,3,2018-05-22T19:53:40Z,_m,SR,1\n,,3,2018-05-22T19:53:50Z,_m,SR,1\n,,3,2018-05-22T19:54:00Z,_m,SR,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 66, }, File: "second_time_test.flux", Source: "outData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:00Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:10Z,10\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:20Z,20\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:30Z,30\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:40Z,40\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:50Z,50\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:00Z,0\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:10Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:20Z,20\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:30Z,30\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:40Z,40\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:50Z,50\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:54:00Z,0\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:54:10Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:54:20Z,20\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:00Z,0\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:10Z,10\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:20Z,20\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:30Z,30\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:53:40Z,40\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:53:50Z,50\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:54:00Z,0\n\"", Start: ast.Position{ Column: 1, Line: 38, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 38, }, File: "second_time_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 38, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 66, }, File: "second_time_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:00Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:10Z,10\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:20Z,20\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:30Z,30\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:40Z,40\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:50Z,50\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:00Z,0\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:10Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:20Z,20\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:30Z,30\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:40Z,40\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:50Z,50\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:54:00Z,0\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:54:10Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:54:20Z,20\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:00Z,0\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:10Z,10\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:20Z,20\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:30Z,30\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:53:40Z,40\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:53:50Z,50\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:54:00Z,0\n\"", Start: ast.Position{ Column: 5, Line: 39, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:00Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:10Z,10\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:20Z,20\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:30Z,30\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:40Z,40\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:50Z,50\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:00Z,0\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:10Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:20Z,20\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:30Z,30\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:40Z,40\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:53:50Z,50\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:54:00Z,0\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:54:10Z,10\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-22T19:54:20Z,20\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:00Z,0\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:10Z,10\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:20Z,20\n,,2,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,RR,_m,2018-05-22T19:53:30Z,30\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:53:40Z,40\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:53:50Z,50\n,,3,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,SR,_m,2018-05-22T19:54:00Z,0\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 70, }, File: "second_time_test.flux", Source: "t_time_second = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.second(t: r._time)}))", Start: ast.Position{ Column: 1, Line: 67, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 67, }, File: "second_time_test.flux", Source: "t_time_second", Start: ast.Position{ Column: 1, Line: 67, }, }, }, Name: "t_time_second", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 70, }, File: "second_time_test.flux", Source: "(table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.second(t: r._time)}))", Start: ast.Position{ Column: 17, Line: 67, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 68, }, File: "second_time_test.flux", Source: "table", Start: ast.Position{ Column: 5, Line: 68, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 69, }, File: "second_time_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 5, Line: 68, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 69, }, File: "second_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 69, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 69, }, File: "second_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 69, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 69, }, File: "second_time_test.flux", Source: "start", Start: ast.Position{ Column: 18, Line: 69, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 69, }, File: "second_time_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 25, Line: 69, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 69, }, File: "second_time_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 12, Line: 69, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 69, }, File: "second_time_test.flux", Source: "range", Start: ast.Position{ Column: 12, Line: 69, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 70, }, File: "second_time_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.second(t: r._time)}))", Start: ast.Position{ Column: 5, Line: 68, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 70, }, File: "second_time_test.flux", Source: "fn: (r) => ({r with _value: date.second(t: r._time)})", Start: ast.Position{ Column: 16, Line: 70, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 70, }, File: "second_time_test.flux", Source: "fn: (r) => ({r with _value: date.second(t: r._time)})", Start: ast.Position{ Column: 16, Line: 70, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 70, }, File: "second_time_test.flux", Source: "fn", Start: ast.Position{ Column: 16, Line: 70, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 70, }, File: "second_time_test.flux", Source: "(r) => ({r with _value: date.second(t: r._time)})", Start: ast.Position{ Column: 20, Line: 70, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 70, }, File: "second_time_test.flux", Source: "({r with _value: date.second(t: r._time)})", Start: ast.Position{ Column: 27, Line: 70, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 70, }, File: "second_time_test.flux", Source: "{r with _value: date.second(t: r._time)}", Start: ast.Position{ Column: 28, Line: 70, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 70, }, File: "second_time_test.flux", Source: "_value: date.second(t: r._time)", Start: ast.Position{ Column: 36, Line: 70, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 70, }, File: "second_time_test.flux", Source: "_value", Start: ast.Position{ Column: 36, Line: 70, }, }, }, 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: 66, Line: 70, }, File: "second_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 56, Line: 70, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 70, }, File: "second_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 56, Line: 70, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 57, Line: 70, }, File: "second_time_test.flux", Source: "t", Start: ast.Position{ Column: 56, Line: 70, }, }, }, Name: "t", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 70, }, File: "second_time_test.flux", Source: "r._time", Start: ast.Position{ Column: 59, Line: 70, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 60, Line: 70, }, File: "second_time_test.flux", Source: "r", Start: ast.Position{ Column: 59, Line: 70, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 70, }, File: "second_time_test.flux", Source: "_time", Start: ast.Position{ Column: 61, Line: 70, }, }, }, Name: "_time", }, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 70, }, File: "second_time_test.flux", Source: "date.second(t: r._time)", Start: ast.Position{ Column: 44, Line: 70, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 55, Line: 70, }, File: "second_time_test.flux", Source: "date.second", Start: ast.Position{ Column: 44, Line: 70, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 70, }, File: "second_time_test.flux", Source: "date", Start: ast.Position{ Column: 44, Line: 70, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 55, Line: 70, }, File: "second_time_test.flux", Source: "second", Start: ast.Position{ Column: 49, Line: 70, }, }, }, Name: "second", }, 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: 30, Line: 70, }, File: "second_time_test.flux", Source: "r", Start: ast.Position{ Column: 29, Line: 70, }, }, }, 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: 22, Line: 70, }, File: "second_time_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 70, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 70, }, File: "second_time_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 70, }, }, }, 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: 70, Line: 70, }, File: "second_time_test.flux", Source: "map(fn: (r) => ({r with _value: date.second(t: r._time)}))", Start: ast.Position{ Column: 12, Line: 70, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 70, }, File: "second_time_test.flux", Source: "map", Start: ast.Position{ Column: 12, Line: 70, }, }, }, 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: 26, Line: 67, }, File: "second_time_test.flux", Source: "table=<-", Start: ast.Position{ Column: 18, Line: 67, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 67, }, File: "second_time_test.flux", Source: "table", Start: ast.Position{ Column: 18, Line: 67, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 26, Line: 67, }, File: "second_time_test.flux", Source: "<-", Start: ast.Position{ Column: 24, Line: 67, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 73, }, File: "second_time_test.flux", Source: "_time_second = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_second})", Start: ast.Position{ Column: 6, Line: 72, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 72, }, File: "second_time_test.flux", Source: "_time_second", Start: ast.Position{ Column: 6, Line: 72, }, }, }, Name: "_time_second", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 73, }, File: "second_time_test.flux", Source: "() =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_second})", Start: ast.Position{ Column: 21, Line: 72, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 73, }, File: "second_time_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_second})", Start: ast.Position{ Column: 5, Line: 73, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 73, }, File: "second_time_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_second}", Start: ast.Position{ Column: 6, Line: 73, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 73, }, File: "second_time_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 7, Line: 73, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 73, }, File: "second_time_test.flux", Source: "input", Start: ast.Position{ Column: 7, Line: 73, }, }, }, 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: 73, }, File: "second_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 73, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 73, }, File: "second_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 73, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 73, }, File: "second_time_test.flux", Source: "csv", Start: ast.Position{ Column: 34, Line: 73, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 73, }, File: "second_time_test.flux", Source: "inData", Start: ast.Position{ Column: 39, Line: 73, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 73, }, File: "second_time_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 14, Line: 73, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 73, }, File: "second_time_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 14, Line: 73, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 73, }, File: "second_time_test.flux", Source: "testing", Start: ast.Position{ Column: 14, Line: 73, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 73, }, File: "second_time_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 22, Line: 73, }, }, }, 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: 73, }, File: "second_time_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 48, Line: 73, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 73, }, File: "second_time_test.flux", Source: "want", Start: ast.Position{ Column: 48, Line: 73, }, }, }, 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: 73, }, File: "second_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 73, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 73, }, File: "second_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 73, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 73, }, File: "second_time_test.flux", Source: "csv", Start: ast.Position{ Column: 70, Line: 73, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 73, }, File: "second_time_test.flux", Source: "outData", Start: ast.Position{ Column: 75, Line: 73, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 73, }, File: "second_time_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 54, Line: 73, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 73, }, File: "second_time_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 54, Line: 73, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 73, }, File: "second_time_test.flux", Source: "testing", Start: ast.Position{ Column: 54, Line: 73, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 73, }, File: "second_time_test.flux", Source: "loadMem", Start: ast.Position{ Column: 62, Line: 73, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 73, }, File: "second_time_test.flux", Source: "fn: t_time_second", Start: ast.Position{ Column: 85, Line: 73, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 73, }, File: "second_time_test.flux", Source: "fn", Start: ast.Position{ Column: 85, Line: 73, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 73, }, File: "second_time_test.flux", Source: "t_time_second", Start: ast.Position{ Column: 89, Line: 73, }, }, }, Name: "t_time_second", }, }}, 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: 104, Line: 73, }, File: "second_time_test.flux", Source: "test _time_second = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_second})", Start: ast.Position{ Column: 1, Line: 72, }, }, }, }}, 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: 4, }, File: "second_time_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: "second_time_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "second_time_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "second_time_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "second_time_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "second_time_test.flux", Source: "package date_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: 18, Line: 1, }, File: "second_time_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 110, Line: 44, }, File: "truncate_duration_test.flux", Source: "package date_test\n\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => 2030-01-01T00:00:00Z\n\ninData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:00.000000000Z,_m,FF,-3600000000000\n,,0,2018-05-22T19:53:10.000000000Z,_m,FF,-7200000000000\n,,0,2018-05-22T19:53:20.000000000Z,_m,FF,-10800000000000\n,,0,2018-05-22T19:53:30.000000000Z,_m,FF,0\n,,0,2018-05-22T19:53:40.000000000Z,_m,FF,3600000000000\n,,0,2018-05-22T19:53:50.000000000Z,_m,FF,7200000000000\n,,0,2018-05-22T19:54:00.000000000Z,_m,FF,10800000000000\n\"\noutData =\n \"\n#datatype,string,long,string,string,dateTime:RFC3339,long\n#group,false,false,true,true,false,false\n#default,_result,,,,,\n,result,table,_field,_measurement,_time,_value\n,,0,FF,_m,2018-05-22T19:53:00.000000000Z,1893452400000000000\n,,0,FF,_m,2018-05-22T19:53:10.000000000Z,1893448800000000000\n,,0,FF,_m,2018-05-22T19:53:20.000000000Z,1893445200000000000\n,,0,FF,_m,2018-05-22T19:53:30.000000000Z,1893456000000000000\n,,0,FF,_m,2018-05-22T19:53:40.000000000Z,1893459600000000000\n,,0,FF,_m,2018-05-22T19:53:50.000000000Z,1893463200000000000\n,,0,FF,_m,2018-05-22T19:54:00.000000000Z,1893466800000000000\n\"\nt_duration_truncate = (table=<-) =>\n table\n |> range(start: 2018-05-22T19:53:00Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n |> map(fn: (r) => ({r with _value: int(v: date.truncate(t: duration(v: r._value), unit: 1s))}))\n\ntest _duration_truncate = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_truncate})", 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: 40, Line: 7, }, File: "truncate_duration_test.flux", Source: "now = () => 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: "truncate_duration_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: 40, Line: 7, }, File: "truncate_duration_test.flux", Source: "() => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "truncate_duration_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 20, Line: 7, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "truncate_duration_test.flux", Source: "option now = () => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 22, }, File: "truncate_duration_test.flux", Source: "inData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:00.000000000Z,_m,FF,-3600000000000\n,,0,2018-05-22T19:53:10.000000000Z,_m,FF,-7200000000000\n,,0,2018-05-22T19:53:20.000000000Z,_m,FF,-10800000000000\n,,0,2018-05-22T19:53:30.000000000Z,_m,FF,0\n,,0,2018-05-22T19:53:40.000000000Z,_m,FF,3600000000000\n,,0,2018-05-22T19:53:50.000000000Z,_m,FF,7200000000000\n,,0,2018-05-22T19:54:00.000000000Z,_m,FF,10800000000000\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: "truncate_duration_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: 22, }, File: "truncate_duration_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:00.000000000Z,_m,FF,-3600000000000\n,,0,2018-05-22T19:53:10.000000000Z,_m,FF,-7200000000000\n,,0,2018-05-22T19:53:20.000000000Z,_m,FF,-10800000000000\n,,0,2018-05-22T19:53:30.000000000Z,_m,FF,0\n,,0,2018-05-22T19:53:40.000000000Z,_m,FF,3600000000000\n,,0,2018-05-22T19:53:50.000000000Z,_m,FF,7200000000000\n,,0,2018-05-22T19:54:00.000000000Z,_m,FF,10800000000000\n\"", Start: ast.Position{ Column: 5, Line: 10, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:00.000000000Z,_m,FF,-3600000000000\n,,0,2018-05-22T19:53:10.000000000Z,_m,FF,-7200000000000\n,,0,2018-05-22T19:53:20.000000000Z,_m,FF,-10800000000000\n,,0,2018-05-22T19:53:30.000000000Z,_m,FF,0\n,,0,2018-05-22T19:53:40.000000000Z,_m,FF,3600000000000\n,,0,2018-05-22T19:53:50.000000000Z,_m,FF,7200000000000\n,,0,2018-05-22T19:54:00.000000000Z,_m,FF,10800000000000\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 36, }, File: "truncate_duration_test.flux", Source: "outData =\n \"\n#datatype,string,long,string,string,dateTime:RFC3339,long\n#group,false,false,true,true,false,false\n#default,_result,,,,,\n,result,table,_field,_measurement,_time,_value\n,,0,FF,_m,2018-05-22T19:53:00.000000000Z,1893452400000000000\n,,0,FF,_m,2018-05-22T19:53:10.000000000Z,1893448800000000000\n,,0,FF,_m,2018-05-22T19:53:20.000000000Z,1893445200000000000\n,,0,FF,_m,2018-05-22T19:53:30.000000000Z,1893456000000000000\n,,0,FF,_m,2018-05-22T19:53:40.000000000Z,1893459600000000000\n,,0,FF,_m,2018-05-22T19:53:50.000000000Z,1893463200000000000\n,,0,FF,_m,2018-05-22T19:54:00.000000000Z,1893466800000000000\n\"", Start: ast.Position{ Column: 1, Line: 23, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 23, }, File: "truncate_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 23, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 36, }, File: "truncate_duration_test.flux", Source: "\"\n#datatype,string,long,string,string,dateTime:RFC3339,long\n#group,false,false,true,true,false,false\n#default,_result,,,,,\n,result,table,_field,_measurement,_time,_value\n,,0,FF,_m,2018-05-22T19:53:00.000000000Z,1893452400000000000\n,,0,FF,_m,2018-05-22T19:53:10.000000000Z,1893448800000000000\n,,0,FF,_m,2018-05-22T19:53:20.000000000Z,1893445200000000000\n,,0,FF,_m,2018-05-22T19:53:30.000000000Z,1893456000000000000\n,,0,FF,_m,2018-05-22T19:53:40.000000000Z,1893459600000000000\n,,0,FF,_m,2018-05-22T19:53:50.000000000Z,1893463200000000000\n,,0,FF,_m,2018-05-22T19:54:00.000000000Z,1893466800000000000\n\"", Start: ast.Position{ Column: 5, Line: 24, }, }, }, Value: "\n#datatype,string,long,string,string,dateTime:RFC3339,long\n#group,false,false,true,true,false,false\n#default,_result,,,,,\n,result,table,_field,_measurement,_time,_value\n,,0,FF,_m,2018-05-22T19:53:00.000000000Z,1893452400000000000\n,,0,FF,_m,2018-05-22T19:53:10.000000000Z,1893448800000000000\n,,0,FF,_m,2018-05-22T19:53:20.000000000Z,1893445200000000000\n,,0,FF,_m,2018-05-22T19:53:30.000000000Z,1893456000000000000\n,,0,FF,_m,2018-05-22T19:53:40.000000000Z,1893459600000000000\n,,0,FF,_m,2018-05-22T19:53:50.000000000Z,1893463200000000000\n,,0,FF,_m,2018-05-22T19:54:00.000000000Z,1893466800000000000\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 41, }, File: "truncate_duration_test.flux", Source: "t_duration_truncate = (table=<-) =>\n table\n |> range(start: 2018-05-22T19:53:00Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n |> map(fn: (r) => ({r with _value: int(v: date.truncate(t: duration(v: r._value), unit: 1s))}))", Start: ast.Position{ Column: 1, Line: 37, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 37, }, File: "truncate_duration_test.flux", Source: "t_duration_truncate", Start: ast.Position{ Column: 1, Line: 37, }, }, }, Name: "t_duration_truncate", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 41, }, File: "truncate_duration_test.flux", Source: "(table=<-) =>\n table\n |> range(start: 2018-05-22T19:53:00Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n |> map(fn: (r) => ({r with _value: int(v: date.truncate(t: duration(v: r._value), unit: 1s))}))", Start: ast.Position{ Column: 23, Line: 37, }, }, }, Body: &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: 10, Line: 38, }, File: "truncate_duration_test.flux", Source: "table", Start: ast.Position{ Column: 5, Line: 38, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 39, }, File: "truncate_duration_test.flux", Source: "table\n |> range(start: 2018-05-22T19:53: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: "truncate_duration_test.flux", Source: "start: 2018-05-22T19:53: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: "truncate_duration_test.flux", Source: "start: 2018-05-22T19:53: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: "truncate_duration_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: "truncate_duration_test.flux", Source: "2018-05-22T19:53:00Z", Start: ast.Position{ Column: 25, Line: 39, }, }, }, 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: 46, Line: 39, }, File: "truncate_duration_test.flux", Source: "range(start: 2018-05-22T19:53: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: "truncate_duration_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: 46, Line: 40, }, File: "truncate_duration_test.flux", Source: "table\n |> range(start: 2018-05-22T19:53:00Z)\n |> drop(columns: [\"_start\", \"_stop\"])", 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: 40, }, File: "truncate_duration_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 17, Line: 40, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 40, }, File: "truncate_duration_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 17, Line: 40, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 40, }, File: "truncate_duration_test.flux", Source: "columns", Start: ast.Position{ Column: 17, Line: 40, }, }, }, Name: "columns", }, Separator: nil, Value: &ast.ArrayExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 40, }, File: "truncate_duration_test.flux", Source: "[\"_start\", \"_stop\"]", Start: ast.Position{ Column: 26, Line: 40, }, }, }, Elements: []ast.Expression{&ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 40, }, File: "truncate_duration_test.flux", Source: "\"_start\"", Start: ast.Position{ Column: 27, Line: 40, }, }, }, Value: "_start", }, &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 44, Line: 40, }, File: "truncate_duration_test.flux", Source: "\"_stop\"", Start: ast.Position{ Column: 37, Line: 40, }, }, }, Value: "_stop", }}, Lbrack: nil, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 40, }, File: "truncate_duration_test.flux", Source: "drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 12, Line: 40, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 40, }, File: "truncate_duration_test.flux", Source: "drop", Start: ast.Position{ Column: 12, Line: 40, }, }, }, Name: "drop", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 41, }, File: "truncate_duration_test.flux", Source: "table\n |> range(start: 2018-05-22T19:53:00Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n |> map(fn: (r) => ({r with _value: int(v: date.truncate(t: duration(v: r._value), unit: 1s))}))", 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: 103, Line: 41, }, File: "truncate_duration_test.flux", Source: "fn: (r) => ({r with _value: int(v: date.truncate(t: duration(v: r._value), unit: 1s))})", Start: ast.Position{ Column: 16, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 41, }, File: "truncate_duration_test.flux", Source: "fn: (r) => ({r with _value: int(v: date.truncate(t: duration(v: r._value), unit: 1s))})", Start: ast.Position{ Column: 16, 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: "truncate_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 16, Line: 41, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 41, }, File: "truncate_duration_test.flux", Source: "(r) => ({r with _value: int(v: date.truncate(t: duration(v: r._value), unit: 1s))})", Start: ast.Position{ Column: 20, Line: 41, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 103, Line: 41, }, File: "truncate_duration_test.flux", Source: "({r with _value: int(v: date.truncate(t: duration(v: r._value), unit: 1s))})", Start: ast.Position{ Column: 27, Line: 41, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 41, }, File: "truncate_duration_test.flux", Source: "{r with _value: int(v: date.truncate(t: duration(v: r._value), unit: 1s))}", Start: ast.Position{ Column: 28, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 41, }, File: "truncate_duration_test.flux", Source: "_value: int(v: date.truncate(t: duration(v: r._value), unit: 1s))", Start: ast.Position{ Column: 36, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 41, }, File: "truncate_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 36, Line: 41, }, }, }, 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: 100, Line: 41, }, File: "truncate_duration_test.flux", Source: "v: date.truncate(t: duration(v: r._value), unit: 1s)", Start: ast.Position{ Column: 48, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 41, }, File: "truncate_duration_test.flux", Source: "v: date.truncate(t: duration(v: r._value), unit: 1s)", Start: ast.Position{ Column: 48, 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: "truncate_duration_test.flux", Source: "v", Start: ast.Position{ Column: 48, Line: 41, }, }, }, Name: "v", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 41, }, File: "truncate_duration_test.flux", Source: "t: duration(v: r._value), unit: 1s", Start: ast.Position{ Column: 65, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 89, Line: 41, }, File: "truncate_duration_test.flux", Source: "t: duration(v: r._value)", Start: ast.Position{ Column: 65, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 41, }, File: "truncate_duration_test.flux", Source: "t", Start: ast.Position{ Column: 65, Line: 41, }, }, }, Name: "t", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 88, Line: 41, }, File: "truncate_duration_test.flux", Source: "v: r._value", Start: ast.Position{ Column: 77, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 88, Line: 41, }, File: "truncate_duration_test.flux", Source: "v: r._value", Start: ast.Position{ Column: 77, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 41, }, File: "truncate_duration_test.flux", Source: "v", Start: ast.Position{ Column: 77, Line: 41, }, }, }, Name: "v", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 88, Line: 41, }, File: "truncate_duration_test.flux", Source: "r._value", Start: ast.Position{ Column: 80, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 41, }, File: "truncate_duration_test.flux", Source: "r", Start: ast.Position{ Column: 80, Line: 41, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 88, Line: 41, }, File: "truncate_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 82, Line: 41, }, }, }, Name: "_value", }, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 89, Line: 41, }, File: "truncate_duration_test.flux", Source: "duration(v: r._value)", Start: ast.Position{ Column: 68, Line: 41, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 76, Line: 41, }, File: "truncate_duration_test.flux", Source: "duration", Start: ast.Position{ Column: 68, Line: 41, }, }, }, Name: "duration", }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 41, }, File: "truncate_duration_test.flux", Source: "unit: 1s", Start: ast.Position{ Column: 91, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 95, Line: 41, }, File: "truncate_duration_test.flux", Source: "unit", Start: ast.Position{ Column: 91, Line: 41, }, }, }, Name: "unit", }, Separator: nil, Value: &ast.DurationLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 99, Line: 41, }, File: "truncate_duration_test.flux", Source: "1s", Start: ast.Position{ Column: 97, Line: 41, }, }, }, Values: []ast.Duration{ast.Duration{ Magnitude: int64(1), Unit: "s", }}, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 41, }, File: "truncate_duration_test.flux", Source: "date.truncate(t: duration(v: r._value), unit: 1s)", Start: ast.Position{ Column: 51, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 41, }, File: "truncate_duration_test.flux", Source: "date.truncate", 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: 55, Line: 41, }, File: "truncate_duration_test.flux", Source: "date", Start: ast.Position{ Column: 51, Line: 41, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 41, }, File: "truncate_duration_test.flux", Source: "truncate", Start: ast.Position{ Column: 56, Line: 41, }, }, }, Name: "truncate", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 41, }, File: "truncate_duration_test.flux", Source: "int(v: date.truncate(t: duration(v: r._value), unit: 1s))", Start: ast.Position{ Column: 44, Line: 41, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 47, Line: 41, }, File: "truncate_duration_test.flux", Source: "int", Start: ast.Position{ Column: 44, Line: 41, }, }, }, Name: "int", }, Lparen: nil, Rparen: nil, }, }}, Rbrace: nil, With: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 30, Line: 41, }, File: "truncate_duration_test.flux", Source: "r", Start: ast.Position{ Column: 29, Line: 41, }, }, }, 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: 22, Line: 41, }, File: "truncate_duration_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 41, }, File: "truncate_duration_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 41, }, }, }, 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: 104, Line: 41, }, File: "truncate_duration_test.flux", Source: "map(fn: (r) => ({r with _value: int(v: date.truncate(t: duration(v: r._value), unit: 1s))}))", Start: ast.Position{ Column: 12, Line: 41, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 41, }, File: "truncate_duration_test.flux", Source: "map", Start: ast.Position{ Column: 12, Line: 41, }, }, }, 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: 32, Line: 37, }, File: "truncate_duration_test.flux", Source: "table=<-", Start: ast.Position{ Column: 24, Line: 37, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 37, }, File: "truncate_duration_test.flux", Source: "table", Start: ast.Position{ Column: 24, Line: 37, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 32, Line: 37, }, File: "truncate_duration_test.flux", Source: "<-", Start: ast.Position{ Column: 30, Line: 37, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 110, Line: 44, }, File: "truncate_duration_test.flux", Source: "_duration_truncate = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_truncate})", Start: ast.Position{ Column: 6, Line: 43, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 43, }, File: "truncate_duration_test.flux", Source: "_duration_truncate", Start: ast.Position{ Column: 6, Line: 43, }, }, }, Name: "_duration_truncate", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 110, Line: 44, }, File: "truncate_duration_test.flux", Source: "() =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_truncate})", Start: ast.Position{ Column: 27, Line: 43, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 110, Line: 44, }, File: "truncate_duration_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_truncate})", Start: ast.Position{ Column: 5, Line: 44, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 109, Line: 44, }, File: "truncate_duration_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_truncate}", Start: ast.Position{ Column: 6, Line: 44, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 44, }, File: "truncate_duration_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 7, Line: 44, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 44, }, File: "truncate_duration_test.flux", Source: "input", Start: ast.Position{ Column: 7, Line: 44, }, }, }, 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: 44, }, File: "truncate_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 44, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 44, }, File: "truncate_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 44, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 44, }, File: "truncate_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 34, Line: 44, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 44, }, File: "truncate_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 39, Line: 44, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 44, }, File: "truncate_duration_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 14, Line: 44, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 44, }, File: "truncate_duration_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 14, Line: 44, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 44, }, File: "truncate_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 14, Line: 44, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 44, }, File: "truncate_duration_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 22, Line: 44, }, }, }, 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: 44, }, File: "truncate_duration_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 48, Line: 44, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 44, }, File: "truncate_duration_test.flux", Source: "want", Start: ast.Position{ Column: 48, Line: 44, }, }, }, 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: 44, }, File: "truncate_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 44, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 44, }, File: "truncate_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 44, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 44, }, File: "truncate_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 70, Line: 44, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 44, }, File: "truncate_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 75, Line: 44, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 44, }, File: "truncate_duration_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 54, Line: 44, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 44, }, File: "truncate_duration_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 54, Line: 44, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 44, }, File: "truncate_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 54, Line: 44, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 44, }, File: "truncate_duration_test.flux", Source: "loadMem", Start: ast.Position{ Column: 62, Line: 44, }, }, }, Name: "loadMem", }, Rbrack: nil, }, Lparen: nil, Rparen: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 44, }, File: "truncate_duration_test.flux", Source: "fn: t_duration_truncate", Start: ast.Position{ Column: 85, Line: 44, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 44, }, File: "truncate_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 85, Line: 44, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 44, }, File: "truncate_duration_test.flux", Source: "t_duration_truncate", Start: ast.Position{ Column: 89, Line: 44, }, }, }, Name: "t_duration_truncate", }, }}, 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: 110, Line: 44, }, File: "truncate_duration_test.flux", Source: "test _duration_truncate = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_truncate})", Start: ast.Position{ Column: 1, Line: 43, }, }, }, }}, 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: 4, }, File: "truncate_duration_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: "truncate_duration_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "truncate_duration_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "truncate_duration_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "truncate_duration_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "truncate_duration_test.flux", Source: "package date_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: 18, Line: 1, }, File: "truncate_duration_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 42, }, File: "truncate_time_test.flux", Source: "package date_test\n\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => 2030-01-01T00:00:00Z\n\ninData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:00.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:10.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:20.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:30.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:40.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:50.000000000Z,_m,FF,1\n\"\noutData =\n \"\n#datatype,string,long,string,string,dateTime:RFC3339,long\n#group,false,false,true,true,false,false\n#default,_result,,,,,\n,result,table,_field,_measurement,_time,_value\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n\"\nt_time_truncate = (table=<-) =>\n table\n |> range(start: 2018-05-22T19:53:00Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n |> map(fn: (r) => ({r with _time: date.truncate(t: r._time, unit: 1h)}))\n\ntest _time_truncate = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_truncate})", 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: 40, Line: 7, }, File: "truncate_time_test.flux", Source: "now = () => 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: "truncate_time_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: 40, Line: 7, }, File: "truncate_time_test.flux", Source: "() => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "truncate_time_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 20, Line: 7, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "truncate_time_test.flux", Source: "option now = () => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 21, }, File: "truncate_time_test.flux", Source: "inData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:00.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:10.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:20.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:30.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:40.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:50.000000000Z,_m,FF,1\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: "truncate_time_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: 21, }, File: "truncate_time_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:00.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:10.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:20.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:30.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:40.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:50.000000000Z,_m,FF,1\n\"", Start: ast.Position{ Column: 5, Line: 10, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:00.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:10.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:20.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:30.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:40.000000000Z,_m,FF,1\n,,0,2018-05-22T19:53:50.000000000Z,_m,FF,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "truncate_time_test.flux", Source: "outData =\n \"\n#datatype,string,long,string,string,dateTime:RFC3339,long\n#group,false,false,true,true,false,false\n#default,_result,,,,,\n,result,table,_field,_measurement,_time,_value\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n\"", Start: ast.Position{ Column: 1, Line: 22, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 22, }, File: "truncate_time_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 22, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "truncate_time_test.flux", Source: "\"\n#datatype,string,long,string,string,dateTime:RFC3339,long\n#group,false,false,true,true,false,false\n#default,_result,,,,,\n,result,table,_field,_measurement,_time,_value\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n\"", Start: ast.Position{ Column: 5, Line: 23, }, }, }, Value: "\n#datatype,string,long,string,string,dateTime:RFC3339,long\n#group,false,false,true,true,false,false\n#default,_result,,,,,\n,result,table,_field,_measurement,_time,_value\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n,,0,FF,_m,2018-05-22T19:00:00.000000000Z,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 39, }, File: "truncate_time_test.flux", Source: "t_time_truncate = (table=<-) =>\n table\n |> range(start: 2018-05-22T19:53:00Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n |> map(fn: (r) => ({r with _time: date.truncate(t: r._time, unit: 1h)}))", Start: ast.Position{ Column: 1, Line: 35, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 35, }, File: "truncate_time_test.flux", Source: "t_time_truncate", Start: ast.Position{ Column: 1, Line: 35, }, }, }, Name: "t_time_truncate", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 39, }, File: "truncate_time_test.flux", Source: "(table=<-) =>\n table\n |> range(start: 2018-05-22T19:53:00Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n |> map(fn: (r) => ({r with _time: date.truncate(t: r._time, unit: 1h)}))", Start: ast.Position{ Column: 19, Line: 35, }, }, }, Body: &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: 10, Line: 36, }, File: "truncate_time_test.flux", Source: "table", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 37, }, File: "truncate_time_test.flux", Source: "table\n |> range(start: 2018-05-22T19:53:00Z)", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "truncate_time_test.flux", Source: "start: 2018-05-22T19:53:00Z", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "truncate_time_test.flux", Source: "start: 2018-05-22T19:53:00Z", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 37, }, File: "truncate_time_test.flux", Source: "start", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "truncate_time_test.flux", Source: "2018-05-22T19:53:00Z", Start: ast.Position{ Column: 25, Line: 37, }, }, }, 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: 46, Line: 37, }, File: "truncate_time_test.flux", Source: "range(start: 2018-05-22T19:53:00Z)", Start: ast.Position{ Column: 12, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 37, }, File: "truncate_time_test.flux", Source: "range", Start: ast.Position{ Column: 12, Line: 37, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 38, }, File: "truncate_time_test.flux", Source: "table\n |> range(start: 2018-05-22T19:53:00Z)\n |> drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 38, }, File: "truncate_time_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 17, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 38, }, File: "truncate_time_test.flux", Source: "columns: [\"_start\", \"_stop\"]", Start: ast.Position{ Column: 17, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 38, }, File: "truncate_time_test.flux", Source: "columns", Start: ast.Position{ Column: 17, Line: 38, }, }, }, Name: "columns", }, Separator: nil, Value: &ast.ArrayExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 38, }, File: "truncate_time_test.flux", Source: "[\"_start\", \"_stop\"]", Start: ast.Position{ Column: 26, Line: 38, }, }, }, Elements: []ast.Expression{&ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 35, Line: 38, }, File: "truncate_time_test.flux", Source: "\"_start\"", Start: ast.Position{ Column: 27, Line: 38, }, }, }, Value: "_start", }, &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 44, Line: 38, }, File: "truncate_time_test.flux", Source: "\"_stop\"", Start: ast.Position{ Column: 37, Line: 38, }, }, }, Value: "_stop", }}, Lbrack: nil, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 38, }, File: "truncate_time_test.flux", Source: "drop(columns: [\"_start\", \"_stop\"])", Start: ast.Position{ Column: 12, Line: 38, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 38, }, File: "truncate_time_test.flux", Source: "drop", Start: ast.Position{ Column: 12, Line: 38, }, }, }, Name: "drop", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 39, }, File: "truncate_time_test.flux", Source: "table\n |> range(start: 2018-05-22T19:53:00Z)\n |> drop(columns: [\"_start\", \"_stop\"])\n |> map(fn: (r) => ({r with _time: date.truncate(t: r._time, unit: 1h)}))", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 39, }, File: "truncate_time_test.flux", Source: "fn: (r) => ({r with _time: date.truncate(t: r._time, unit: 1h)})", Start: ast.Position{ Column: 16, Line: 39, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 39, }, File: "truncate_time_test.flux", Source: "fn: (r) => ({r with _time: date.truncate(t: r._time, unit: 1h)})", Start: ast.Position{ Column: 16, Line: 39, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 39, }, File: "truncate_time_test.flux", Source: "fn", Start: ast.Position{ Column: 16, 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: 80, Line: 39, }, File: "truncate_time_test.flux", Source: "(r) => ({r with _time: date.truncate(t: r._time, unit: 1h)})", Start: ast.Position{ Column: 20, Line: 39, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 39, }, File: "truncate_time_test.flux", Source: "({r with _time: date.truncate(t: r._time, unit: 1h)})", Start: ast.Position{ Column: 27, Line: 39, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 39, }, File: "truncate_time_test.flux", Source: "{r with _time: date.truncate(t: r._time, unit: 1h)}", Start: ast.Position{ Column: 28, Line: 39, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 39, }, File: "truncate_time_test.flux", Source: "_time: date.truncate(t: r._time, unit: 1h)", Start: ast.Position{ Column: 36, Line: 39, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 41, Line: 39, }, File: "truncate_time_test.flux", Source: "_time", Start: ast.Position{ Column: 36, Line: 39, }, }, }, Name: "_time", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 39, }, File: "truncate_time_test.flux", Source: "t: r._time, unit: 1h", Start: ast.Position{ Column: 57, Line: 39, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 39, }, File: "truncate_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 57, Line: 39, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 39, }, File: "truncate_time_test.flux", Source: "t", Start: ast.Position{ Column: 57, Line: 39, }, }, }, Name: "t", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 39, }, File: "truncate_time_test.flux", Source: "r._time", Start: ast.Position{ Column: 60, Line: 39, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 39, }, File: "truncate_time_test.flux", Source: "r", Start: ast.Position{ Column: 60, Line: 39, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 39, }, File: "truncate_time_test.flux", Source: "_time", Start: ast.Position{ Column: 62, Line: 39, }, }, }, Name: "_time", }, Rbrack: nil, }, }, &ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 39, }, File: "truncate_time_test.flux", Source: "unit: 1h", Start: ast.Position{ Column: 69, Line: 39, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 39, }, File: "truncate_time_test.flux", Source: "unit", Start: ast.Position{ Column: 69, Line: 39, }, }, }, Name: "unit", }, Separator: nil, Value: &ast.DurationLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 39, }, File: "truncate_time_test.flux", Source: "1h", Start: ast.Position{ Column: 75, Line: 39, }, }, }, Values: []ast.Duration{ast.Duration{ Magnitude: int64(1), Unit: "h", }}, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 39, }, File: "truncate_time_test.flux", Source: "date.truncate(t: r._time, unit: 1h)", Start: ast.Position{ Column: 43, Line: 39, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 56, Line: 39, }, File: "truncate_time_test.flux", Source: "date.truncate", Start: ast.Position{ Column: 43, Line: 39, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 47, Line: 39, }, File: "truncate_time_test.flux", Source: "date", Start: ast.Position{ Column: 43, Line: 39, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 56, Line: 39, }, File: "truncate_time_test.flux", Source: "truncate", Start: ast.Position{ Column: 48, Line: 39, }, }, }, Name: "truncate", }, 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: 30, Line: 39, }, File: "truncate_time_test.flux", Source: "r", Start: ast.Position{ Column: 29, Line: 39, }, }, }, 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: 22, Line: 39, }, File: "truncate_time_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 39, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 39, }, File: "truncate_time_test.flux", Source: "r", Start: ast.Position{ Column: 21, 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: 81, Line: 39, }, File: "truncate_time_test.flux", Source: "map(fn: (r) => ({r with _time: date.truncate(t: r._time, unit: 1h)}))", Start: ast.Position{ Column: 12, Line: 39, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 39, }, File: "truncate_time_test.flux", Source: "map", Start: ast.Position{ Column: 12, Line: 39, }, }, }, 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: 28, Line: 35, }, File: "truncate_time_test.flux", Source: "table=<-", Start: ast.Position{ Column: 20, Line: 35, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 35, }, File: "truncate_time_test.flux", Source: "table", Start: ast.Position{ Column: 20, Line: 35, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 35, }, File: "truncate_time_test.flux", Source: "<-", Start: ast.Position{ Column: 26, Line: 35, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 42, }, File: "truncate_time_test.flux", Source: "_time_truncate = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_truncate})", Start: ast.Position{ Column: 6, Line: 41, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 41, }, File: "truncate_time_test.flux", Source: "_time_truncate", Start: ast.Position{ Column: 6, Line: 41, }, }, }, Name: "_time_truncate", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 42, }, File: "truncate_time_test.flux", Source: "() =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_truncate})", Start: ast.Position{ Column: 23, Line: 41, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 42, }, File: "truncate_time_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_truncate})", Start: ast.Position{ Column: 5, Line: 42, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 42, }, File: "truncate_time_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_truncate}", Start: ast.Position{ Column: 6, Line: 42, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 42, }, File: "truncate_time_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 7, Line: 42, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 42, }, File: "truncate_time_test.flux", Source: "input", Start: ast.Position{ Column: 7, Line: 42, }, }, }, 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: 42, }, File: "truncate_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 42, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 42, }, File: "truncate_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 42, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 42, }, File: "truncate_time_test.flux", Source: "csv", Start: ast.Position{ Column: 34, Line: 42, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 42, }, File: "truncate_time_test.flux", Source: "inData", Start: ast.Position{ Column: 39, Line: 42, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 42, }, File: "truncate_time_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 14, Line: 42, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 42, }, File: "truncate_time_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 14, Line: 42, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 42, }, File: "truncate_time_test.flux", Source: "testing", Start: ast.Position{ Column: 14, Line: 42, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 42, }, File: "truncate_time_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 22, Line: 42, }, }, }, 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: 42, }, File: "truncate_time_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 48, Line: 42, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 42, }, File: "truncate_time_test.flux", Source: "want", Start: ast.Position{ Column: 48, Line: 42, }, }, }, 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: 42, }, File: "truncate_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 42, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 42, }, File: "truncate_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 42, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 42, }, File: "truncate_time_test.flux", Source: "csv", Start: ast.Position{ Column: 70, Line: 42, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 42, }, File: "truncate_time_test.flux", Source: "outData", Start: ast.Position{ Column: 75, Line: 42, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 42, }, File: "truncate_time_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 54, Line: 42, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 42, }, File: "truncate_time_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 54, Line: 42, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 42, }, File: "truncate_time_test.flux", Source: "testing", Start: ast.Position{ Column: 54, Line: 42, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 42, }, File: "truncate_time_test.flux", Source: "loadMem", Start: ast.Position{ Column: 62, Line: 42, }, }, }, 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: 42, }, File: "truncate_time_test.flux", Source: "fn: t_time_truncate", Start: ast.Position{ Column: 85, Line: 42, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 42, }, File: "truncate_time_test.flux", Source: "fn", Start: ast.Position{ Column: 85, Line: 42, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 42, }, File: "truncate_time_test.flux", Source: "t_time_truncate", Start: ast.Position{ Column: 89, Line: 42, }, }, }, Name: "t_time_truncate", }, }}, 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: 42, }, File: "truncate_time_test.flux", Source: "test _time_truncate = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_truncate})", Start: ast.Position{ Column: 1, Line: 41, }, }, }, }}, 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: 4, }, File: "truncate_time_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: "truncate_time_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "truncate_time_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "truncate_time_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "truncate_time_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "truncate_time_test.flux", Source: "package date_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: 18, Line: 1, }, File: "truncate_time_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 110, Line: 41, }, File: "week_day_duration_test.flux", Source: "package date_test\n\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => 2030-01-01T00:00:00Z\n\ninData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"\noutData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,2\n\"\nt_duration_week_day = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.weekDay(t: duration(v: r._value))}))\n\ntest _duration_week_day = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_week_day})", 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: 40, Line: 7, }, File: "week_day_duration_test.flux", Source: "now = () => 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: "week_day_duration_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: 40, Line: 7, }, File: "week_day_duration_test.flux", Source: "() => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "week_day_duration_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 20, Line: 7, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "week_day_duration_test.flux", Source: "option now = () => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 21, }, File: "week_day_duration_test.flux", Source: "inData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\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: "week_day_duration_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: 21, }, File: "week_day_duration_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 5, Line: 10, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "week_day_duration_test.flux", Source: "outData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,2\n\"", Start: ast.Position{ Column: 1, Line: 22, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 22, }, File: "week_day_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 22, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "week_day_duration_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,2\n\"", Start: ast.Position{ Column: 5, Line: 23, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,2\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 85, Line: 38, }, File: "week_day_duration_test.flux", Source: "t_duration_week_day = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.weekDay(t: duration(v: r._value))}))", Start: ast.Position{ Column: 1, Line: 35, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 35, }, File: "week_day_duration_test.flux", Source: "t_duration_week_day", Start: ast.Position{ Column: 1, Line: 35, }, }, }, Name: "t_duration_week_day", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 85, Line: 38, }, File: "week_day_duration_test.flux", Source: "(table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.weekDay(t: duration(v: r._value))}))", Start: ast.Position{ Column: 23, Line: 35, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 36, }, File: "week_day_duration_test.flux", Source: "table", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 37, }, File: "week_day_duration_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "week_day_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "week_day_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 37, }, File: "week_day_duration_test.flux", Source: "start", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "week_day_duration_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 25, Line: 37, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 37, }, File: "week_day_duration_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 12, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 37, }, File: "week_day_duration_test.flux", Source: "range", Start: ast.Position{ Column: 12, Line: 37, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 85, Line: 38, }, File: "week_day_duration_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.weekDay(t: duration(v: r._value))}))", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 38, }, File: "week_day_duration_test.flux", Source: "fn: (r) => ({r with _value: date.weekDay(t: duration(v: r._value))})", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 38, }, File: "week_day_duration_test.flux", Source: "fn: (r) => ({r with _value: date.weekDay(t: duration(v: r._value))})", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 38, }, File: "week_day_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 38, }, File: "week_day_duration_test.flux", Source: "(r) => ({r with _value: date.weekDay(t: duration(v: r._value))})", Start: ast.Position{ Column: 20, Line: 38, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 38, }, File: "week_day_duration_test.flux", Source: "({r with _value: date.weekDay(t: duration(v: r._value))})", Start: ast.Position{ Column: 27, Line: 38, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 38, }, File: "week_day_duration_test.flux", Source: "{r with _value: date.weekDay(t: duration(v: r._value))}", Start: ast.Position{ Column: 28, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 38, }, File: "week_day_duration_test.flux", Source: "_value: date.weekDay(t: duration(v: r._value))", Start: ast.Position{ Column: 36, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 38, }, File: "week_day_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 36, 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: 81, Line: 38, }, File: "week_day_duration_test.flux", Source: "t: duration(v: r._value)", Start: ast.Position{ Column: 57, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 38, }, File: "week_day_duration_test.flux", Source: "t: duration(v: r._value)", Start: ast.Position{ Column: 57, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 38, }, File: "week_day_duration_test.flux", Source: "t", Start: ast.Position{ Column: 57, Line: 38, }, }, }, Name: "t", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 38, }, File: "week_day_duration_test.flux", Source: "v: r._value", Start: ast.Position{ Column: 69, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 38, }, File: "week_day_duration_test.flux", Source: "v: r._value", Start: ast.Position{ Column: 69, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 38, }, File: "week_day_duration_test.flux", Source: "v", Start: ast.Position{ Column: 69, Line: 38, }, }, }, Name: "v", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 38, }, File: "week_day_duration_test.flux", Source: "r._value", Start: ast.Position{ Column: 72, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 38, }, File: "week_day_duration_test.flux", Source: "r", Start: ast.Position{ Column: 72, Line: 38, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 38, }, File: "week_day_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 74, Line: 38, }, }, }, Name: "_value", }, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 38, }, File: "week_day_duration_test.flux", Source: "duration(v: r._value)", Start: ast.Position{ Column: 60, Line: 38, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 38, }, File: "week_day_duration_test.flux", Source: "duration", Start: ast.Position{ Column: 60, Line: 38, }, }, }, Name: "duration", }, Lparen: nil, Rparen: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 38, }, File: "week_day_duration_test.flux", Source: "date.weekDay(t: duration(v: r._value))", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 56, Line: 38, }, File: "week_day_duration_test.flux", Source: "date.weekDay", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 38, }, File: "week_day_duration_test.flux", Source: "date", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 56, Line: 38, }, File: "week_day_duration_test.flux", Source: "weekDay", Start: ast.Position{ Column: 49, Line: 38, }, }, }, Name: "weekDay", }, 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: 30, Line: 38, }, File: "week_day_duration_test.flux", Source: "r", Start: ast.Position{ Column: 29, 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: 22, Line: 38, }, File: "week_day_duration_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 38, }, File: "week_day_duration_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 38, }, }, }, 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: 85, Line: 38, }, File: "week_day_duration_test.flux", Source: "map(fn: (r) => ({r with _value: date.weekDay(t: duration(v: r._value))}))", Start: ast.Position{ Column: 12, Line: 38, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 38, }, File: "week_day_duration_test.flux", Source: "map", Start: ast.Position{ Column: 12, Line: 38, }, }, }, 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: 32, Line: 35, }, File: "week_day_duration_test.flux", Source: "table=<-", Start: ast.Position{ Column: 24, Line: 35, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 35, }, File: "week_day_duration_test.flux", Source: "table", Start: ast.Position{ Column: 24, Line: 35, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 32, Line: 35, }, File: "week_day_duration_test.flux", Source: "<-", Start: ast.Position{ Column: 30, Line: 35, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 110, Line: 41, }, File: "week_day_duration_test.flux", Source: "_duration_week_day = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_week_day})", 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: "week_day_duration_test.flux", Source: "_duration_week_day", Start: ast.Position{ Column: 6, Line: 40, }, }, }, Name: "_duration_week_day", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 110, Line: 41, }, File: "week_day_duration_test.flux", Source: "() =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_week_day})", Start: ast.Position{ Column: 27, Line: 40, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 110, Line: 41, }, File: "week_day_duration_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_week_day})", Start: ast.Position{ Column: 5, Line: 41, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 109, Line: 41, }, File: "week_day_duration_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_week_day}", Start: ast.Position{ Column: 6, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 41, }, File: "week_day_duration_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 7, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 41, }, File: "week_day_duration_test.flux", Source: "input", Start: ast.Position{ Column: 7, 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: 45, Line: 41, }, File: "week_day_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 41, }, File: "week_day_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 41, }, File: "week_day_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 41, }, File: "week_day_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 39, Line: 41, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 41, }, File: "week_day_duration_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 41, }, File: "week_day_duration_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 41, }, File: "week_day_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 41, }, File: "week_day_duration_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 22, 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: 83, Line: 41, }, File: "week_day_duration_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 48, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 41, }, File: "week_day_duration_test.flux", Source: "want", Start: ast.Position{ Column: 48, 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: 82, Line: 41, }, File: "week_day_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 41, }, File: "week_day_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 41, }, File: "week_day_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 41, }, File: "week_day_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 75, Line: 41, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 41, }, File: "week_day_duration_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 41, }, File: "week_day_duration_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 41, }, File: "week_day_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 41, }, File: "week_day_duration_test.flux", Source: "loadMem", Start: ast.Position{ Column: 62, 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: 108, Line: 41, }, File: "week_day_duration_test.flux", Source: "fn: t_duration_week_day", Start: ast.Position{ Column: 85, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 41, }, File: "week_day_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 85, Line: 41, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 41, }, File: "week_day_duration_test.flux", Source: "t_duration_week_day", Start: ast.Position{ Column: 89, Line: 41, }, }, }, Name: "t_duration_week_day", }, }}, 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: 110, Line: 41, }, File: "week_day_duration_test.flux", Source: "test _duration_week_day = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_week_day})", 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: 4, }, File: "week_day_duration_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: "week_day_duration_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "week_day_duration_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "week_day_duration_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "week_day_duration_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "week_day_duration_test.flux", Source: "package date_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: 18, Line: 1, }, File: "week_day_duration_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 45, }, File: "week_day_time_test.flux", Source: "package date_test\n\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => 2030-01-01T00:00:00Z\n\ninData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-20T19:53:00Z,_m,FF,1\n,,0,2018-05-21T19:53:10Z,_m,FF,1\n,,0,2018-05-22T19:53:20Z,_m,FF,1\n,,0,2018-05-23T19:53:30Z,_m,FF,1\n,,0,2018-05-24T19:53:40Z,_m,FF,1\n,,0,2018-05-25T19:53:50Z,_m,FF,1\n,,1,2018-05-26T19:53:00Z,_m,QQ,1\n,,1,2018-05-27T19:53:10Z,_m,QQ,1\n\"\noutData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-20T19:53:00Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-21T19:53:10Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:20Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-23T19:53:30Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-24T19:53:40Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-25T19:53:50Z,5\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-26T19:53:00Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-27T19:53:10Z,0\n\"\nt_time_week_day = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.weekDay(t: r._time)}))\n\ntest _time_week_day = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_week_day})", 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: 40, Line: 7, }, File: "week_day_time_test.flux", Source: "now = () => 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: "week_day_time_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: 40, Line: 7, }, File: "week_day_time_test.flux", Source: "() => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "week_day_time_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 20, Line: 7, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "week_day_time_test.flux", Source: "option now = () => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 23, }, File: "week_day_time_test.flux", Source: "inData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-20T19:53:00Z,_m,FF,1\n,,0,2018-05-21T19:53:10Z,_m,FF,1\n,,0,2018-05-22T19:53:20Z,_m,FF,1\n,,0,2018-05-23T19:53:30Z,_m,FF,1\n,,0,2018-05-24T19:53:40Z,_m,FF,1\n,,0,2018-05-25T19:53:50Z,_m,FF,1\n,,1,2018-05-26T19:53:00Z,_m,QQ,1\n,,1,2018-05-27T19:53:10Z,_m,QQ,1\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: "week_day_time_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: 23, }, File: "week_day_time_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-20T19:53:00Z,_m,FF,1\n,,0,2018-05-21T19:53:10Z,_m,FF,1\n,,0,2018-05-22T19:53:20Z,_m,FF,1\n,,0,2018-05-23T19:53:30Z,_m,FF,1\n,,0,2018-05-24T19:53:40Z,_m,FF,1\n,,0,2018-05-25T19:53:50Z,_m,FF,1\n,,1,2018-05-26T19:53:00Z,_m,QQ,1\n,,1,2018-05-27T19:53:10Z,_m,QQ,1\n\"", Start: ast.Position{ Column: 5, Line: 10, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-20T19:53:00Z,_m,FF,1\n,,0,2018-05-21T19:53:10Z,_m,FF,1\n,,0,2018-05-22T19:53:20Z,_m,FF,1\n,,0,2018-05-23T19:53:30Z,_m,FF,1\n,,0,2018-05-24T19:53:40Z,_m,FF,1\n,,0,2018-05-25T19:53:50Z,_m,FF,1\n,,1,2018-05-26T19:53:00Z,_m,QQ,1\n,,1,2018-05-27T19:53:10Z,_m,QQ,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 38, }, File: "week_day_time_test.flux", Source: "outData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-20T19:53:00Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-21T19:53:10Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:20Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-23T19:53:30Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-24T19:53:40Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-25T19:53:50Z,5\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-26T19:53:00Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-27T19:53:10Z,0\n\"", Start: ast.Position{ Column: 1, Line: 24, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 24, }, File: "week_day_time_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 24, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 38, }, File: "week_day_time_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-20T19:53:00Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-21T19:53:10Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:20Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-23T19:53:30Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-24T19:53:40Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-25T19:53:50Z,5\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-26T19:53:00Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-27T19:53:10Z,0\n\"", Start: ast.Position{ Column: 5, Line: 25, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-20T19:53:00Z,0\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-21T19:53:10Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:20Z,2\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-23T19:53:30Z,3\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-24T19:53:40Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-25T19:53:50Z,5\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-26T19:53:00Z,6\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-27T19:53:10Z,0\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 42, }, File: "week_day_time_test.flux", Source: "t_time_week_day = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.weekDay(t: r._time)}))", Start: ast.Position{ Column: 1, Line: 39, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 39, }, File: "week_day_time_test.flux", Source: "t_time_week_day", Start: ast.Position{ Column: 1, Line: 39, }, }, }, Name: "t_time_week_day", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 42, }, File: "week_day_time_test.flux", Source: "(table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.weekDay(t: r._time)}))", Start: ast.Position{ Column: 19, Line: 39, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 40, }, File: "week_day_time_test.flux", Source: "table", Start: ast.Position{ Column: 5, Line: 40, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 41, }, File: "week_day_time_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 5, Line: 40, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 41, }, File: "week_day_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 41, }, File: "week_day_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 41, }, File: "week_day_time_test.flux", Source: "start", Start: ast.Position{ Column: 18, Line: 41, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 41, }, File: "week_day_time_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 25, Line: 41, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 41, }, File: "week_day_time_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 12, Line: 41, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 41, }, File: "week_day_time_test.flux", Source: "range", Start: ast.Position{ Column: 12, Line: 41, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 42, }, File: "week_day_time_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.weekDay(t: r._time)}))", Start: ast.Position{ Column: 5, Line: 40, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 42, }, File: "week_day_time_test.flux", Source: "fn: (r) => ({r with _value: date.weekDay(t: r._time)})", Start: ast.Position{ Column: 16, Line: 42, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 42, }, File: "week_day_time_test.flux", Source: "fn: (r) => ({r with _value: date.weekDay(t: r._time)})", Start: ast.Position{ Column: 16, Line: 42, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 42, }, File: "week_day_time_test.flux", Source: "fn", Start: ast.Position{ Column: 16, Line: 42, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 42, }, File: "week_day_time_test.flux", Source: "(r) => ({r with _value: date.weekDay(t: r._time)})", Start: ast.Position{ Column: 20, Line: 42, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 42, }, File: "week_day_time_test.flux", Source: "({r with _value: date.weekDay(t: r._time)})", Start: ast.Position{ Column: 27, Line: 42, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 42, }, File: "week_day_time_test.flux", Source: "{r with _value: date.weekDay(t: r._time)}", Start: ast.Position{ Column: 28, Line: 42, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 42, }, File: "week_day_time_test.flux", Source: "_value: date.weekDay(t: r._time)", Start: ast.Position{ Column: 36, Line: 42, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 42, }, File: "week_day_time_test.flux", Source: "_value", Start: ast.Position{ Column: 36, Line: 42, }, }, }, 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: 67, Line: 42, }, File: "week_day_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 57, Line: 42, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 42, }, File: "week_day_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 57, Line: 42, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 42, }, File: "week_day_time_test.flux", Source: "t", Start: ast.Position{ Column: 57, Line: 42, }, }, }, Name: "t", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 42, }, File: "week_day_time_test.flux", Source: "r._time", Start: ast.Position{ Column: 60, Line: 42, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 42, }, File: "week_day_time_test.flux", Source: "r", Start: ast.Position{ Column: 60, Line: 42, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 42, }, File: "week_day_time_test.flux", Source: "_time", Start: ast.Position{ Column: 62, Line: 42, }, }, }, Name: "_time", }, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 42, }, File: "week_day_time_test.flux", Source: "date.weekDay(t: r._time)", Start: ast.Position{ Column: 44, Line: 42, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 56, Line: 42, }, File: "week_day_time_test.flux", Source: "date.weekDay", Start: ast.Position{ Column: 44, Line: 42, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 42, }, File: "week_day_time_test.flux", Source: "date", Start: ast.Position{ Column: 44, Line: 42, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 56, Line: 42, }, File: "week_day_time_test.flux", Source: "weekDay", Start: ast.Position{ Column: 49, Line: 42, }, }, }, Name: "weekDay", }, 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: 30, Line: 42, }, File: "week_day_time_test.flux", Source: "r", Start: ast.Position{ Column: 29, Line: 42, }, }, }, 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: 22, Line: 42, }, File: "week_day_time_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 42, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 42, }, File: "week_day_time_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 42, }, }, }, 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: 71, Line: 42, }, File: "week_day_time_test.flux", Source: "map(fn: (r) => ({r with _value: date.weekDay(t: r._time)}))", Start: ast.Position{ Column: 12, Line: 42, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 42, }, File: "week_day_time_test.flux", Source: "map", Start: ast.Position{ Column: 12, Line: 42, }, }, }, 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: 28, Line: 39, }, File: "week_day_time_test.flux", Source: "table=<-", Start: ast.Position{ Column: 20, Line: 39, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 39, }, File: "week_day_time_test.flux", Source: "table", Start: ast.Position{ Column: 20, Line: 39, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 39, }, File: "week_day_time_test.flux", Source: "<-", Start: ast.Position{ Column: 26, Line: 39, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 45, }, File: "week_day_time_test.flux", Source: "_time_week_day = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_week_day})", Start: ast.Position{ Column: 6, Line: 44, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 44, }, File: "week_day_time_test.flux", Source: "_time_week_day", Start: ast.Position{ Column: 6, Line: 44, }, }, }, Name: "_time_week_day", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 45, }, File: "week_day_time_test.flux", Source: "() =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_week_day})", Start: ast.Position{ Column: 23, Line: 44, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 45, }, File: "week_day_time_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_week_day})", Start: ast.Position{ Column: 5, Line: 45, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 45, }, File: "week_day_time_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_week_day}", Start: ast.Position{ Column: 6, Line: 45, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 45, }, File: "week_day_time_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 7, Line: 45, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 45, }, File: "week_day_time_test.flux", Source: "input", Start: ast.Position{ Column: 7, 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: 45, Line: 45, }, File: "week_day_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, 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: "week_day_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 45, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 45, }, File: "week_day_time_test.flux", Source: "csv", Start: ast.Position{ Column: 34, Line: 45, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 45, }, File: "week_day_time_test.flux", Source: "inData", Start: ast.Position{ Column: 39, Line: 45, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 45, }, File: "week_day_time_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 14, Line: 45, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 45, }, File: "week_day_time_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 14, Line: 45, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 45, }, File: "week_day_time_test.flux", Source: "testing", Start: ast.Position{ Column: 14, Line: 45, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 45, }, File: "week_day_time_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 22, 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: 83, Line: 45, }, File: "week_day_time_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 48, Line: 45, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 45, }, File: "week_day_time_test.flux", Source: "want", Start: ast.Position{ Column: 48, 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: 82, Line: 45, }, File: "week_day_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 45, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 45, }, File: "week_day_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 45, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 45, }, File: "week_day_time_test.flux", Source: "csv", Start: ast.Position{ Column: 70, Line: 45, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 45, }, File: "week_day_time_test.flux", Source: "outData", Start: ast.Position{ Column: 75, Line: 45, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 45, }, File: "week_day_time_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 54, Line: 45, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 45, }, File: "week_day_time_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 54, Line: 45, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 45, }, File: "week_day_time_test.flux", Source: "testing", Start: ast.Position{ Column: 54, Line: 45, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 45, }, File: "week_day_time_test.flux", Source: "loadMem", Start: ast.Position{ Column: 62, 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: 104, Line: 45, }, File: "week_day_time_test.flux", Source: "fn: t_time_week_day", Start: ast.Position{ Column: 85, Line: 45, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 45, }, File: "week_day_time_test.flux", Source: "fn", Start: ast.Position{ Column: 85, Line: 45, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 45, }, File: "week_day_time_test.flux", Source: "t_time_week_day", Start: ast.Position{ Column: 89, Line: 45, }, }, }, Name: "t_time_week_day", }, }}, 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: 45, }, File: "week_day_time_test.flux", Source: "test _time_week_day = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_week_day})", 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: 17, Line: 4, }, File: "week_day_time_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: "week_day_time_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "week_day_time_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "week_day_time_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "week_day_time_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "week_day_time_test.flux", Source: "package date_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: 18, Line: 1, }, File: "week_day_time_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 41, }, File: "week_duration_test.flux", Source: "package date_test\n\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => 2030-01-01T00:00:00Z\n\ninData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"\noutData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n\"\nt_duration_week = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.week(t: duration(v: r._value))}))\n\ntest _duration_week = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_week})", 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: 40, Line: 7, }, File: "week_duration_test.flux", Source: "now = () => 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: "week_duration_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: 40, Line: 7, }, File: "week_duration_test.flux", Source: "() => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "week_duration_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 20, Line: 7, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "week_duration_test.flux", Source: "option now = () => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 21, }, File: "week_duration_test.flux", Source: "inData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\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: "week_duration_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: 21, }, File: "week_duration_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 5, Line: 10, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "week_duration_test.flux", Source: "outData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n\"", Start: ast.Position{ Column: 1, Line: 22, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 22, }, File: "week_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 22, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "week_duration_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n\"", Start: ast.Position{ Column: 5, Line: 23, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 38, }, File: "week_duration_test.flux", Source: "t_duration_week = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.week(t: duration(v: r._value))}))", Start: ast.Position{ Column: 1, Line: 35, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 35, }, File: "week_duration_test.flux", Source: "t_duration_week", Start: ast.Position{ Column: 1, Line: 35, }, }, }, Name: "t_duration_week", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 38, }, File: "week_duration_test.flux", Source: "(table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.week(t: duration(v: r._value))}))", Start: ast.Position{ Column: 19, Line: 35, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 36, }, File: "week_duration_test.flux", Source: "table", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 37, }, File: "week_duration_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "week_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "week_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 37, }, File: "week_duration_test.flux", Source: "start", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "week_duration_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 25, Line: 37, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 37, }, File: "week_duration_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 12, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 37, }, File: "week_duration_test.flux", Source: "range", Start: ast.Position{ Column: 12, Line: 37, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 38, }, File: "week_duration_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.week(t: duration(v: r._value))}))", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 38, }, File: "week_duration_test.flux", Source: "fn: (r) => ({r with _value: date.week(t: duration(v: r._value))})", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 38, }, File: "week_duration_test.flux", Source: "fn: (r) => ({r with _value: date.week(t: duration(v: r._value))})", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 38, }, File: "week_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 38, }, File: "week_duration_test.flux", Source: "(r) => ({r with _value: date.week(t: duration(v: r._value))})", Start: ast.Position{ Column: 20, Line: 38, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 38, }, File: "week_duration_test.flux", Source: "({r with _value: date.week(t: duration(v: r._value))})", Start: ast.Position{ Column: 27, Line: 38, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 38, }, File: "week_duration_test.flux", Source: "{r with _value: date.week(t: duration(v: r._value))}", Start: ast.Position{ Column: 28, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 38, }, File: "week_duration_test.flux", Source: "_value: date.week(t: duration(v: r._value))", Start: ast.Position{ Column: 36, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 38, }, File: "week_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 36, 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: 78, Line: 38, }, File: "week_duration_test.flux", Source: "t: duration(v: r._value)", Start: ast.Position{ Column: 54, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 38, }, File: "week_duration_test.flux", Source: "t: duration(v: r._value)", Start: ast.Position{ Column: 54, 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: "week_duration_test.flux", Source: "t", Start: ast.Position{ Column: 54, Line: 38, }, }, }, Name: "t", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 38, }, File: "week_duration_test.flux", Source: "v: r._value", Start: ast.Position{ Column: 66, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 38, }, File: "week_duration_test.flux", Source: "v: r._value", Start: ast.Position{ Column: 66, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 38, }, File: "week_duration_test.flux", Source: "v", Start: ast.Position{ Column: 66, Line: 38, }, }, }, Name: "v", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 38, }, File: "week_duration_test.flux", Source: "r._value", Start: ast.Position{ Column: 69, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 38, }, File: "week_duration_test.flux", Source: "r", Start: ast.Position{ Column: 69, Line: 38, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 38, }, File: "week_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 71, Line: 38, }, }, }, Name: "_value", }, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 38, }, File: "week_duration_test.flux", Source: "duration(v: r._value)", Start: ast.Position{ Column: 57, Line: 38, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 38, }, File: "week_duration_test.flux", Source: "duration", Start: ast.Position{ Column: 57, Line: 38, }, }, }, Name: "duration", }, Lparen: nil, Rparen: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 38, }, File: "week_duration_test.flux", Source: "date.week(t: duration(v: r._value))", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 38, }, File: "week_duration_test.flux", Source: "date.week", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 38, }, File: "week_duration_test.flux", Source: "date", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 38, }, File: "week_duration_test.flux", Source: "week", Start: ast.Position{ Column: 49, Line: 38, }, }, }, Name: "week", }, 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: 30, Line: 38, }, File: "week_duration_test.flux", Source: "r", Start: ast.Position{ Column: 29, 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: 22, Line: 38, }, File: "week_duration_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 38, }, File: "week_duration_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 38, }, }, }, 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: 82, Line: 38, }, File: "week_duration_test.flux", Source: "map(fn: (r) => ({r with _value: date.week(t: duration(v: r._value))}))", Start: ast.Position{ Column: 12, Line: 38, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 38, }, File: "week_duration_test.flux", Source: "map", Start: ast.Position{ Column: 12, Line: 38, }, }, }, 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: 28, Line: 35, }, File: "week_duration_test.flux", Source: "table=<-", Start: ast.Position{ Column: 20, Line: 35, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 35, }, File: "week_duration_test.flux", Source: "table", Start: ast.Position{ Column: 20, Line: 35, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 35, }, File: "week_duration_test.flux", Source: "<-", Start: ast.Position{ Column: 26, Line: 35, }, }, }}, }}, 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: "week_duration_test.flux", Source: "_duration_week = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_week})", Start: ast.Position{ Column: 6, Line: 40, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 40, }, File: "week_duration_test.flux", Source: "_duration_week", Start: ast.Position{ Column: 6, Line: 40, }, }, }, Name: "_duration_week", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 41, }, File: "week_duration_test.flux", Source: "() =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_week})", Start: ast.Position{ Column: 23, Line: 40, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 41, }, File: "week_duration_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_week})", Start: ast.Position{ Column: 5, Line: 41, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 41, }, File: "week_duration_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_week}", Start: ast.Position{ Column: 6, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 41, }, File: "week_duration_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 7, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 41, }, File: "week_duration_test.flux", Source: "input", Start: ast.Position{ Column: 7, 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: 45, Line: 41, }, File: "week_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 41, }, File: "week_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 41, }, File: "week_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 41, }, File: "week_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 39, Line: 41, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 41, }, File: "week_duration_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 41, }, File: "week_duration_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 41, }, File: "week_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 41, }, File: "week_duration_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 22, 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: 83, Line: 41, }, File: "week_duration_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 48, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 41, }, File: "week_duration_test.flux", Source: "want", Start: ast.Position{ Column: 48, 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: 82, Line: 41, }, File: "week_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 41, }, File: "week_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 41, }, File: "week_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 41, }, File: "week_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 75, Line: 41, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 41, }, File: "week_duration_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 41, }, File: "week_duration_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 41, }, File: "week_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 41, }, File: "week_duration_test.flux", Source: "loadMem", Start: ast.Position{ Column: 62, 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: "week_duration_test.flux", Source: "fn: t_duration_week", Start: ast.Position{ Column: 85, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 41, }, File: "week_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 85, 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: "week_duration_test.flux", Source: "t_duration_week", Start: ast.Position{ Column: 89, Line: 41, }, }, }, Name: "t_duration_week", }, }}, 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: "week_duration_test.flux", Source: "test _duration_week = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_week})", 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: 4, }, File: "week_duration_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: "week_duration_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "week_duration_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "week_duration_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "week_duration_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "week_duration_test.flux", Source: "package date_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: 18, Line: 1, }, File: "week_duration_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 53, }, File: "week_time_test.flux", Source: "package date_test\n\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => 2030-01-01T00:00:00Z\n\ninData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-01-22T19:53:00Z,_m,FF,1\n,,0,2018-02-22T19:53:10Z,_m,FF,1\n,,0,2018-03-22T19:53:20Z,_m,FF,1\n,,0,2018-04-22T19:53:30Z,_m,FF,1\n,,0,2018-05-22T19:53:40Z,_m,FF,1\n,,0,2018-06-22T19:53:50Z,_m,FF,1\n,,1,2018-07-22T19:53:00Z,_m,QQ,1\n,,1,2018-08-22T19:53:10Z,_m,QQ,1\n,,1,2018-09-22T19:53:20Z,_m,QQ,1\n,,1,2018-10-22T19:53:30Z,_m,QQ,1\n,,1,2018-11-22T19:53:40Z,_m,QQ,1\n,,1,2018-12-22T19:53:50Z,_m,QQ,1\n\"\noutData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-01-22T19:53:00Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-02-22T19:53:10Z,8\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-03-22T19:53:20Z,12\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-04-22T19:53:30Z,16\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:40Z,21\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-06-22T19:53:50Z,25\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-07-22T19:53:00Z,29\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-08-22T19:53:10Z,34\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-09-22T19:53:20Z,38\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-10-22T19:53:30Z,43\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-11-22T19:53:40Z,47\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-12-22T19:53:50Z,51\n\"\nt_time_week = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.week(t: r._time)}))\n\ntest _time_week = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_week})", 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: 40, Line: 7, }, File: "week_time_test.flux", Source: "now = () => 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: "week_time_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: 40, Line: 7, }, File: "week_time_test.flux", Source: "() => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "week_time_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 20, Line: 7, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "week_time_test.flux", Source: "option now = () => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 27, }, File: "week_time_test.flux", Source: "inData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-01-22T19:53:00Z,_m,FF,1\n,,0,2018-02-22T19:53:10Z,_m,FF,1\n,,0,2018-03-22T19:53:20Z,_m,FF,1\n,,0,2018-04-22T19:53:30Z,_m,FF,1\n,,0,2018-05-22T19:53:40Z,_m,FF,1\n,,0,2018-06-22T19:53:50Z,_m,FF,1\n,,1,2018-07-22T19:53:00Z,_m,QQ,1\n,,1,2018-08-22T19:53:10Z,_m,QQ,1\n,,1,2018-09-22T19:53:20Z,_m,QQ,1\n,,1,2018-10-22T19:53:30Z,_m,QQ,1\n,,1,2018-11-22T19:53:40Z,_m,QQ,1\n,,1,2018-12-22T19:53:50Z,_m,QQ,1\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: "week_time_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: 27, }, File: "week_time_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-01-22T19:53:00Z,_m,FF,1\n,,0,2018-02-22T19:53:10Z,_m,FF,1\n,,0,2018-03-22T19:53:20Z,_m,FF,1\n,,0,2018-04-22T19:53:30Z,_m,FF,1\n,,0,2018-05-22T19:53:40Z,_m,FF,1\n,,0,2018-06-22T19:53:50Z,_m,FF,1\n,,1,2018-07-22T19:53:00Z,_m,QQ,1\n,,1,2018-08-22T19:53:10Z,_m,QQ,1\n,,1,2018-09-22T19:53:20Z,_m,QQ,1\n,,1,2018-10-22T19:53:30Z,_m,QQ,1\n,,1,2018-11-22T19:53:40Z,_m,QQ,1\n,,1,2018-12-22T19:53:50Z,_m,QQ,1\n\"", Start: ast.Position{ Column: 5, Line: 10, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-01-22T19:53:00Z,_m,FF,1\n,,0,2018-02-22T19:53:10Z,_m,FF,1\n,,0,2018-03-22T19:53:20Z,_m,FF,1\n,,0,2018-04-22T19:53:30Z,_m,FF,1\n,,0,2018-05-22T19:53:40Z,_m,FF,1\n,,0,2018-06-22T19:53:50Z,_m,FF,1\n,,1,2018-07-22T19:53:00Z,_m,QQ,1\n,,1,2018-08-22T19:53:10Z,_m,QQ,1\n,,1,2018-09-22T19:53:20Z,_m,QQ,1\n,,1,2018-10-22T19:53:30Z,_m,QQ,1\n,,1,2018-11-22T19:53:40Z,_m,QQ,1\n,,1,2018-12-22T19:53:50Z,_m,QQ,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 46, }, File: "week_time_test.flux", Source: "outData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-01-22T19:53:00Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-02-22T19:53:10Z,8\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-03-22T19:53:20Z,12\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-04-22T19:53:30Z,16\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:40Z,21\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-06-22T19:53:50Z,25\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-07-22T19:53:00Z,29\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-08-22T19:53:10Z,34\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-09-22T19:53:20Z,38\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-10-22T19:53:30Z,43\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-11-22T19:53:40Z,47\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-12-22T19:53:50Z,51\n\"", Start: ast.Position{ Column: 1, Line: 28, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 28, }, File: "week_time_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 28, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 46, }, File: "week_time_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-01-22T19:53:00Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-02-22T19:53:10Z,8\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-03-22T19:53:20Z,12\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-04-22T19:53:30Z,16\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:40Z,21\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-06-22T19:53:50Z,25\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-07-22T19:53:00Z,29\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-08-22T19:53:10Z,34\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-09-22T19:53:20Z,38\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-10-22T19:53:30Z,43\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-11-22T19:53:40Z,47\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-12-22T19:53:50Z,51\n\"", Start: ast.Position{ Column: 5, Line: 29, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-01-22T19:53:00Z,4\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-02-22T19:53:10Z,8\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-03-22T19:53:20Z,12\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-04-22T19:53:30Z,16\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:40Z,21\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-06-22T19:53:50Z,25\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-07-22T19:53:00Z,29\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-08-22T19:53:10Z,34\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-09-22T19:53:20Z,38\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-10-22T19:53:30Z,43\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-11-22T19:53:40Z,47\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-12-22T19:53:50Z,51\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 50, }, File: "week_time_test.flux", Source: "t_time_week = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.week(t: r._time)}))", Start: ast.Position{ Column: 1, Line: 47, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 47, }, File: "week_time_test.flux", Source: "t_time_week", Start: ast.Position{ Column: 1, Line: 47, }, }, }, Name: "t_time_week", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 50, }, File: "week_time_test.flux", Source: "(table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.week(t: r._time)}))", Start: ast.Position{ Column: 15, Line: 47, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 48, }, File: "week_time_test.flux", Source: "table", Start: ast.Position{ Column: 5, Line: 48, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 49, }, File: "week_time_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 5, Line: 48, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 49, }, File: "week_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, 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: "week_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 49, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 49, }, File: "week_time_test.flux", Source: "start", Start: ast.Position{ Column: 18, Line: 49, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 49, }, File: "week_time_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 25, Line: 49, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 49, }, File: "week_time_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 12, Line: 49, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 49, }, File: "week_time_test.flux", Source: "range", Start: ast.Position{ Column: 12, Line: 49, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 50, }, File: "week_time_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.week(t: r._time)}))", Start: ast.Position{ Column: 5, Line: 48, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 50, }, File: "week_time_test.flux", Source: "fn: (r) => ({r with _value: date.week(t: r._time)})", Start: ast.Position{ Column: 16, Line: 50, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 50, }, File: "week_time_test.flux", Source: "fn: (r) => ({r with _value: date.week(t: r._time)})", Start: ast.Position{ Column: 16, Line: 50, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 50, }, File: "week_time_test.flux", Source: "fn", Start: ast.Position{ Column: 16, Line: 50, }, }, }, 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: 50, }, File: "week_time_test.flux", Source: "(r) => ({r with _value: date.week(t: r._time)})", Start: ast.Position{ Column: 20, Line: 50, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 50, }, File: "week_time_test.flux", Source: "({r with _value: date.week(t: r._time)})", Start: ast.Position{ Column: 27, Line: 50, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 50, }, File: "week_time_test.flux", Source: "{r with _value: date.week(t: r._time)}", Start: ast.Position{ Column: 28, Line: 50, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 50, }, File: "week_time_test.flux", Source: "_value: date.week(t: r._time)", Start: ast.Position{ Column: 36, Line: 50, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 50, }, File: "week_time_test.flux", Source: "_value", Start: ast.Position{ Column: 36, Line: 50, }, }, }, 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: 50, }, File: "week_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 54, Line: 50, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 50, }, File: "week_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 54, Line: 50, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 55, Line: 50, }, File: "week_time_test.flux", Source: "t", Start: ast.Position{ Column: 54, Line: 50, }, }, }, Name: "t", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 50, }, File: "week_time_test.flux", Source: "r._time", Start: ast.Position{ Column: 57, Line: 50, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 50, }, File: "week_time_test.flux", Source: "r", Start: ast.Position{ Column: 57, Line: 50, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 50, }, File: "week_time_test.flux", Source: "_time", Start: ast.Position{ Column: 59, Line: 50, }, }, }, Name: "_time", }, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 50, }, File: "week_time_test.flux", Source: "date.week(t: r._time)", Start: ast.Position{ Column: 44, Line: 50, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 50, }, File: "week_time_test.flux", Source: "date.week", Start: ast.Position{ Column: 44, Line: 50, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 50, }, File: "week_time_test.flux", Source: "date", Start: ast.Position{ Column: 44, Line: 50, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 50, }, File: "week_time_test.flux", Source: "week", Start: ast.Position{ Column: 49, Line: 50, }, }, }, Name: "week", }, 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: 30, Line: 50, }, File: "week_time_test.flux", Source: "r", Start: ast.Position{ Column: 29, Line: 50, }, }, }, 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: 22, Line: 50, }, File: "week_time_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 50, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 50, }, File: "week_time_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 50, }, }, }, 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: 50, }, File: "week_time_test.flux", Source: "map(fn: (r) => ({r with _value: date.week(t: r._time)}))", Start: ast.Position{ Column: 12, Line: 50, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 50, }, File: "week_time_test.flux", Source: "map", Start: ast.Position{ Column: 12, Line: 50, }, }, }, 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: 24, Line: 47, }, File: "week_time_test.flux", Source: "table=<-", Start: ast.Position{ Column: 16, Line: 47, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 47, }, File: "week_time_test.flux", Source: "table", Start: ast.Position{ Column: 16, Line: 47, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 47, }, File: "week_time_test.flux", Source: "<-", Start: ast.Position{ Column: 22, Line: 47, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 53, }, File: "week_time_test.flux", Source: "_time_week = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_week})", Start: ast.Position{ Column: 6, Line: 52, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 52, }, File: "week_time_test.flux", Source: "_time_week", Start: ast.Position{ Column: 6, Line: 52, }, }, }, Name: "_time_week", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 53, }, File: "week_time_test.flux", Source: "() =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_week})", Start: ast.Position{ Column: 19, Line: 52, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 53, }, File: "week_time_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_week})", Start: ast.Position{ Column: 5, Line: 53, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 53, }, File: "week_time_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_week}", Start: ast.Position{ Column: 6, 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: "week_time_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 7, Line: 53, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 53, }, File: "week_time_test.flux", Source: "input", Start: ast.Position{ Column: 7, Line: 53, }, }, }, 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: 53, }, File: "week_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, 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: "week_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 53, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 53, }, File: "week_time_test.flux", Source: "csv", Start: ast.Position{ Column: 34, Line: 53, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 53, }, File: "week_time_test.flux", Source: "inData", Start: ast.Position{ Column: 39, Line: 53, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 53, }, File: "week_time_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 14, Line: 53, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 53, }, File: "week_time_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 14, Line: 53, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 53, }, File: "week_time_test.flux", Source: "testing", Start: ast.Position{ Column: 14, Line: 53, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 53, }, File: "week_time_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 22, Line: 53, }, }, }, 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: 53, }, File: "week_time_test.flux", Source: "want: testing.loadMem(csv: outData)", 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: 52, Line: 53, }, File: "week_time_test.flux", Source: "want", Start: ast.Position{ Column: 48, Line: 53, }, }, }, 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: 53, }, File: "week_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 53, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 53, }, File: "week_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 53, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 53, }, File: "week_time_test.flux", Source: "csv", Start: ast.Position{ Column: 70, Line: 53, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 53, }, File: "week_time_test.flux", Source: "outData", Start: ast.Position{ Column: 75, Line: 53, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 53, }, File: "week_time_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 54, Line: 53, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 53, }, File: "week_time_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 54, Line: 53, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 53, }, File: "week_time_test.flux", Source: "testing", Start: ast.Position{ Column: 54, Line: 53, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 53, }, File: "week_time_test.flux", Source: "loadMem", Start: ast.Position{ Column: 62, Line: 53, }, }, }, 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: 53, }, File: "week_time_test.flux", Source: "fn: t_time_week", Start: ast.Position{ Column: 85, Line: 53, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 53, }, File: "week_time_test.flux", Source: "fn", Start: ast.Position{ Column: 85, Line: 53, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 53, }, File: "week_time_test.flux", Source: "t_time_week", Start: ast.Position{ Column: 89, Line: 53, }, }, }, Name: "t_time_week", }, }}, 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: 53, }, File: "week_time_test.flux", Source: "test _time_week = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_week})", Start: ast.Position{ Column: 1, Line: 52, }, }, }, }}, 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: 4, }, File: "week_time_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: "week_time_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "week_time_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "week_time_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "week_time_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "week_time_test.flux", Source: "package date_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: 18, Line: 1, }, File: "week_time_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 110, Line: 41, }, File: "year_day_duration_test.flux", Source: "package date_test\n\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => 2030-01-01T00:00:00Z\n\ninData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"\noutData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,365\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,365\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,365\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n\"\nt_duration_year_day = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.yearDay(t: duration(v: r._value))}))\n\ntest _duration_year_day = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_year_day})", 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: 40, Line: 7, }, File: "year_day_duration_test.flux", Source: "now = () => 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: "year_day_duration_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: 40, Line: 7, }, File: "year_day_duration_test.flux", Source: "() => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "year_day_duration_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 20, Line: 7, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "year_day_duration_test.flux", Source: "option now = () => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 21, }, File: "year_day_duration_test.flux", Source: "inData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\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: "year_day_duration_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: 21, }, File: "year_day_duration_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 5, Line: 10, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "year_day_duration_test.flux", Source: "outData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,365\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,365\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,365\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n\"", Start: ast.Position{ Column: 1, Line: 22, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 22, }, File: "year_day_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 22, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "year_day_duration_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,365\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,365\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,365\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n\"", Start: ast.Position{ Column: 5, Line: 23, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,365\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,365\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,365\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,1\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 85, Line: 38, }, File: "year_day_duration_test.flux", Source: "t_duration_year_day = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.yearDay(t: duration(v: r._value))}))", Start: ast.Position{ Column: 1, Line: 35, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 35, }, File: "year_day_duration_test.flux", Source: "t_duration_year_day", Start: ast.Position{ Column: 1, Line: 35, }, }, }, Name: "t_duration_year_day", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 85, Line: 38, }, File: "year_day_duration_test.flux", Source: "(table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.yearDay(t: duration(v: r._value))}))", Start: ast.Position{ Column: 23, Line: 35, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 36, }, File: "year_day_duration_test.flux", Source: "table", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 37, }, File: "year_day_duration_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "year_day_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "year_day_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 37, }, File: "year_day_duration_test.flux", Source: "start", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "year_day_duration_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 25, Line: 37, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 37, }, File: "year_day_duration_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 12, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 37, }, File: "year_day_duration_test.flux", Source: "range", Start: ast.Position{ Column: 12, Line: 37, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 85, Line: 38, }, File: "year_day_duration_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.yearDay(t: duration(v: r._value))}))", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 38, }, File: "year_day_duration_test.flux", Source: "fn: (r) => ({r with _value: date.yearDay(t: duration(v: r._value))})", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 38, }, File: "year_day_duration_test.flux", Source: "fn: (r) => ({r with _value: date.yearDay(t: duration(v: r._value))})", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 38, }, File: "year_day_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 38, }, File: "year_day_duration_test.flux", Source: "(r) => ({r with _value: date.yearDay(t: duration(v: r._value))})", Start: ast.Position{ Column: 20, Line: 38, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 84, Line: 38, }, File: "year_day_duration_test.flux", Source: "({r with _value: date.yearDay(t: duration(v: r._value))})", Start: ast.Position{ Column: 27, Line: 38, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 38, }, File: "year_day_duration_test.flux", Source: "{r with _value: date.yearDay(t: duration(v: r._value))}", Start: ast.Position{ Column: 28, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 38, }, File: "year_day_duration_test.flux", Source: "_value: date.yearDay(t: duration(v: r._value))", Start: ast.Position{ Column: 36, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 38, }, File: "year_day_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 36, 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: 81, Line: 38, }, File: "year_day_duration_test.flux", Source: "t: duration(v: r._value)", Start: ast.Position{ Column: 57, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 38, }, File: "year_day_duration_test.flux", Source: "t: duration(v: r._value)", Start: ast.Position{ Column: 57, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 38, }, File: "year_day_duration_test.flux", Source: "t", Start: ast.Position{ Column: 57, Line: 38, }, }, }, Name: "t", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 38, }, File: "year_day_duration_test.flux", Source: "v: r._value", Start: ast.Position{ Column: 69, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 38, }, File: "year_day_duration_test.flux", Source: "v: r._value", Start: ast.Position{ Column: 69, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 38, }, File: "year_day_duration_test.flux", Source: "v", Start: ast.Position{ Column: 69, Line: 38, }, }, }, Name: "v", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 38, }, File: "year_day_duration_test.flux", Source: "r._value", Start: ast.Position{ Column: 72, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 38, }, File: "year_day_duration_test.flux", Source: "r", Start: ast.Position{ Column: 72, Line: 38, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 38, }, File: "year_day_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 74, Line: 38, }, }, }, Name: "_value", }, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 38, }, File: "year_day_duration_test.flux", Source: "duration(v: r._value)", Start: ast.Position{ Column: 60, Line: 38, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 38, }, File: "year_day_duration_test.flux", Source: "duration", Start: ast.Position{ Column: 60, Line: 38, }, }, }, Name: "duration", }, Lparen: nil, Rparen: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 38, }, File: "year_day_duration_test.flux", Source: "date.yearDay(t: duration(v: r._value))", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 56, Line: 38, }, File: "year_day_duration_test.flux", Source: "date.yearDay", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 38, }, File: "year_day_duration_test.flux", Source: "date", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 56, Line: 38, }, File: "year_day_duration_test.flux", Source: "yearDay", Start: ast.Position{ Column: 49, Line: 38, }, }, }, Name: "yearDay", }, 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: 30, Line: 38, }, File: "year_day_duration_test.flux", Source: "r", Start: ast.Position{ Column: 29, 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: 22, Line: 38, }, File: "year_day_duration_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 38, }, File: "year_day_duration_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 38, }, }, }, 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: 85, Line: 38, }, File: "year_day_duration_test.flux", Source: "map(fn: (r) => ({r with _value: date.yearDay(t: duration(v: r._value))}))", Start: ast.Position{ Column: 12, Line: 38, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 38, }, File: "year_day_duration_test.flux", Source: "map", Start: ast.Position{ Column: 12, Line: 38, }, }, }, 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: 32, Line: 35, }, File: "year_day_duration_test.flux", Source: "table=<-", Start: ast.Position{ Column: 24, Line: 35, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 29, Line: 35, }, File: "year_day_duration_test.flux", Source: "table", Start: ast.Position{ Column: 24, Line: 35, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 32, Line: 35, }, File: "year_day_duration_test.flux", Source: "<-", Start: ast.Position{ Column: 30, Line: 35, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 110, Line: 41, }, File: "year_day_duration_test.flux", Source: "_duration_year_day = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_year_day})", 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: "year_day_duration_test.flux", Source: "_duration_year_day", Start: ast.Position{ Column: 6, Line: 40, }, }, }, Name: "_duration_year_day", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 110, Line: 41, }, File: "year_day_duration_test.flux", Source: "() =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_year_day})", Start: ast.Position{ Column: 27, Line: 40, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 110, Line: 41, }, File: "year_day_duration_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_year_day})", Start: ast.Position{ Column: 5, Line: 41, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 109, Line: 41, }, File: "year_day_duration_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_year_day}", Start: ast.Position{ Column: 6, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 41, }, File: "year_day_duration_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 7, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 41, }, File: "year_day_duration_test.flux", Source: "input", Start: ast.Position{ Column: 7, 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: 45, Line: 41, }, File: "year_day_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 41, }, File: "year_day_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 41, }, File: "year_day_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 41, }, File: "year_day_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 39, Line: 41, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 41, }, File: "year_day_duration_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 41, }, File: "year_day_duration_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 41, }, File: "year_day_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 41, }, File: "year_day_duration_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 22, 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: 83, Line: 41, }, File: "year_day_duration_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 48, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 41, }, File: "year_day_duration_test.flux", Source: "want", Start: ast.Position{ Column: 48, 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: 82, Line: 41, }, File: "year_day_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 41, }, File: "year_day_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 41, }, File: "year_day_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 41, }, File: "year_day_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 75, Line: 41, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 41, }, File: "year_day_duration_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 41, }, File: "year_day_duration_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 41, }, File: "year_day_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 41, }, File: "year_day_duration_test.flux", Source: "loadMem", Start: ast.Position{ Column: 62, 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: 108, Line: 41, }, File: "year_day_duration_test.flux", Source: "fn: t_duration_year_day", Start: ast.Position{ Column: 85, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 41, }, File: "year_day_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 85, Line: 41, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 108, Line: 41, }, File: "year_day_duration_test.flux", Source: "t_duration_year_day", Start: ast.Position{ Column: 89, Line: 41, }, }, }, Name: "t_duration_year_day", }, }}, 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: 110, Line: 41, }, File: "year_day_duration_test.flux", Source: "test _duration_year_day = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_year_day})", 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: 4, }, File: "year_day_duration_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: "year_day_duration_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "year_day_duration_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "year_day_duration_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "year_day_duration_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "year_day_duration_test.flux", Source: "package date_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: 18, Line: 1, }, File: "year_day_duration_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 59, }, File: "year_day_time_test.flux", Source: "package date_test\n\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => 2030-01-01T00:00:00Z\n\ninData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:00Z,_m,FF,1\n,,0,2018-05-23T19:53:10Z,_m,FF,1\n,,0,2018-05-24T19:53:20Z,_m,FF,1\n,,0,2018-05-25T19:53:30Z,_m,FF,1\n,,0,2018-05-26T19:53:40Z,_m,FF,1\n,,0,2018-05-27T19:53:50Z,_m,FF,1\n,,1,2018-05-28T19:53:00Z,_m,QQ,1\n,,1,2018-05-29T19:53:10Z,_m,QQ,1\n,,1,2018-05-30T19:53:20Z,_m,QQ,1\n,,1,2018-05-31T19:53:30Z,_m,QQ,1\n,,1,2018-06-01T19:53:40Z,_m,QQ,1\n,,1,2018-06-02T19:53:50Z,_m,QQ,1\n,,1,2018-06-03T19:54:00Z,_m,QQ,1\n,,1,2018-12-31T19:54:00Z,_m,QQ,1\n,,1,2019-01-01T19:54:00Z,_m,QQ,1\n\"\noutData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:00Z,142\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-23T19:53:10Z,143\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-24T19:53:20Z,144\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-25T19:53:30Z,145\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-26T19:53:40Z,146\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-27T19:53:50Z,147\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-28T19:53:00Z,148\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-29T19:53:10Z,149\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-30T19:53:20Z,150\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-31T19:53:30Z,151\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-06-01T19:53:40Z,152\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-06-02T19:53:50Z,153\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-06-03T19:54:00Z,154\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-12-31T19:54:00Z,365\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2019-01-01T19:54:00Z,1\n\"\nt_time_year_day = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.yearDay(t: r._time)}))\n\ntest _time_year_day = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_year_day})", 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: 40, Line: 7, }, File: "year_day_time_test.flux", Source: "now = () => 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: "year_day_time_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: 40, Line: 7, }, File: "year_day_time_test.flux", Source: "() => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "year_day_time_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 20, Line: 7, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "year_day_time_test.flux", Source: "option now = () => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 30, }, File: "year_day_time_test.flux", Source: "inData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:00Z,_m,FF,1\n,,0,2018-05-23T19:53:10Z,_m,FF,1\n,,0,2018-05-24T19:53:20Z,_m,FF,1\n,,0,2018-05-25T19:53:30Z,_m,FF,1\n,,0,2018-05-26T19:53:40Z,_m,FF,1\n,,0,2018-05-27T19:53:50Z,_m,FF,1\n,,1,2018-05-28T19:53:00Z,_m,QQ,1\n,,1,2018-05-29T19:53:10Z,_m,QQ,1\n,,1,2018-05-30T19:53:20Z,_m,QQ,1\n,,1,2018-05-31T19:53:30Z,_m,QQ,1\n,,1,2018-06-01T19:53:40Z,_m,QQ,1\n,,1,2018-06-02T19:53:50Z,_m,QQ,1\n,,1,2018-06-03T19:54:00Z,_m,QQ,1\n,,1,2018-12-31T19:54:00Z,_m,QQ,1\n,,1,2019-01-01T19:54:00Z,_m,QQ,1\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: "year_day_time_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: 30, }, File: "year_day_time_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:00Z,_m,FF,1\n,,0,2018-05-23T19:53:10Z,_m,FF,1\n,,0,2018-05-24T19:53:20Z,_m,FF,1\n,,0,2018-05-25T19:53:30Z,_m,FF,1\n,,0,2018-05-26T19:53:40Z,_m,FF,1\n,,0,2018-05-27T19:53:50Z,_m,FF,1\n,,1,2018-05-28T19:53:00Z,_m,QQ,1\n,,1,2018-05-29T19:53:10Z,_m,QQ,1\n,,1,2018-05-30T19:53:20Z,_m,QQ,1\n,,1,2018-05-31T19:53:30Z,_m,QQ,1\n,,1,2018-06-01T19:53:40Z,_m,QQ,1\n,,1,2018-06-02T19:53:50Z,_m,QQ,1\n,,1,2018-06-03T19:54:00Z,_m,QQ,1\n,,1,2018-12-31T19:54:00Z,_m,QQ,1\n,,1,2019-01-01T19:54:00Z,_m,QQ,1\n\"", Start: ast.Position{ Column: 5, Line: 10, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:53:00Z,_m,FF,1\n,,0,2018-05-23T19:53:10Z,_m,FF,1\n,,0,2018-05-24T19:53:20Z,_m,FF,1\n,,0,2018-05-25T19:53:30Z,_m,FF,1\n,,0,2018-05-26T19:53:40Z,_m,FF,1\n,,0,2018-05-27T19:53:50Z,_m,FF,1\n,,1,2018-05-28T19:53:00Z,_m,QQ,1\n,,1,2018-05-29T19:53:10Z,_m,QQ,1\n,,1,2018-05-30T19:53:20Z,_m,QQ,1\n,,1,2018-05-31T19:53:30Z,_m,QQ,1\n,,1,2018-06-01T19:53:40Z,_m,QQ,1\n,,1,2018-06-02T19:53:50Z,_m,QQ,1\n,,1,2018-06-03T19:54:00Z,_m,QQ,1\n,,1,2018-12-31T19:54:00Z,_m,QQ,1\n,,1,2019-01-01T19:54:00Z,_m,QQ,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 52, }, File: "year_day_time_test.flux", Source: "outData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:00Z,142\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-23T19:53:10Z,143\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-24T19:53:20Z,144\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-25T19:53:30Z,145\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-26T19:53:40Z,146\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-27T19:53:50Z,147\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-28T19:53:00Z,148\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-29T19:53:10Z,149\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-30T19:53:20Z,150\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-31T19:53:30Z,151\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-06-01T19:53:40Z,152\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-06-02T19:53:50Z,153\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-06-03T19:54:00Z,154\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-12-31T19:54:00Z,365\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2019-01-01T19:54:00Z,1\n\"", Start: ast.Position{ Column: 1, Line: 31, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 31, }, File: "year_day_time_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 31, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 52, }, File: "year_day_time_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:00Z,142\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-23T19:53:10Z,143\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-24T19:53:20Z,144\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-25T19:53:30Z,145\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-26T19:53:40Z,146\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-27T19:53:50Z,147\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-28T19:53:00Z,148\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-29T19:53:10Z,149\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-30T19:53:20Z,150\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-31T19:53:30Z,151\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-06-01T19:53:40Z,152\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-06-02T19:53:50Z,153\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-06-03T19:54:00Z,154\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-12-31T19:54:00Z,365\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2019-01-01T19:54:00Z,1\n\"", Start: ast.Position{ Column: 5, Line: 32, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:53:00Z,142\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-23T19:53:10Z,143\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-24T19:53:20Z,144\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-25T19:53:30Z,145\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-26T19:53:40Z,146\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-27T19:53:50Z,147\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-28T19:53:00Z,148\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-29T19:53:10Z,149\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-30T19:53:20Z,150\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-05-31T19:53:30Z,151\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-06-01T19:53:40Z,152\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-06-02T19:53:50Z,153\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-06-03T19:54:00Z,154\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2018-12-31T19:54:00Z,365\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2019-01-01T19:54:00Z,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 56, }, File: "year_day_time_test.flux", Source: "t_time_year_day = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.yearDay(t: r._time)}))", Start: ast.Position{ Column: 1, Line: 53, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 53, }, File: "year_day_time_test.flux", Source: "t_time_year_day", Start: ast.Position{ Column: 1, Line: 53, }, }, }, Name: "t_time_year_day", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 56, }, File: "year_day_time_test.flux", Source: "(table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.yearDay(t: r._time)}))", Start: ast.Position{ Column: 19, Line: 53, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 54, }, File: "year_day_time_test.flux", Source: "table", Start: ast.Position{ Column: 5, Line: 54, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 55, }, File: "year_day_time_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 5, Line: 54, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 55, }, File: "year_day_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 55, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 55, }, File: "year_day_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 55, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 55, }, File: "year_day_time_test.flux", Source: "start", Start: ast.Position{ Column: 18, Line: 55, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 55, }, File: "year_day_time_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 25, Line: 55, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 55, }, File: "year_day_time_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 12, Line: 55, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 55, }, File: "year_day_time_test.flux", Source: "range", Start: ast.Position{ Column: 12, Line: 55, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 71, Line: 56, }, File: "year_day_time_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.yearDay(t: r._time)}))", Start: ast.Position{ Column: 5, Line: 54, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 56, }, File: "year_day_time_test.flux", Source: "fn: (r) => ({r with _value: date.yearDay(t: r._time)})", Start: ast.Position{ Column: 16, Line: 56, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 56, }, File: "year_day_time_test.flux", Source: "fn: (r) => ({r with _value: date.yearDay(t: r._time)})", Start: ast.Position{ Column: 16, Line: 56, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 56, }, File: "year_day_time_test.flux", Source: "fn", Start: ast.Position{ Column: 16, Line: 56, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 56, }, File: "year_day_time_test.flux", Source: "(r) => ({r with _value: date.yearDay(t: r._time)})", Start: ast.Position{ Column: 20, Line: 56, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 56, }, File: "year_day_time_test.flux", Source: "({r with _value: date.yearDay(t: r._time)})", Start: ast.Position{ Column: 27, Line: 56, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 56, }, File: "year_day_time_test.flux", Source: "{r with _value: date.yearDay(t: r._time)}", Start: ast.Position{ Column: 28, Line: 56, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 56, }, File: "year_day_time_test.flux", Source: "_value: date.yearDay(t: r._time)", Start: ast.Position{ Column: 36, Line: 56, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 56, }, File: "year_day_time_test.flux", Source: "_value", Start: ast.Position{ Column: 36, Line: 56, }, }, }, 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: 67, Line: 56, }, File: "year_day_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 57, Line: 56, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 56, }, File: "year_day_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 57, Line: 56, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 56, }, File: "year_day_time_test.flux", Source: "t", Start: ast.Position{ Column: 57, Line: 56, }, }, }, Name: "t", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 56, }, File: "year_day_time_test.flux", Source: "r._time", Start: ast.Position{ Column: 60, Line: 56, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 56, }, File: "year_day_time_test.flux", Source: "r", Start: ast.Position{ Column: 60, Line: 56, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 56, }, File: "year_day_time_test.flux", Source: "_time", Start: ast.Position{ Column: 62, Line: 56, }, }, }, Name: "_time", }, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 56, }, File: "year_day_time_test.flux", Source: "date.yearDay(t: r._time)", Start: ast.Position{ Column: 44, Line: 56, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 56, Line: 56, }, File: "year_day_time_test.flux", Source: "date.yearDay", Start: ast.Position{ Column: 44, Line: 56, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 56, }, File: "year_day_time_test.flux", Source: "date", Start: ast.Position{ Column: 44, Line: 56, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 56, Line: 56, }, File: "year_day_time_test.flux", Source: "yearDay", Start: ast.Position{ Column: 49, Line: 56, }, }, }, Name: "yearDay", }, 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: 30, Line: 56, }, File: "year_day_time_test.flux", Source: "r", Start: ast.Position{ Column: 29, Line: 56, }, }, }, 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: 22, Line: 56, }, File: "year_day_time_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 56, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 56, }, File: "year_day_time_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 56, }, }, }, 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: 71, Line: 56, }, File: "year_day_time_test.flux", Source: "map(fn: (r) => ({r with _value: date.yearDay(t: r._time)}))", Start: ast.Position{ Column: 12, Line: 56, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 56, }, File: "year_day_time_test.flux", Source: "map", Start: ast.Position{ Column: 12, Line: 56, }, }, }, 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: 28, Line: 53, }, File: "year_day_time_test.flux", Source: "table=<-", Start: ast.Position{ Column: 20, Line: 53, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 53, }, File: "year_day_time_test.flux", Source: "table", Start: ast.Position{ Column: 20, Line: 53, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 53, }, File: "year_day_time_test.flux", Source: "<-", Start: ast.Position{ Column: 26, Line: 53, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 59, }, File: "year_day_time_test.flux", Source: "_time_year_day = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_year_day})", Start: ast.Position{ Column: 6, Line: 58, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 58, }, File: "year_day_time_test.flux", Source: "_time_year_day", Start: ast.Position{ Column: 6, Line: 58, }, }, }, Name: "_time_year_day", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 59, }, File: "year_day_time_test.flux", Source: "() =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_year_day})", Start: ast.Position{ Column: 23, Line: 58, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 59, }, File: "year_day_time_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_year_day})", Start: ast.Position{ Column: 5, Line: 59, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 59, }, File: "year_day_time_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_year_day}", Start: ast.Position{ Column: 6, Line: 59, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 59, }, File: "year_day_time_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 7, Line: 59, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 59, }, File: "year_day_time_test.flux", Source: "input", Start: ast.Position{ Column: 7, Line: 59, }, }, }, 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: 59, }, File: "year_day_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 59, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 59, }, File: "year_day_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 59, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 59, }, File: "year_day_time_test.flux", Source: "csv", Start: ast.Position{ Column: 34, Line: 59, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 59, }, File: "year_day_time_test.flux", Source: "inData", Start: ast.Position{ Column: 39, Line: 59, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 59, }, File: "year_day_time_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 14, Line: 59, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 59, }, File: "year_day_time_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 14, Line: 59, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 59, }, File: "year_day_time_test.flux", Source: "testing", Start: ast.Position{ Column: 14, Line: 59, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 59, }, File: "year_day_time_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 22, Line: 59, }, }, }, 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: 59, }, File: "year_day_time_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 48, Line: 59, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 59, }, File: "year_day_time_test.flux", Source: "want", Start: ast.Position{ Column: 48, Line: 59, }, }, }, 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: 59, }, File: "year_day_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 59, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 59, }, File: "year_day_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 59, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 59, }, File: "year_day_time_test.flux", Source: "csv", Start: ast.Position{ Column: 70, Line: 59, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 59, }, File: "year_day_time_test.flux", Source: "outData", Start: ast.Position{ Column: 75, Line: 59, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 59, }, File: "year_day_time_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 54, Line: 59, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 59, }, File: "year_day_time_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 54, Line: 59, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 59, }, File: "year_day_time_test.flux", Source: "testing", Start: ast.Position{ Column: 54, Line: 59, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 59, }, File: "year_day_time_test.flux", Source: "loadMem", Start: ast.Position{ Column: 62, Line: 59, }, }, }, 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: 59, }, File: "year_day_time_test.flux", Source: "fn: t_time_year_day", Start: ast.Position{ Column: 85, Line: 59, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 59, }, File: "year_day_time_test.flux", Source: "fn", Start: ast.Position{ Column: 85, Line: 59, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 104, Line: 59, }, File: "year_day_time_test.flux", Source: "t_time_year_day", Start: ast.Position{ Column: 89, Line: 59, }, }, }, Name: "t_time_year_day", }, }}, 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: 59, }, File: "year_day_time_test.flux", Source: "test _time_year_day = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_year_day})", Start: ast.Position{ Column: 1, Line: 58, }, }, }, }}, 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: 4, }, File: "year_day_time_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: "year_day_time_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "year_day_time_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "year_day_time_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "year_day_time_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "year_day_time_test.flux", Source: "package date_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: 18, Line: 1, }, File: "year_day_time_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 41, }, File: "year_duration_test.flux", Source: "package date_test\n\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => 2030-01-01T00:00:00Z\n\ninData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"\noutData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,2029\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,2029\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,2029\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,2030\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,2030\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,2030\n\"\nt_duration_year = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.year(t: duration(v: r._value))}))\n\ntest _duration_year = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_year})", 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: 40, Line: 7, }, File: "year_duration_test.flux", Source: "now = () => 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: "year_duration_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: 40, Line: 7, }, File: "year_duration_test.flux", Source: "() => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "year_duration_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 20, Line: 7, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "year_duration_test.flux", Source: "option now = () => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 21, }, File: "year_duration_test.flux", Source: "inData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\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: "year_duration_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: 21, }, File: "year_duration_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n\"", Start: ast.Position{ Column: 5, Line: 10, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,long\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-05-22T19:01:00.254819212Z,_m,FF,-3\n,,0,2018-05-22T19:02:00.748691723Z,_m,FF,-2\n,,0,2018-05-22T19:03:00.947182316Z,_m,FF,-1\n,,0,2018-05-22T19:04:00.538816341Z,_m,FF,0\n,,0,2018-05-22T19:05:00.676423456Z,_m,FF,1\n,,0,2018-05-22T19:06:00.982342357Z,_m,FF,2\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "year_duration_test.flux", Source: "outData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,2029\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,2029\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,2029\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,2030\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,2030\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,2030\n\"", Start: ast.Position{ Column: 1, Line: 22, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 22, }, File: "year_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 22, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 34, }, File: "year_duration_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,2029\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,2029\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,2029\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,2030\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,2030\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,2030\n\"", Start: ast.Position{ Column: 5, Line: 23, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:01:00.254819212Z,2029\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:02:00.748691723Z,2029\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:03:00.947182316Z,2029\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:04:00.538816341Z,2030\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:05:00.676423456Z,2030\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-05-22T19:06:00.982342357Z,2030\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 38, }, File: "year_duration_test.flux", Source: "t_duration_year = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.year(t: duration(v: r._value))}))", Start: ast.Position{ Column: 1, Line: 35, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 35, }, File: "year_duration_test.flux", Source: "t_duration_year", Start: ast.Position{ Column: 1, Line: 35, }, }, }, Name: "t_duration_year", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 38, }, File: "year_duration_test.flux", Source: "(table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.year(t: duration(v: r._value))}))", Start: ast.Position{ Column: 19, Line: 35, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 36, }, File: "year_duration_test.flux", Source: "table", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 37, }, File: "year_duration_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "year_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "year_duration_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 37, }, File: "year_duration_test.flux", Source: "start", Start: ast.Position{ Column: 18, Line: 37, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 37, }, File: "year_duration_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 25, Line: 37, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 37, }, File: "year_duration_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 12, Line: 37, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 37, }, File: "year_duration_test.flux", Source: "range", Start: ast.Position{ Column: 12, Line: 37, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 38, }, File: "year_duration_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.year(t: duration(v: r._value))}))", Start: ast.Position{ Column: 5, Line: 36, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 38, }, File: "year_duration_test.flux", Source: "fn: (r) => ({r with _value: date.year(t: duration(v: r._value))})", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 38, }, File: "year_duration_test.flux", Source: "fn: (r) => ({r with _value: date.year(t: duration(v: r._value))})", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 38, }, File: "year_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 16, Line: 38, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 38, }, File: "year_duration_test.flux", Source: "(r) => ({r with _value: date.year(t: duration(v: r._value))})", Start: ast.Position{ Column: 20, Line: 38, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 81, Line: 38, }, File: "year_duration_test.flux", Source: "({r with _value: date.year(t: duration(v: r._value))})", Start: ast.Position{ Column: 27, Line: 38, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 80, Line: 38, }, File: "year_duration_test.flux", Source: "{r with _value: date.year(t: duration(v: r._value))}", Start: ast.Position{ Column: 28, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 38, }, File: "year_duration_test.flux", Source: "_value: date.year(t: duration(v: r._value))", Start: ast.Position{ Column: 36, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 38, }, File: "year_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 36, 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: 78, Line: 38, }, File: "year_duration_test.flux", Source: "t: duration(v: r._value)", Start: ast.Position{ Column: 54, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 38, }, File: "year_duration_test.flux", Source: "t: duration(v: r._value)", Start: ast.Position{ Column: 54, 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: "year_duration_test.flux", Source: "t", Start: ast.Position{ Column: 54, Line: 38, }, }, }, Name: "t", }, Separator: nil, Value: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 38, }, File: "year_duration_test.flux", Source: "v: r._value", Start: ast.Position{ Column: 66, Line: 38, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 38, }, File: "year_duration_test.flux", Source: "v: r._value", Start: ast.Position{ Column: 66, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 38, }, File: "year_duration_test.flux", Source: "v", Start: ast.Position{ Column: 66, Line: 38, }, }, }, Name: "v", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 38, }, File: "year_duration_test.flux", Source: "r._value", Start: ast.Position{ Column: 69, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 70, Line: 38, }, File: "year_duration_test.flux", Source: "r", Start: ast.Position{ Column: 69, Line: 38, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 77, Line: 38, }, File: "year_duration_test.flux", Source: "_value", Start: ast.Position{ Column: 71, Line: 38, }, }, }, Name: "_value", }, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 78, Line: 38, }, File: "year_duration_test.flux", Source: "duration(v: r._value)", Start: ast.Position{ Column: 57, Line: 38, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 38, }, File: "year_duration_test.flux", Source: "duration", Start: ast.Position{ Column: 57, Line: 38, }, }, }, Name: "duration", }, Lparen: nil, Rparen: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 79, Line: 38, }, File: "year_duration_test.flux", Source: "date.year(t: duration(v: r._value))", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 38, }, File: "year_duration_test.flux", Source: "date.year", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 38, }, File: "year_duration_test.flux", Source: "date", Start: ast.Position{ Column: 44, Line: 38, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 38, }, File: "year_duration_test.flux", Source: "year", Start: ast.Position{ Column: 49, Line: 38, }, }, }, Name: "year", }, 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: 30, Line: 38, }, File: "year_duration_test.flux", Source: "r", Start: ast.Position{ Column: 29, 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: 22, Line: 38, }, File: "year_duration_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 38, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 38, }, File: "year_duration_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 38, }, }, }, 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: 82, Line: 38, }, File: "year_duration_test.flux", Source: "map(fn: (r) => ({r with _value: date.year(t: duration(v: r._value))}))", Start: ast.Position{ Column: 12, Line: 38, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 38, }, File: "year_duration_test.flux", Source: "map", Start: ast.Position{ Column: 12, Line: 38, }, }, }, 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: 28, Line: 35, }, File: "year_duration_test.flux", Source: "table=<-", Start: ast.Position{ Column: 20, Line: 35, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 25, Line: 35, }, File: "year_duration_test.flux", Source: "table", Start: ast.Position{ Column: 20, Line: 35, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 28, Line: 35, }, File: "year_duration_test.flux", Source: "<-", Start: ast.Position{ Column: 26, Line: 35, }, }, }}, }}, 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: "year_duration_test.flux", Source: "_duration_year = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_year})", Start: ast.Position{ Column: 6, Line: 40, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 20, Line: 40, }, File: "year_duration_test.flux", Source: "_duration_year", Start: ast.Position{ Column: 6, Line: 40, }, }, }, Name: "_duration_year", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 41, }, File: "year_duration_test.flux", Source: "() =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_year})", Start: ast.Position{ Column: 23, Line: 40, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 106, Line: 41, }, File: "year_duration_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_year})", Start: ast.Position{ Column: 5, Line: 41, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 105, Line: 41, }, File: "year_duration_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_year}", Start: ast.Position{ Column: 6, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 41, }, File: "year_duration_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 7, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 41, }, File: "year_duration_test.flux", Source: "input", Start: ast.Position{ Column: 7, 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: 45, Line: 41, }, File: "year_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 41, }, File: "year_duration_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 41, }, File: "year_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 34, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 41, }, File: "year_duration_test.flux", Source: "inData", Start: ast.Position{ Column: 39, Line: 41, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 41, }, File: "year_duration_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 41, }, File: "year_duration_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 41, }, File: "year_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 14, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 41, }, File: "year_duration_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 22, 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: 83, Line: 41, }, File: "year_duration_test.flux", Source: "want: testing.loadMem(csv: outData)", Start: ast.Position{ Column: 48, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 52, Line: 41, }, File: "year_duration_test.flux", Source: "want", Start: ast.Position{ Column: 48, 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: 82, Line: 41, }, File: "year_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 41, }, File: "year_duration_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 41, }, File: "year_duration_test.flux", Source: "csv", Start: ast.Position{ Column: 70, Line: 41, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 41, }, File: "year_duration_test.flux", Source: "outData", Start: ast.Position{ Column: 75, Line: 41, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 41, }, File: "year_duration_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 41, }, File: "year_duration_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 41, }, File: "year_duration_test.flux", Source: "testing", Start: ast.Position{ Column: 54, Line: 41, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 41, }, File: "year_duration_test.flux", Source: "loadMem", Start: ast.Position{ Column: 62, 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: "year_duration_test.flux", Source: "fn: t_duration_year", Start: ast.Position{ Column: 85, Line: 41, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 41, }, File: "year_duration_test.flux", Source: "fn", Start: ast.Position{ Column: 85, 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: "year_duration_test.flux", Source: "t_duration_year", Start: ast.Position{ Column: 89, Line: 41, }, }, }, Name: "t_duration_year", }, }}, 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: "year_duration_test.flux", Source: "test _duration_year = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_duration_year})", 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: 4, }, File: "year_duration_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: "year_duration_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "year_duration_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "year_duration_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "year_duration_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "year_duration_test.flux", Source: "package date_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: 18, Line: 1, }, File: "year_duration_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }, &ast.File{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 53, }, File: "year_time_test.flux", Source: "package date_test\n\n\nimport \"testing\"\nimport \"date\"\n\noption now = () => 2030-01-01T00:00:00Z\n\ninData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-01-22T19:53:00Z,_m,FF,1\n,,0,2019-02-22T19:53:10Z,_m,FF,1\n,,0,2020-03-22T19:53:20Z,_m,FF,1\n,,0,2021-04-22T19:53:30Z,_m,FF,1\n,,0,2022-05-22T19:53:40Z,_m,FF,1\n,,0,2023-06-22T19:53:50Z,_m,FF,1\n,,1,2024-07-22T19:53:00Z,_m,QQ,1\n,,1,2025-08-22T19:53:10Z,_m,QQ,1\n,,1,2026-09-22T19:53:20Z,_m,QQ,1\n,,1,2027-10-22T19:53:30Z,_m,QQ,1\n,,1,2028-11-22T19:53:40Z,_m,QQ,1\n,,1,2029-12-22T19:53:50Z,_m,QQ,1\n\"\noutData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-01-22T19:53:00Z,2018\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2019-02-22T19:53:10Z,2019\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2020-03-22T19:53:20Z,2020\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2021-04-22T19:53:30Z,2021\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2022-05-22T19:53:40Z,2022\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2023-06-22T19:53:50Z,2023\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2024-07-22T19:53:00Z,2024\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2025-08-22T19:53:10Z,2025\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2026-09-22T19:53:20Z,2026\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2027-10-22T19:53:30Z,2027\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2028-11-22T19:53:40Z,2028\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2029-12-22T19:53:50Z,2029\n\"\nt_time_year = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.year(t: r._time)}))\n\ntest _time_year = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_year})", 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: 40, Line: 7, }, File: "year_time_test.flux", Source: "now = () => 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: "year_time_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: 40, Line: 7, }, File: "year_time_test.flux", Source: "() => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 14, Line: 7, }, }, }, Body: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "year_time_test.flux", Source: "2030-01-01T00:00:00Z", Start: ast.Position{ Column: 20, Line: 7, }, }, }, Value: parser.MustParseTime("2030-01-01T00:00:00Z"), }, Lparen: nil, Params: []*ast.Property{}, Rparan: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 40, Line: 7, }, File: "year_time_test.flux", Source: "option now = () => 2030-01-01T00:00:00Z", Start: ast.Position{ Column: 1, Line: 7, }, }, }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 27, }, File: "year_time_test.flux", Source: "inData =\n \"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-01-22T19:53:00Z,_m,FF,1\n,,0,2019-02-22T19:53:10Z,_m,FF,1\n,,0,2020-03-22T19:53:20Z,_m,FF,1\n,,0,2021-04-22T19:53:30Z,_m,FF,1\n,,0,2022-05-22T19:53:40Z,_m,FF,1\n,,0,2023-06-22T19:53:50Z,_m,FF,1\n,,1,2024-07-22T19:53:00Z,_m,QQ,1\n,,1,2025-08-22T19:53:10Z,_m,QQ,1\n,,1,2026-09-22T19:53:20Z,_m,QQ,1\n,,1,2027-10-22T19:53:30Z,_m,QQ,1\n,,1,2028-11-22T19:53:40Z,_m,QQ,1\n,,1,2029-12-22T19:53:50Z,_m,QQ,1\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: "year_time_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: 27, }, File: "year_time_test.flux", Source: "\"\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-01-22T19:53:00Z,_m,FF,1\n,,0,2019-02-22T19:53:10Z,_m,FF,1\n,,0,2020-03-22T19:53:20Z,_m,FF,1\n,,0,2021-04-22T19:53:30Z,_m,FF,1\n,,0,2022-05-22T19:53:40Z,_m,FF,1\n,,0,2023-06-22T19:53:50Z,_m,FF,1\n,,1,2024-07-22T19:53:00Z,_m,QQ,1\n,,1,2025-08-22T19:53:10Z,_m,QQ,1\n,,1,2026-09-22T19:53:20Z,_m,QQ,1\n,,1,2027-10-22T19:53:30Z,_m,QQ,1\n,,1,2028-11-22T19:53:40Z,_m,QQ,1\n,,1,2029-12-22T19:53:50Z,_m,QQ,1\n\"", Start: ast.Position{ Column: 5, Line: 10, }, }, }, Value: "\n#datatype,string,long,dateTime:RFC3339,string,string,double\n#group,false,false,false,true,true,false\n#default,_result,,,,,\n,result,table,_time,_measurement,_field,_value\n,,0,2018-01-22T19:53:00Z,_m,FF,1\n,,0,2019-02-22T19:53:10Z,_m,FF,1\n,,0,2020-03-22T19:53:20Z,_m,FF,1\n,,0,2021-04-22T19:53:30Z,_m,FF,1\n,,0,2022-05-22T19:53:40Z,_m,FF,1\n,,0,2023-06-22T19:53:50Z,_m,FF,1\n,,1,2024-07-22T19:53:00Z,_m,QQ,1\n,,1,2025-08-22T19:53:10Z,_m,QQ,1\n,,1,2026-09-22T19:53:20Z,_m,QQ,1\n,,1,2027-10-22T19:53:30Z,_m,QQ,1\n,,1,2028-11-22T19:53:40Z,_m,QQ,1\n,,1,2029-12-22T19:53:50Z,_m,QQ,1\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 46, }, File: "year_time_test.flux", Source: "outData =\n \"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-01-22T19:53:00Z,2018\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2019-02-22T19:53:10Z,2019\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2020-03-22T19:53:20Z,2020\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2021-04-22T19:53:30Z,2021\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2022-05-22T19:53:40Z,2022\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2023-06-22T19:53:50Z,2023\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2024-07-22T19:53:00Z,2024\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2025-08-22T19:53:10Z,2025\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2026-09-22T19:53:20Z,2026\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2027-10-22T19:53:30Z,2027\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2028-11-22T19:53:40Z,2028\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2029-12-22T19:53:50Z,2029\n\"", Start: ast.Position{ Column: 1, Line: 28, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 8, Line: 28, }, File: "year_time_test.flux", Source: "outData", Start: ast.Position{ Column: 1, Line: 28, }, }, }, Name: "outData", }, Init: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 2, Line: 46, }, File: "year_time_test.flux", Source: "\"\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-01-22T19:53:00Z,2018\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2019-02-22T19:53:10Z,2019\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2020-03-22T19:53:20Z,2020\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2021-04-22T19:53:30Z,2021\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2022-05-22T19:53:40Z,2022\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2023-06-22T19:53:50Z,2023\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2024-07-22T19:53:00Z,2024\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2025-08-22T19:53:10Z,2025\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2026-09-22T19:53:20Z,2026\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2027-10-22T19:53:30Z,2027\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2028-11-22T19:53:40Z,2028\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2029-12-22T19:53:50Z,2029\n\"", Start: ast.Position{ Column: 5, Line: 29, }, }, }, Value: "\n#group,false,false,true,true,true,true,false,false\n#datatype,string,long,dateTime:RFC3339,dateTime:RFC3339,string,string,dateTime:RFC3339,long\n#default,_result,,,,,,,\n,result,table,_start,_stop,_field,_measurement,_time,_value\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2018-01-22T19:53:00Z,2018\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2019-02-22T19:53:10Z,2019\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2020-03-22T19:53:20Z,2020\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2021-04-22T19:53:30Z,2021\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2022-05-22T19:53:40Z,2022\n,,0,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,FF,_m,2023-06-22T19:53:50Z,2023\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2024-07-22T19:53:00Z,2024\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2025-08-22T19:53:10Z,2025\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2026-09-22T19:53:20Z,2026\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2027-10-22T19:53:30Z,2027\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2028-11-22T19:53:40Z,2028\n,,1,2018-01-01T00:00:00Z,2030-01-01T00:00:00Z,QQ,_m,2029-12-22T19:53:50Z,2029\n", }, }, &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 50, }, File: "year_time_test.flux", Source: "t_time_year = (table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.year(t: r._time)}))", Start: ast.Position{ Column: 1, Line: 47, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 47, }, File: "year_time_test.flux", Source: "t_time_year", Start: ast.Position{ Column: 1, Line: 47, }, }, }, Name: "t_time_year", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 50, }, File: "year_time_test.flux", Source: "(table=<-) =>\n table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.year(t: r._time)}))", Start: ast.Position{ Column: 15, Line: 47, }, }, }, Body: &ast.PipeExpression{ Argument: &ast.PipeExpression{ Argument: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 10, Line: 48, }, File: "year_time_test.flux", Source: "table", Start: ast.Position{ Column: 5, Line: 48, }, }, }, Name: "table", }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 49, }, File: "year_time_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 5, Line: 48, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 49, }, File: "year_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, 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: "year_time_test.flux", Source: "start: 2018-01-01T00:00:00Z", Start: ast.Position{ Column: 18, Line: 49, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 23, Line: 49, }, File: "year_time_test.flux", Source: "start", Start: ast.Position{ Column: 18, Line: 49, }, }, }, Name: "start", }, Separator: nil, Value: &ast.DateTimeLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 49, }, File: "year_time_test.flux", Source: "2018-01-01T00:00:00Z", Start: ast.Position{ Column: 25, Line: 49, }, }, }, Value: parser.MustParseTime("2018-01-01T00:00:00Z"), }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 49, }, File: "year_time_test.flux", Source: "range(start: 2018-01-01T00:00:00Z)", Start: ast.Position{ Column: 12, Line: 49, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 17, Line: 49, }, File: "year_time_test.flux", Source: "range", Start: ast.Position{ Column: 12, Line: 49, }, }, }, Name: "range", }, Lparen: nil, Rparen: nil, }, }, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 68, Line: 50, }, File: "year_time_test.flux", Source: "table\n |> range(start: 2018-01-01T00:00:00Z)\n |> map(fn: (r) => ({r with _value: date.year(t: r._time)}))", Start: ast.Position{ Column: 5, Line: 48, }, }, }, Call: &ast.CallExpression{ Arguments: []ast.Expression{&ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 50, }, File: "year_time_test.flux", Source: "fn: (r) => ({r with _value: date.year(t: r._time)})", Start: ast.Position{ Column: 16, Line: 50, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 50, }, File: "year_time_test.flux", Source: "fn: (r) => ({r with _value: date.year(t: r._time)})", Start: ast.Position{ Column: 16, Line: 50, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 50, }, File: "year_time_test.flux", Source: "fn", Start: ast.Position{ Column: 16, Line: 50, }, }, }, 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: 50, }, File: "year_time_test.flux", Source: "(r) => ({r with _value: date.year(t: r._time)})", Start: ast.Position{ Column: 20, Line: 50, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 67, Line: 50, }, File: "year_time_test.flux", Source: "({r with _value: date.year(t: r._time)})", Start: ast.Position{ Column: 27, Line: 50, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 66, Line: 50, }, File: "year_time_test.flux", Source: "{r with _value: date.year(t: r._time)}", Start: ast.Position{ Column: 28, Line: 50, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 50, }, File: "year_time_test.flux", Source: "_value: date.year(t: r._time)", Start: ast.Position{ Column: 36, Line: 50, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 42, Line: 50, }, File: "year_time_test.flux", Source: "_value", Start: ast.Position{ Column: 36, Line: 50, }, }, }, 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: 50, }, File: "year_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 54, Line: 50, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 50, }, File: "year_time_test.flux", Source: "t: r._time", Start: ast.Position{ Column: 54, Line: 50, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 55, Line: 50, }, File: "year_time_test.flux", Source: "t", Start: ast.Position{ Column: 54, Line: 50, }, }, }, Name: "t", }, Separator: nil, Value: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 50, }, File: "year_time_test.flux", Source: "r._time", Start: ast.Position{ Column: 57, Line: 50, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 58, Line: 50, }, File: "year_time_test.flux", Source: "r", Start: ast.Position{ Column: 57, Line: 50, }, }, }, Name: "r", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 64, Line: 50, }, File: "year_time_test.flux", Source: "_time", Start: ast.Position{ Column: 59, Line: 50, }, }, }, Name: "_time", }, Rbrack: nil, }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 65, Line: 50, }, File: "year_time_test.flux", Source: "date.year(t: r._time)", Start: ast.Position{ Column: 44, Line: 50, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 50, }, File: "year_time_test.flux", Source: "date.year", Start: ast.Position{ Column: 44, Line: 50, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 48, Line: 50, }, File: "year_time_test.flux", Source: "date", Start: ast.Position{ Column: 44, Line: 50, }, }, }, Name: "date", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 53, Line: 50, }, File: "year_time_test.flux", Source: "year", Start: ast.Position{ Column: 49, Line: 50, }, }, }, Name: "year", }, 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: 30, Line: 50, }, File: "year_time_test.flux", Source: "r", Start: ast.Position{ Column: 29, Line: 50, }, }, }, 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: 22, Line: 50, }, File: "year_time_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 50, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 22, Line: 50, }, File: "year_time_test.flux", Source: "r", Start: ast.Position{ Column: 21, Line: 50, }, }, }, 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: 50, }, File: "year_time_test.flux", Source: "map(fn: (r) => ({r with _value: date.year(t: r._time)}))", Start: ast.Position{ Column: 12, Line: 50, }, }, }, Callee: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 15, Line: 50, }, File: "year_time_test.flux", Source: "map", Start: ast.Position{ Column: 12, Line: 50, }, }, }, 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: 24, Line: 47, }, File: "year_time_test.flux", Source: "table=<-", Start: ast.Position{ Column: 16, Line: 47, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 47, }, File: "year_time_test.flux", Source: "table", Start: ast.Position{ Column: 16, Line: 47, }, }, }, Name: "table", }, Separator: nil, Value: &ast.PipeLiteral{BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 24, Line: 47, }, File: "year_time_test.flux", Source: "<-", Start: ast.Position{ Column: 22, Line: 47, }, }, }}, }}, Rparan: nil, }, }, &ast.TestStatement{ Assignment: &ast.VariableAssignment{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 53, }, File: "year_time_test.flux", Source: "_time_year = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_year})", Start: ast.Position{ Column: 6, Line: 52, }, }, }, ID: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 16, Line: 52, }, File: "year_time_test.flux", Source: "_time_year", Start: ast.Position{ Column: 6, Line: 52, }, }, }, Name: "_time_year", }, Init: &ast.FunctionExpression{ Arrow: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 53, }, File: "year_time_test.flux", Source: "() =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_year})", Start: ast.Position{ Column: 19, Line: 52, }, }, }, Body: &ast.ParenExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 102, Line: 53, }, File: "year_time_test.flux", Source: "({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_year})", Start: ast.Position{ Column: 5, Line: 53, }, }, }, Expression: &ast.ObjectExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 101, Line: 53, }, File: "year_time_test.flux", Source: "{input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_year}", Start: ast.Position{ Column: 6, 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: "year_time_test.flux", Source: "input: testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 7, Line: 53, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 12, Line: 53, }, File: "year_time_test.flux", Source: "input", Start: ast.Position{ Column: 7, Line: 53, }, }, }, 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: 53, }, File: "year_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, 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: "year_time_test.flux", Source: "csv: inData", Start: ast.Position{ Column: 34, Line: 53, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 37, Line: 53, }, File: "year_time_test.flux", Source: "csv", Start: ast.Position{ Column: 34, Line: 53, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 45, Line: 53, }, File: "year_time_test.flux", Source: "inData", Start: ast.Position{ Column: 39, Line: 53, }, }, }, Name: "inData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 46, Line: 53, }, File: "year_time_test.flux", Source: "testing.loadStorage(csv: inData)", Start: ast.Position{ Column: 14, Line: 53, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 53, }, File: "year_time_test.flux", Source: "testing.loadStorage", Start: ast.Position{ Column: 14, Line: 53, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 21, Line: 53, }, File: "year_time_test.flux", Source: "testing", Start: ast.Position{ Column: 14, Line: 53, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 33, Line: 53, }, File: "year_time_test.flux", Source: "loadStorage", Start: ast.Position{ Column: 22, Line: 53, }, }, }, 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: 53, }, File: "year_time_test.flux", Source: "want: testing.loadMem(csv: outData)", 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: 52, Line: 53, }, File: "year_time_test.flux", Source: "want", Start: ast.Position{ Column: 48, Line: 53, }, }, }, 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: 53, }, File: "year_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 53, }, }, }, Lbrace: nil, Properties: []*ast.Property{&ast.Property{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 53, }, File: "year_time_test.flux", Source: "csv: outData", Start: ast.Position{ Column: 70, Line: 53, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 73, Line: 53, }, File: "year_time_test.flux", Source: "csv", Start: ast.Position{ Column: 70, Line: 53, }, }, }, Name: "csv", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 82, Line: 53, }, File: "year_time_test.flux", Source: "outData", Start: ast.Position{ Column: 75, Line: 53, }, }, }, Name: "outData", }, }}, Rbrace: nil, With: nil, }}, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 83, Line: 53, }, File: "year_time_test.flux", Source: "testing.loadMem(csv: outData)", Start: ast.Position{ Column: 54, Line: 53, }, }, }, Callee: &ast.MemberExpression{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 53, }, File: "year_time_test.flux", Source: "testing.loadMem", Start: ast.Position{ Column: 54, Line: 53, }, }, }, Lbrack: nil, Object: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 61, Line: 53, }, File: "year_time_test.flux", Source: "testing", Start: ast.Position{ Column: 54, Line: 53, }, }, }, Name: "testing", }, Property: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 69, Line: 53, }, File: "year_time_test.flux", Source: "loadMem", Start: ast.Position{ Column: 62, Line: 53, }, }, }, 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: 53, }, File: "year_time_test.flux", Source: "fn: t_time_year", Start: ast.Position{ Column: 85, Line: 53, }, }, }, Comma: nil, Key: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 87, Line: 53, }, File: "year_time_test.flux", Source: "fn", Start: ast.Position{ Column: 85, Line: 53, }, }, }, Name: "fn", }, Separator: nil, Value: &ast.Identifier{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 100, Line: 53, }, File: "year_time_test.flux", Source: "t_time_year", Start: ast.Position{ Column: 89, Line: 53, }, }, }, Name: "t_time_year", }, }}, 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: 53, }, File: "year_time_test.flux", Source: "test _time_year = () =>\n ({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_time_year})", Start: ast.Position{ Column: 1, Line: 52, }, }, }, }}, 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: 4, }, File: "year_time_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: "year_time_test.flux", Source: "\"testing\"", Start: ast.Position{ Column: 8, Line: 4, }, }, }, Value: "testing", }, }, &ast.ImportDeclaration{ As: nil, BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "year_time_test.flux", Source: "import \"date\"", Start: ast.Position{ Column: 1, Line: 5, }, }, }, Path: &ast.StringLiteral{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 14, Line: 5, }, File: "year_time_test.flux", Source: "\"date\"", Start: ast.Position{ Column: 8, Line: 5, }, }, }, Value: "date", }, }}, Metadata: "parser-type=rust", Name: "year_time_test.flux", Package: &ast.PackageClause{ BaseNode: ast.BaseNode{ Comments: nil, Errors: nil, Loc: &ast.SourceLocation{ End: ast.Position{ Column: 18, Line: 1, }, File: "year_time_test.flux", Source: "package date_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: 18, Line: 1, }, File: "year_time_test.flux", Source: "date_test", Start: ast.Position{ Column: 9, Line: 1, }, }, }, Name: "date_test", }, }, }}, Package: "date_test", Path: "date", }}
View Source
var SpecialFns map[string]values.Function
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.