Skip to content

Commit 69da630

Browse files
authored
data: Add frame.SetRefID method (#1209)
1 parent 73f56c7 commit 69da630

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

data/field.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,13 @@ func (f *Field) Nullable() bool {
226226
return f.Type().Nullable()
227227
}
228228

229+
// SetConfig modifies the Field's Config property to
230+
// be set to conf and returns the Field.
231+
func (f *Field) SetConfig(conf *FieldConfig) *Field {
232+
f.Config = conf
233+
return f
234+
}
235+
229236
// FloatAt returns a float64 at the specified index idx for all supported Field types.
230237
// It will panic if idx is out of range.
231238
//

data/frame.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -211,13 +211,6 @@ func (f *Frame) TypeIndices(fTypes ...FieldType) []int {
211211
return indices
212212
}
213213

214-
// SetConfig modifies the Field's Config property to
215-
// be set to conf and returns the Field.
216-
func (f *Field) SetConfig(conf *FieldConfig) *Field {
217-
f.Config = conf
218-
return f
219-
}
220-
221214
// NewFrame returns a new Frame.
222215
func NewFrame(name string, fields ...*Field) *Frame {
223216
return &Frame{
@@ -232,6 +225,12 @@ func (f *Frame) SetMeta(m *FrameMeta) *Frame {
232225
return f
233226
}
234227

228+
// SetRefID sets the Frame's RefID attribute to r and returns the Frame.
229+
func (f *Frame) SetRefID(r string) *Frame {
230+
f.RefID = r
231+
return f
232+
}
233+
235234
// Rows returns the number of rows in the frame.
236235
func (f *Frame) Rows() int {
237236
if len(f.Fields) > 0 {

0 commit comments

Comments
 (0)