MCPcopy Create free account
hub / github.com/featureform/featureform / Serialize

Method Serialize

metadata/client.go:766–793  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

764}
765
766func (def SourceDef) Serialize() (*pb.SourceVariant, error) {
767 serialized := &pb.SourceVariant{
768 Name: def.Name,
769 Variant: def.Variant,
770 Description: def.Description,
771 Owner: def.Owner,
772 Status: &pb.ResourceStatus{Status: pb.ResourceStatus_CREATED},
773 Provider: def.Provider,
774 Schedule: def.Schedule,
775 Tags: &pb.Tags{Tag: def.Tags},
776 Properties: def.Properties.Serialize(),
777 }
778 var err error
779 switch x := def.Definition.(type) {
780 case TransformationSource:
781 serialized.Definition, err = def.Definition.(TransformationSource).Serialize()
782 case PrimaryDataSource:
783 serialized.Definition, err = def.Definition.(PrimaryDataSource).Serialize()
784 case nil:
785 return nil, fmt.Errorf("SourceDef Definition not set")
786 default:
787 return nil, fmt.Errorf("SourceDef Definition has unexpected type %T", x)
788 }
789 if err != nil {
790 return nil, err
791 }
792 return serialized, nil
793}
794
795func (client *Client) CreateSourceVariant(ctx context.Context, def SourceDef) error {
796 serialized, err := def.Serialize()

Callers 1

Test_GetEquivalentFunction · 0.95

Calls 1

SerializeMethod · 0.65

Tested by 1

Test_GetEquivalentFunction · 0.76