Skip to content

Commit

Permalink
change names
Browse files Browse the repository at this point in the history
  • Loading branch information
mbondyra committed Nov 9, 2020
1 parent ffa8777 commit 7202865
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { counterRate, CounterRateArgs } from '../counter_rate';
import { Datatable } from 'src/plugins/expressions/public';
import { functionWrapper } from 'src/plugins/expressions/common/expression_functions/specs/tests/utils';

describe('counter_rate', () => {
describe('lens_counter_rate', () => {
const fn = functionWrapper(counterRate);
const runFn = (input: Datatable, args: CounterRateArgs) => fn(input, args) as Datatable;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface CounterRateArgs {
}

export type ExpressionFunctionCounterRate = ExpressionFunctionDefinition<
'counter_rate',
'lens_counter_rate',
Datatable,
CounterRateArgs,
Datatable
Expand Down Expand Up @@ -52,7 +52,7 @@ export type ExpressionFunctionCounterRate = ExpressionFunctionDefinition<
* Missing values (`null` and `undefined`) will be treated as empty strings.
*/
export const counterRate: ExpressionFunctionCounterRate = {
name: 'counter_rate',
name: 'lens_counter_rate',
type: 'datatable',

inputTypes: ['datatable'],
Expand Down Expand Up @@ -94,6 +94,16 @@ export const counterRate: ExpressionFunctionCounterRate = {
},

fn(input, { by, inputColumnId, outputColumnId, outputColumnName }) {
const resultColumns = buildResultColumns(
input,
outputColumnId,
inputColumnId,
outputColumnName
);

if (!resultColumns) {
return input;
}
const previousValues: Partial<Record<string, number>> = {};
return {
...input,
Expand Down

0 comments on commit 7202865

Please sign in to comment.