Skip to content

Commit

Permalink
fix: correct aggregate params types (#3846)
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz committed Jan 3, 2024
1 parent 229c806 commit 2dd9e53
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/vega-transforms/src/Aggregate.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {accessorFields, accessorName, array, error, inherits} from 'vega-util';
* @param {Array<function(object): *>} [params.groupby] - An array of accessors to groupby.
* @param {Array<function(object): *>} [params.fields] - An array of accessors to aggregate.
* @param {Array<string>} [params.ops] - An array of strings indicating aggregation operations.
* @param {Array<object>} [params.aggregate_params=[null]] - An optional array of parameters for aggregation operations.
* @param {Array<number>} [params.aggregate_params] - An optional array of parameters for aggregation operations.
* @param {Array<string>} [params.as] - An array of output field names for aggregated values.
* @param {boolean} [params.cross=false] - A flag indicating that the full
* cross-product of groupby values should be generated, including empty cells.
Expand Down Expand Up @@ -46,7 +46,7 @@ Aggregate.Definition = {
'params': [
{ 'name': 'groupby', 'type': 'field', 'array': true },
{ 'name': 'ops', 'type': 'enum', 'array': true, 'values': ValidAggregateOps },
{ 'name': 'aggregate_params', 'type': 'field', 'null': true, 'array': true, 'default': [null] },
{ 'name': 'aggregate_params', 'type': 'number', 'null': true, 'array': true },
{ 'name': 'fields', 'type': 'field', 'null': true, 'array': true },
{ 'name': 'as', 'type': 'string', 'null': true, 'array': true },
{ 'name': 'drop', 'type': 'boolean', 'default': true },
Expand Down
4 changes: 2 additions & 2 deletions packages/vega-transforms/src/Window.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {bisector} from 'd3-array';
* @param {Array<function(object): *>} [params.fields] - An array of accessors
* for data fields to use as inputs to window operations.
* @param {Array<*>} [params.params] - An array of parameter values for window operations.
* @param {Array<object>} [params.aggregate_params] - An optional array of parameter values for aggregation operations.
* @param {Array<number>} [params.aggregate_params] - An optional array of parameter values for aggregation operations.
* @param {Array<string>} [params.as] - An array of output field names for window operations.
* @param {Array<number>} [params.frame] - Window frame definition as two-element array.
* @param {boolean} [params.ignorePeers=false] - If true, base window frame boundaries on row
Expand All @@ -38,7 +38,7 @@ Window.Definition = {
{ 'name': 'groupby', 'type': 'field', 'array': true },
{ 'name': 'ops', 'type': 'enum', 'array': true, 'values': ValidWindowOps.concat(ValidAggregateOps) },
{ 'name': 'params', 'type': 'number', 'null': true, 'array': true },
{ 'name': 'aggregate_params', 'type': 'field', 'null': true, 'array': true, 'default': [null] },
{ 'name': 'aggregate_params', 'type': 'number', 'null': true, 'array': true},
{ 'name': 'fields', 'type': 'field', 'null': true, 'array': true },
{ 'name': 'as', 'type': 'string', 'null': true, 'array': true },
{ 'name': 'frame', 'type': 'number', 'null': true, 'array': true, 'length': 2, 'default': [null, 0] },
Expand Down
2 changes: 1 addition & 1 deletion packages/vega-typings/types/spec/transform.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export interface AggregateTransform {
groupby?: FieldRef[] | SignalRef;
fields?: (FieldRef | null)[] | SignalRef;
ops?: (AggregateOp | SignalRef)[] | SignalRef;
aggregate_params?: object[];
aggregate_params?: number[];
as?: (string | SignalRef | null)[] | SignalRef;
drop?: boolean | SignalRef;
cross?: boolean | SignalRef;
Expand Down

0 comments on commit 2dd9e53

Please sign in to comment.