-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathseries_error.go
256 lines (196 loc) · 4.57 KB
/
series_error.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
package gandalff
import "github.com/caerbannogwhite/preludiometa"
// Dummy series for error handling.
type SeriesError struct {
msg string
}
func (s SeriesError) printInfo() {}
// Return the context of the series.
func (s SeriesError) GetContext() *Context {
return nil
}
// Returns the length of the series.
func (s SeriesError) Len() int {
return 0
}
// Returns if the series is grouped.
func (s SeriesError) IsGrouped() bool {
return false
}
// Returns if the series admits null values.
func (s SeriesError) IsNullable() bool {
return false
}
func (s SeriesError) IsSorted() SeriesSortOrder {
return SORTED_NONE
}
// Returns if the series is error.
func (s SeriesError) IsError() bool {
return true
}
// Returns the error message of the series.
func (s SeriesError) GetError() string {
return s.msg
}
// Makes the series nullable.
func (s SeriesError) MakeNullable() Series {
return s
}
// Make the series non-nullable.
func (s SeriesError) MakeNonNullable() Series {
return s
}
// Returns the type of the series.
func (s SeriesError) Type() preludiometa.BaseType {
return preludiometa.ErrorType
}
// Returns the type and cardinality of the series.
func (s SeriesError) TypeCard() preludiometa.BaseTypeCard {
return preludiometa.BaseTypeCard{Base: preludiometa.ErrorType, Card: s.Len()}
}
// Returns if the series has null values.
func (s SeriesError) HasNull() bool {
return false
}
// Returns the number of null values in the series.
func (s SeriesError) NullCount() int {
return 0
}
// Returns if the element at index i is null.
func (s SeriesError) IsNull(i int) bool {
return false
}
// Returns the null mask of the series.
func (s SeriesError) GetNullMask() []bool {
return []bool{}
}
// Sets the null mask of the series.
func (s SeriesError) SetNullMask(mask []bool) Series {
return s
}
// Get the element at index i.
func (s SeriesError) Get(i int) any {
return nil
}
func (s SeriesError) GetAsString(i int) string {
return ""
}
// Set the element at index i.
func (s SeriesError) Set(i int, v any) Series {
return s
}
// Take the elements according to the given interval.
func (s SeriesError) Take(params ...int) Series {
return s
}
// Append elements to the series.
func (s SeriesError) Append(v any) Series {
return s
}
// All-data accessors.
// Returns the actual data of the series.
func (s SeriesError) Data() any {
return s
}
// Returns the nullable data of the series.
func (s SeriesError) DataAsNullable() any {
return s
}
// Returns the data of the series as a slice of strings.
func (s SeriesError) DataAsString() []string {
return []string{s.msg}
}
// Casts the series to a given type.
func (s SeriesError) Cast(t preludiometa.BaseType) Series {
return s
}
// Copies the series.
func (s SeriesError) Copy() Series {
return s
}
// Series operations.
// Filters out the elements by the given mask.
// Mask can be a bool series, a slice of bools or a slice of ints.
func (s SeriesError) Filter(mask any) Series {
return s
}
func (s SeriesError) filterIntSlice(mask []int, check bool) Series {
return s
}
func (s SeriesError) Map(f MapFunc) Series {
return s
}
func (s SeriesError) MapNull(f MapFuncNull) Series {
return s
}
// Group the elements in the series.
func (s SeriesError) group() Series {
return s
}
func (s SeriesError) GroupBy(gp SeriesPartition) Series {
return s
}
func (s SeriesError) UnGroup() Series {
return s
}
func (s SeriesError) GetPartition() SeriesPartition {
return nil
}
// Sort interface.
func (s SeriesError) Less(i, j int) bool {
return false
}
func (s SeriesError) equal(i, j int) bool {
return false
}
func (s SeriesError) Swap(i, j int) {}
func (s SeriesError) Sort() Series {
return s
}
func (s SeriesError) SortRev() Series {
return s
}
//////////////////////// ARITHMETIC OPERATIONS
func (s SeriesError) And(other any) Series {
return s
}
func (s SeriesError) Or(other any) Series {
return s
}
func (s SeriesError) Mul(other any) Series {
return s
}
func (s SeriesError) Div(other any) Series {
return s
}
func (s SeriesError) Mod(other any) Series {
return s
}
func (s SeriesError) Exp(other any) Series {
return s
}
func (s SeriesError) Add(other any) Series {
return s
}
func (s SeriesError) Sub(other any) Series {
return s
}
//////////////////////// LOGICAL OPERATIONS
func (s SeriesError) Eq(other any) Series {
return s
}
func (s SeriesError) Ne(other any) Series {
return s
}
func (s SeriesError) Gt(other any) Series {
return s
}
func (s SeriesError) Ge(other any) Series {
return s
}
func (s SeriesError) Lt(other any) Series {
return s
}
func (s SeriesError) Le(other any) Series {
return s
}