Skip to content

Commit b8e4e44

Browse files
authored
groupBy: support non-strings (#283)
previously, group-by coerced all values into strings for comparison, but only for the left-hand side, effectively resulting into groupBy being only usable with strings. by changing the set type to literal "any", this limitation is removed.
1 parent db9e8b0 commit b8e4e44

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/datasource.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ export const groupBy = (frame: DataFrame, fieldName: string): DataFrame[] => {
265265
return [frame];
266266
}
267267

268-
const uniqueValues = new Set<string>(groupByField.values.toArray().map((value) => value.toString()));
268+
const uniqueValues = new Set(groupByField.values.toArray());
269269

270270
const frames = [...uniqueValues].map((groupByValue) => {
271271
const fields: Field[] = frame.fields

0 commit comments

Comments
 (0)