Skip to content

Commit

Permalink
Remove leading ,
Browse files Browse the repository at this point in the history
  • Loading branch information
jeschkies committed Nov 13, 2023
1 parent 1ee5ea1 commit de5c4b2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 0 additions & 1 deletion pkg/logql/syntax/serialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ func (v *JSONSerializer) VisitVector(e *VectorExpr) {
v.WriteObjectField("vector")
v.WriteObjectStart()

v.WriteMore()
v.WriteObjectField("val")
v.WriteFloat64(e.Val)

Expand Down
8 changes: 7 additions & 1 deletion pkg/logql/syntax/serialize_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ func TestJSONSerializationRoundTrip(t *testing.T) {
"vector matching": {
query: `(sum by (cluster)(rate({foo="bar"}[5m])) / ignoring (cluster) count(rate({foo="bar"}[5m])))`,
},
"sum over or vector": {
query: `(sum(count_over_time({foo="bar"}[5m])) or vector(1.000000))`,
},
"label replace": {
query: `label_replace(vector(0), "foo", "bar", "", "")`,
},
}

for name, test := range tests {
Expand All @@ -55,7 +61,7 @@ func TestJSONSerializationRoundTrip(t *testing.T) {
}
func TestJSONSerializationParseTestCases(t *testing.T) {
for _, tc := range ParseTestCases {
if tc.err != nil {
if tc.err == nil {
t.Run(tc.in, func(t *testing.T) {
ast, err := ParseExpr(tc.in)
require.NoError(t, err)
Expand Down

0 comments on commit de5c4b2

Please sign in to comment.