Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correct aggregate params types #3846

Merged
merged 1 commit into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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