Hi! I’m trying to pull metadata from a run associated with an artifact into a report table, and am not succeeding.
Here’s my use case: I have an artifact “artifact” generated by some runs (“train-run”), and then I use that artifact in a (separate) evaluation run (“evaluate-run”).
I then want to display in a table the scores for my evaluation run, together with the training data that was used in the “train-run”.
I want something like this:
run | artifact | train set |
---|---|---|
evaluation-run-1 | artifact:v0 | “/data/train.csv” |
evaluation-run-2 | artifact:v0 | “/data/train.csv” |
evaluation-run-3 | artifact:v1 | “/data/train_filtered.csv” |
with the caveat that I don’t have the train set logged in the evaluation runs, but only in the training runs (that generated the artifact).
Here’s what I’m trying:
I have managed to get the artifact
column as above using Weave with this query for the column
row.run.usedArtifactVersions.filter((row) => row.name.contains("artifact")).link
But I can’t get to the config of the run that generated that artifact.
The closest I’ve gotten to this output is to access the metadata of the artifact version in Weave, but this doesn’t really work. The UI (in artifacts->metadata) shows the metadata of the run that generated it, which would work for me, but it doesn’t seem to be available to Weave.
This is what I have tried to access the metadata, and isn’t working:
row.project.artifactVersion("artifact", "v0").metadata["train_set"]
Another thing I’ve tried and isn’t working is this:
row.run.usedArtifactVersions.filter((row) => row.name.contains("artifact")).map((row, index) => row.run.config)["train_set"].joinToStr("")
(unfortunately the row.run
in the map function refers to the original run, instead of the run associated with generating the artifact)