Skip to content

Commit fe60809

Browse files
authored
fix read MLFlow model with versions (#1196)
1 parent b6b0e2e commit fe60809

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

mlflow/resource_model.go

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,28 @@ type Tag struct {
1212
Value string `json:"value"`
1313
}
1414

15+
// ModelVersion defines a MLFlow model version as returned by the API
16+
type ModelVersion struct {
17+
Name string `json:"name"`
18+
Version string `json:"version"`
19+
CreationTimestamp int64 `json:"creation_timestamp,omitempty"`
20+
LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty"`
21+
UserID string `json:"user_id,omitempty"`
22+
CurrentStage string `json:"current_stage,omitempty"`
23+
Source string `json:"source,omitempty"`
24+
Status string `json:"status,omitempty"`
25+
}
26+
1527
// Model defines the response object from the API
1628
type Model struct {
17-
Name string `json:"name" tf:"force_new"`
18-
CreationTimestamp int64 `json:"creation_timestamp,omitempty" tf:"computed"`
19-
LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty" tf:"computed"`
20-
UserID string `json:"user_id,omitempty" tf:"computed"`
21-
LatestVersions []string `json:"latest_versions,omitempty" tf:"computed"`
22-
Description string `json:"description,omitempty"`
23-
Tags []Tag `json:"tags,omitempty"`
24-
RegisteredModelID string `json:"id,omitempty" tf:"computed,alias:registered_model_id"`
29+
Name string `json:"name" tf:"force_new"`
30+
CreationTimestamp int64 `json:"creation_timestamp,omitempty" tf:"computed"`
31+
LastUpdatedTimestamp int64 `json:"last_updated_timestamp,omitempty" tf:"computed"`
32+
UserID string `json:"user_id,omitempty" tf:"computed"`
33+
LatestVersions []ModelVersion `json:"latest_versions,omitempty" tf:"computed"`
34+
Description string `json:"description,omitempty"`
35+
Tags []Tag `json:"tags,omitempty"`
36+
RegisteredModelID string `json:"id,omitempty" tf:"computed,alias:registered_model_id"`
2537
}
2638

2739
// registeredModel defines response from GET API op

0 commit comments

Comments
 (0)