MCPcopy Create free account
hub / github.com/datasweet/datatable / Update

Method Update

mutate_row.go:69–93  ·  view source on GitHub ↗

Update the row at index

(at int, row Row)

Source from the content-addressed store, hash-verified

67
68// Update the row at index
69func (t *DataTable) Update(at int, row Row) error {
70 if row == nil {
71 row = make(Row, 0)
72 }
73
74 for _, col := range t.cols {
75 if col.IsComputed() {
76 continue
77 }
78 cell, ok := row[col.name]
79 if ok {
80 if err := col.serie.Set(at, cell); err != nil {
81 err := errors.Wrapf(err, "col %s", col.name)
82 return errors.Wrap(err, ErrUpdateRow.Error())
83 }
84 continue
85 }
86 if err := col.serie.Set(at, nil); err != nil {
87 err := errors.Wrapf(err, "col %s", col.name)
88 return errors.Wrap(err, ErrUpdateRow.Error())
89 }
90 }
91
92 return nil
93}

Callers

nothing calls this directly

Calls 2

IsComputedMethod · 0.65
SetMethod · 0.65

Tested by

no test coverage detected