MCPcopy Create free account
hub / github.com/rilldata/rill / toModelPartitionRow

Function toModelPartitionRow

cli/pkg/printer/resources.go:652–670  ·  view source on GitHub ↗
(s *runtimev1.ModelPartition)

Source from the content-addressed store, hash-verified

650}
651
652func toModelPartitionRow(s *runtimev1.ModelPartition) *modelPartition {
653 data, err := json.Marshal(s.Data)
654 if err != nil {
655 panic(err)
656 }
657
658 var executedOn string
659 if s.ExecutedOn != nil {
660 executedOn = s.ExecutedOn.AsTime().Format(time.RFC3339)
661 }
662
663 return &modelPartition{
664 Key: s.Key,
665 DataJSON: string(data),
666 ExecutedOn: executedOn,
667 Elapsed: (time.Duration(s.ElapsedMs) * time.Millisecond).String(),
668 Error: s.Error,
669 }
670}
671
672type modelPartition struct {
673 Key string `header:"key" json:"key"`

Callers 1

toModelPartitionsTableFunction · 0.85

Calls 2

FormatMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected