|
36 | 36 |
|
37 | 37 | @testset "with run id as string" begin
|
38 | 38 | run = createrun(mlf, experiment_id)
|
39 |
| - logbatch(mlf, run.info.run_id, metrics=[("gala", 0.1)]) |
| 39 | + logbatch(mlf, run.info.run_id; metrics=[("gala", 0.1)]) |
40 | 40 |
|
41 | 41 | run = refresh(mlf, run)
|
42 | 42 | last_metric = run.data.metrics |> last
|
|
49 | 49 |
|
50 | 50 | @testset "with run" begin
|
51 | 51 | run = createrun(mlf, experiment_id)
|
52 |
| - logbatch(mlf, run, metrics=[("missy", 0.9)]) |
| 52 | + logbatch(mlf, run; metrics=[("missy", 0.9)]) |
53 | 53 |
|
54 | 54 | run = refresh(mlf, run)
|
55 | 55 | last_metric = run.data.metrics |> last
|
|
62 | 62 |
|
63 | 63 | @testset "with metrics, params and tags as dict" begin
|
64 | 64 | run = createrun(mlf, experiment_id)
|
65 |
| - logbatch(mlf, run, metrics=Dict("ana" => 0.5), |
| 65 | + logbatch(mlf, run; metrics=Dict("ana" => 0.5), |
66 | 66 | params=Dict("test_param" => "0.9"),
|
67 | 67 | tags=Dict("test_tag" => "gala"))
|
68 | 68 |
|
|
88 | 88 |
|
89 | 89 | @testset "with metrics, params and tags as pair array" begin
|
90 | 90 | run = createrun(mlf, experiment_id)
|
91 |
| - logbatch(mlf, run, metrics=["ana" => 0.5], |
| 91 | + logbatch(mlf, run; metrics=["ana" => 0.5], |
92 | 92 | params=["test_param" => "0.9"], tags=["test_tag" => "gala"])
|
93 | 93 |
|
94 | 94 | run = refresh(mlf, run)
|
|
113 | 113 |
|
114 | 114 | @testset "with metrics, params and tags as tuple array" begin
|
115 | 115 | run = createrun(mlf, experiment_id)
|
116 |
| - logbatch(mlf, run, metrics=[("ana", 0.5)], |
| 116 | + logbatch(mlf, run; metrics=[("ana", 0.5)], |
117 | 117 | params=[("test_param", "0.9")], tags=[("test_tag", "gala")])
|
118 | 118 |
|
119 | 119 | run = refresh(mlf, run)
|
|
138 | 138 |
|
139 | 139 | @testset "with metrics, params and tags as dict array" begin
|
140 | 140 | run = createrun(mlf, experiment_id)
|
141 |
| - logbatch(mlf, run, |
| 141 | + logbatch(mlf, run; |
142 | 142 | metrics=[Dict("key" => "ana", "value" => 0.5, "timestamp" => 123)],
|
143 | 143 | params=[Dict("key" => "test_param", "value" => "0.9")],
|
144 | 144 | tags=[Dict("key" => "test_tag", "value" => "gala")])
|
|
166 | 166 |
|
167 | 167 | deleteexperiment(mlf, experiment_id)
|
168 | 168 | end
|
| 169 | + |
| 170 | +@testset verbose = true "log inputs" begin |
| 171 | + @ensuremlf |
| 172 | + |
| 173 | + experiment_id = createexperiment(mlf, UUIDs.uuid4() |> string) |
| 174 | + |
| 175 | + @testset "with run id as string" begin |
| 176 | + run = createrun(mlf, experiment_id) |
| 177 | + inputs = [DatasetInput([Tag("tag_key", "tag_value")], |
| 178 | + Dataset("dataset_name", "dataset_digest", "dataset_source_type", |
| 179 | + "dataset_source", nothing, nothing))] |
| 180 | + loginputs(mlf, run.info.run_id, inputs) |
| 181 | + |
| 182 | + run = refresh(mlf, run) |
| 183 | + |
| 184 | + @test run.inputs.dataset_inputs |> length == 1 |
| 185 | + |
| 186 | + dataset_input = run.inputs.dataset_inputs |> first |
| 187 | + dataset_input_tag = dataset_input.tags |> first |
| 188 | + |
| 189 | + @test dataset_input_tag isa Tag |
| 190 | + @test dataset_input_tag.key == "tag_key" |
| 191 | + @test dataset_input_tag.value == "tag_value" |
| 192 | + |
| 193 | + @test dataset_input.dataset isa Dataset |
| 194 | + @test dataset_input.dataset.name == "dataset_name" |
| 195 | + @test dataset_input.dataset.digest == "dataset_digest" |
| 196 | + @test dataset_input.dataset.source_type == "dataset_source_type" |
| 197 | + @test dataset_input.dataset.source == "dataset_source" |
| 198 | + @test dataset_input.dataset.schema |> isnothing |
| 199 | + @test dataset_input.dataset.profile |> isnothing |
| 200 | + end |
| 201 | + |
| 202 | + deleteexperiment(mlf, experiment_id) |
| 203 | +end |
0 commit comments