Skip to content

Commit bc0e99a

Browse files
authored
Merge pull request #74 from JuliaAI/json-update
Extend [compat] JSON="0.21,1"
2 parents 6bf2d8e + 9b97bf4 commit bc0e99a

File tree

13 files changed

+34
-26
lines changed

13 files changed

+34
-26
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
matrix:
1616
version:
1717
- '1.10'
18+
- '1.11'
1819
- '1' # automatically expands to the latest stable 1.x release of Julia.
1920
os:
2021
- ubuntu-latest

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "MLFlowClient"
22
uuid = "64a0f543-368b-4a9a-827a-e71edb2a0b83"
33
authors = ["@deyandyankov, @pebeto, and contributors"]
4-
version = "0.7.0"
4+
version = "0.7.1"
55

66
[deps]
77
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
@@ -15,7 +15,7 @@ UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
1515
[compat]
1616
Base64 = "1.0"
1717
HTTP = "1.0"
18-
JSON = "0.21"
18+
JSON = "0.21,1"
1919
ShowCases = "0.1"
2020
URIs = "1.0"
2121
julia = "1.0"

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
[![Build Status](https://github.com/JuliaAI/MLFlowClient.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/JuliaAI/MLFlowClient.jl/actions/workflows/CI.yml?query=branch%3Amain)
55
[![Coverage](https://codecov.io/gh/JuliaAI/MLFlowClient.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/JuliaAI/MLFlowClient.jl)
66

7-
Julia client for [MLFlow](https://www.mlflow.org/) `3.2.0` (but should work with other versions as well).
7+
Julia client for [MLFlow](https://www.mlflow.org/) `3.2.0`. Use with later versions at
8+
your own risk. For example, there is [this known
9+
issue](https://github.com/JuliaAI/MLFlowClient.jl/issues/76).
810

911
- [x] Supports tracking of metrics, parameters, tags, artifacts, and models.
1012
- [x] Compatible with latest MLFlow server capabilities.

src/types/dataset.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ struct Dataset
2020
schema::Union{String,Nothing}
2121
profile::Union{String,Nothing}
2222
end
23-
Dataset(data::Dict{String,Any}) = Dataset(data["name"], data["digest"],
23+
Dataset(data::AbstractDict{String}) = Dataset(data["name"], data["digest"],
2424
data["source_type"], data["source"], get(data, "schema", nothing),
2525
get(data, "profile", nothing))
2626
Base.show(io::IO, t::Dataset) = show(io, ShowCase(t, new_lines=true))
@@ -38,6 +38,6 @@ struct DatasetInput
3838
tags::Array{Tag}
3939
dataset::Dataset
4040
end
41-
DatasetInput(data::Dict{String,Any}) = DatasetInput(
41+
DatasetInput(data::AbstractDict{String}) = DatasetInput(
4242
[Tag(tag) for tag in get(data, "tags", [])], Dataset(data["dataset"]))
4343
Base.show(io::IO, t::DatasetInput) = show(io, ShowCase(t, new_lines=true))

src/types/experiment.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ struct Experiment
2020
creation_time::Int64
2121
tags::Array{Tag}
2222
end
23-
Experiment(data::Dict{String,Any}) = Experiment(data["experiment_id"], data["name"],
23+
Experiment(data::AbstractDict{String}) = Experiment(data["experiment_id"], data["name"],
2424
data["artifact_location"], data["lifecycle_stage"], data["last_update_time"],
2525
data["creation_time"], [Tag(tag) for tag in get(data, "tags", [])])
2626
Base.show(io::IO, t::Experiment) = show(io, ShowCase(t, new_lines=true))
@@ -38,6 +38,6 @@ struct ExperimentPermission
3838
user_id::String
3939
permission::Permission.PermissionEnum
4040
end
41-
ExperimentPermission(data::Dict{String,Any}) = ExperimentPermission(data["experiment_id"],
41+
ExperimentPermission(data::AbstractDict{String}) = ExperimentPermission(data["experiment_id"],
4242
data["user_id"] |> string, Permission.parse(data["permission"]))
4343
Base.show(io::IO, t::ExperimentPermission) = show(io, ShowCase(t, new_lines=true))

src/types/mlflow.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Base type which defines location and version for MLFlow API service.
66
# Fields
77
- `apiroot::String`: API root URL, e.g. `http://localhost:5000/api`
88
- `apiversion::Union{Integer, AbstractFloat}`: used API version, e.g. `2.0`
9-
- `headers::Dict`: HTTP headers to be provided with the REST API requests.
9+
- `headers::AbstractDict`: HTTP headers to be provided with the REST API requests.
1010
- `username::Union{Nothing, String}`: username for basic authentication.
1111
- `password::Union{Nothing, String}`: password for basic authentication.
1212
@@ -34,7 +34,7 @@ mlf = MLFlow(remote_url, headers=Dict("Authorization" => "Bearer <your-secret-to
3434
struct MLFlow
3535
apiroot::String
3636
apiversion::AbstractFloat
37-
headers::Dict
37+
headers::AbstractDict
3838
username::Union{Nothing,String}
3939
password::Union{Nothing,String}
4040

@@ -65,12 +65,12 @@ struct MLFlow
6565
new(apiroot, apiversion, headers, username, password)
6666
end
6767
end
68-
MLFlow(apiroot::String; apiversion::AbstractFloat=2.0, headers::Dict=Dict(),
68+
MLFlow(apiroot::String; apiversion::AbstractFloat=2.0, headers::AbstractDict=Dict(),
6969
username::Union{Nothing,String}=nothing,
7070
password::Union{Nothing,String}=nothing)::MLFlow =
7171
MLFlow(apiroot, apiversion, headers, username, password)
7272
MLFlow(; apiroot::String="http://localhost:5000/api", apiversion::AbstractFloat=2.0,
73-
headers::Dict=Dict(), username::Union{Nothing,String}=nothing,
73+
headers::AbstractDict=Dict(), username::Union{Nothing,String}=nothing,
7474
password::Union{Nothing,String}=nothing)::MLFlow =
7575
MLFlow(apiroot, apiversion, headers, username, password)
7676

src/types/model.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ struct ModelVersion
103103
run_link::String
104104
aliases::Array{String}
105105
end
106-
ModelVersion(data::Dict{String,Any}) = ModelVersion(data["name"], data["version"],
106+
ModelVersion(data::AbstractDict{String}) = ModelVersion(data["name"], data["version"],
107107
data["creation_timestamp"], data["last_updated_timestamp"],
108108
get(data, "user_id", nothing), data["current_stage"], data["description"],
109109
data["source"], data["run_id"], data["status"] |> ModelVersionStatus.parse,

src/types/registered_model.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ struct RegisteredModelAlias
1111
alias::String
1212
version::String
1313
end
14-
RegisteredModelAlias(data::Dict{String,Any}) = RegisteredModelAlias(data["alias"],
14+
RegisteredModelAlias(data::AbstractDict{String}) = RegisteredModelAlias(data["alias"],
1515
data["version"])
1616
Base.show(io::IO, t::RegisteredModelAlias) = show(io, ShowCase(t, new_lines=true))
1717

@@ -45,7 +45,7 @@ struct RegisteredModel
4545
deployment_job_id::Union{String,Nothing}
4646
deployment_job_state::Union{State.StateEnum,Nothing}
4747
end
48-
RegisteredModel(data::Dict{String,Any}) = RegisteredModel(data["name"],
48+
RegisteredModel(data::AbstractDict{String}) = RegisteredModel(data["name"],
4949
data["creation_timestamp"], data["last_updated_timestamp"],
5050
get(data, "user_id", nothing), get(data, "description", nothing),
5151
[ModelVersion(version) for version in get(data, "latest_versions", [])],
@@ -68,6 +68,6 @@ struct RegisteredModelPermission
6868
user_id::String
6969
permission::Permission.PermissionEnum
7070
end
71-
RegisteredModelPermission(data::Dict{String,Any}) = RegisteredModelPermission(data["name"],
71+
RegisteredModelPermission(data::AbstractDict{String}) = RegisteredModelPermission(data["name"],
7272
data["user_id"] |> string, Permission.parse(data["permission"]))
7373
Base.show(io::IO, t::RegisteredModelPermission) = show(io, ShowCase(t, new_lines=true))

src/types/run.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ struct Metric <: LoggingData
1515
timestamp::Int64
1616
step::Union{Int64,Nothing}
1717
end
18-
Metric(data::Dict{String,Any}) = Metric(data["key"], data["value"], data["timestamp"],
18+
Metric(data::AbstractDict{String}) = Metric(data["key"], data["value"], data["timestamp"],
1919
data["step"])
2020
Base.show(io::IO, t::Metric) = show(io, ShowCase(t, new_lines=true))
2121

@@ -32,7 +32,7 @@ struct Param <: LoggingData
3232
key::String
3333
value::String
3434
end
35-
Param(data::Dict{String,Any}) = Param(data["key"], data["value"])
35+
Param(data::AbstractDict{String}) = Param(data["key"], data["value"])
3636
Base.show(io::IO, t::Param) = show(io, ShowCase(t, new_lines=true))
3737

3838
"""
@@ -64,7 +64,7 @@ struct RunInfo
6464
artifact_uri::String
6565
lifecycle_stage::String
6666
end
67-
RunInfo(data::Dict{String,Any}) = RunInfo(data["run_id"], data["run_name"],
67+
RunInfo(data::AbstractDict{String}) = RunInfo(data["run_id"], data["run_name"],
6868
data["experiment_id"], RunStatus.parse(data["status"]), data["start_time"],
6969
get(data, "end_time", nothing), data["artifact_uri"], data["lifecycle_stage"])
7070
Base.show(io::IO, t::RunInfo) = show(io, ShowCase(t, new_lines=true))
@@ -84,7 +84,7 @@ struct RunData
8484
params::Array{Param}
8585
tags::Array{Tag}
8686
end
87-
RunData(data::Dict{String,Any}) = RunData(
87+
RunData(data::AbstractDict{String}) = RunData(
8888
[Metric(metric) for metric in get(data, "metrics", [])],
8989
[Param(param) for param in get(data, "params", [])],
9090
[Tag(tag) for tag in get(data, "tags", [])])
@@ -102,7 +102,7 @@ struct RunInputs
102102
dataset_inputs::Array{DatasetInput}
103103
model_inputs::Array{ModelInput}
104104
end
105-
RunInputs(data::Dict{String,Any}) = RunInputs(
105+
RunInputs(data::AbstractDict{String}) = RunInputs(
106106
[DatasetInput(dataset_input) for dataset_input in get(data, "dataset_inputs", [])],
107107
[ModelInput(model_input) for model_input in get(data, "model_inputs", [])])
108108
Base.show(io::IO, t::RunInputs) = show(io, ShowCase(t, new_lines=true))
@@ -118,7 +118,7 @@ Outputs of a [`Run`](@ref).
118118
struct RunOutputs
119119
model_outputs::Array{ModelOutput}
120120
end
121-
RunOutputs(data::Dict{String,Any}) = RunOutputs(
121+
RunOutputs(data::AbstractDict{String}) = RunOutputs(
122122
[ModelOutput(model_output) for model_output in get(data, "model_outputs", [])])
123123
Base.show(io::IO, t::RunOutputs) = show(io, ShowCase(t, new_lines=true))
124124

@@ -139,6 +139,6 @@ struct Run
139139
inputs::RunInputs
140140
outputs::RunOutputs
141141
end
142-
Run(data::Dict{String,Any}) = Run(RunInfo(data["info"]), RunData(data["data"]),
142+
Run(data::AbstractDict{String}) = Run(RunInfo(data["info"]), RunData(data["data"]),
143143
RunInputs(data["inputs"]), RunOutputs(data["outputs"]))
144144
Base.show(io::IO, t::Run) = show(io, ShowCase(t, new_lines=true))

src/types/tag.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ struct Tag <: LoggingData
1111
key::String
1212
value::String
1313
end
14-
Tag(data::Dict{String,Any})::Tag = Tag(data["key"], data["value"] |> string)
14+
Tag(data::AbstractDict{String})::Tag = Tag(data["key"], data["value"] |> string)
1515
Base.show(io::IO, t::Tag) = show(io, ShowCase(t, new_lines=true))

0 commit comments

Comments
 (0)