(ctx context.Context, label *pb.LabelVariant)
| 722 | } |
| 723 | |
| 724 | func (serv *MetadataServer) CreateLabelVariant(ctx context.Context, label *pb.LabelVariant) (*pb.Empty, error) { |
| 725 | serv.Logger.Infow("Creating Label Variant", "name", label.Name, "variant", label.Variant) |
| 726 | protoSource := label.Source |
| 727 | serv.Logger.Debugw("Finding label source", "name", protoSource.Name, "variant", protoSource.Variant) |
| 728 | source, err := serv.client.GetSourceVariant(ctx, metadata.NameVariant{protoSource.Name, protoSource.Variant}) |
| 729 | if err != nil { |
| 730 | serv.Logger.Errorw("Could not create label source variant", "error", err) |
| 731 | return nil, err |
| 732 | } |
| 733 | label.Provider = source.Provider() |
| 734 | resp, err := serv.meta.CreateLabelVariant(ctx, label) |
| 735 | serv.Logger.Debugw("Created label variant", "response", resp) |
| 736 | if err != nil { |
| 737 | serv.Logger.Errorw("Could not create label variant", "response", resp, "error", err) |
| 738 | } |
| 739 | return resp, err |
| 740 | } |
| 741 | |
| 742 | func (serv *MetadataServer) CreateTrainingSetVariant(ctx context.Context, train *pb.TrainingSetVariant) (*pb.Empty, error) { |
| 743 | serv.Logger.Infow("Creating Training Set Variant", "name", train.Name, "variant", train.Variant) |
nothing calls this directly
no test coverage detected