Skip to content

Commit

Permalink
Initialise ServingModelArtifacts in run completion events
Browse files Browse the repository at this point in the history
Until go JSON marshalling supports golang/go#27589, initialising a slice
is the only way to marshal empty arrays into JSON instead of null values.
  • Loading branch information
jmendesky committed Sep 4, 2023
1 parent 5ab40ea commit 5d67eb9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion argo/providers/vai/eventing_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func (es *VaiEventingServer) runCompletionEventForRun(ctx context.Context, run V
}

func modelServingArtifactsForJob(job *aiplatformpb.PipelineJob) []common.Artifact {
var servingModelArtifacts []common.Artifact
servingModelArtifacts := []common.Artifact{}
for _, task := range job.GetJobDetail().GetTaskDetails() {
for name, output := range task.GetOutputs() {
for _, artifact := range output.GetArtifacts() {
Expand Down
12 changes: 6 additions & 6 deletions argo/providers/vai/vai_eventing_server_unit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ var _ = Context("VaiEventingServer", func() {
},
},
},
})).To(BeEmpty())
})).To(Equal([]common.Artifact{}))
})
})

Expand All @@ -346,7 +346,7 @@ var _ = Context("VaiEventingServer", func() {
},
},
},
})).To(BeEmpty())
})).To(Equal([]common.Artifact{}))
})
})

Expand All @@ -369,7 +369,7 @@ var _ = Context("VaiEventingServer", func() {
},
},
},
})).To(BeEmpty())
})).To(Equal([]common.Artifact{}))
})
})

Expand All @@ -392,7 +392,7 @@ var _ = Context("VaiEventingServer", func() {
},
},
},
})).To(BeEmpty())
})).To(Equal([]common.Artifact{}))
})
})

Expand All @@ -415,7 +415,7 @@ var _ = Context("VaiEventingServer", func() {
},
},
},
})).To(BeEmpty())
})).To(Equal([]common.Artifact{}))
})
})

Expand All @@ -438,7 +438,7 @@ var _ = Context("VaiEventingServer", func() {
},
},
},
})).To(BeEmpty())
})).To(Equal([]common.Artifact{}))
})
})

Expand Down

0 comments on commit 5d67eb9

Please sign in to comment.