Skip to content

Commit

Permalink
logInputs
Browse files Browse the repository at this point in the history
  • Loading branch information
nojaf committed Oct 10, 2024
1 parent b1ed3d6 commit ae29fd7
Show file tree
Hide file tree
Showing 14 changed files with 863 additions and 764 deletions.
2 changes: 1 addition & 1 deletion magefiles/generate/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var ServiceInfoMap = map[string]ServiceGenerationInfo{
// "getMetricHistoryBulkInterval",
"logBatch",
// "logModel",
// "logInputs",
"logInputs",
// "startTrace",
// "endTrace",
// "getTraceInfo",
Expand Down
10 changes: 10 additions & 0 deletions magefiles/generate/validations.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,14 @@ var validations = map[string]string{
"SetExperimentTag_ExperimentId": "required",
"SetExperimentTag_Key": "required,max=250,validMetricParamOrTagName",
"SetExperimentTag_Value": "max=5000",
"LogInputs_RunId": "required",
"LogInputs_Datasets": "required",
"Dataset_Name": "required,max=500",
"Dataset_Digest": "required,max=36",
"Dataset_SourceType": "required",
"Dataset_Source": "required,max=65535",
"Dataset_Profile": "max:16777215",
"Dataset_Schema": "max:1048575",
"InputTag_Key": "required,max=255",
"InputTag_Value": "required,max=500",
}
3 changes: 2 additions & 1 deletion pkg/contract/service/tracking.g.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions pkg/entities/dataset.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,14 @@ func (d *Dataset) ToProto() *protos.Dataset {
Profile: profile,
}
}

func NewDatasetFromProto(proto *protos.Dataset) *Dataset {
return &Dataset{
Name: proto.GetName(),
Digest: proto.GetDigest(),
SourceType: proto.GetSourceType(),
Source: proto.GetSource(),
Schema: proto.GetSchema(),
Profile: proto.GetProfile(),
}
}
12 changes: 12 additions & 0 deletions pkg/entities/dataset_input.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,15 @@ func (ds DatasetInput) ToProto() *protos.DatasetInput {
Dataset: ds.Dataset.ToProto(),
}
}

func NewDatasetInputFromProto(proto *protos.DatasetInput) *DatasetInput {
tags := make([]*InputTag, 0, len(proto.GetTags()))
for _, t := range proto.GetTags() {
tags = append(tags, NewInputTagFromProto(t))
}

return &DatasetInput{
Dataset: NewDatasetFromProto(proto.GetDataset()),
Tags: tags,
}
}
7 changes: 7 additions & 0 deletions pkg/entities/input_tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,10 @@ func (i InputTag) ToProto() *protos.InputTag {
Value: &i.Value,
}
}

func NewInputTagFromProto(proto *protos.InputTag) *InputTag {
return &InputTag{
Key: proto.GetKey(),
Value: proto.GetValue(),
}
}
20 changes: 14 additions & 6 deletions pkg/lib/tracking.g.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ae29fd7

Please sign in to comment.