Skip to content

Commit

Permalink
Disables no-unused-vars for the operators
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-s-molina committed Jun 15, 2022
1 parent c1ff19b commit 7f0c604
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
import { PostProcessingContribution } from '@superset-ui/core';
import { PostProcessingFactory } from './types';

/* eslint-disable @typescript-eslint/no-unused-vars */
export const contributionOperator: PostProcessingFactory<PostProcessingContribution> =
formData => {
(formData, queryObject) => {
if (formData.contributionMode) {
return {
operation: 'contribution',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
import { PostProcessingFlatten } from '@superset-ui/core';
import { PostProcessingFactory } from './types';

export const flattenOperator: PostProcessingFactory<PostProcessingFlatten> =
() => ({
operation: 'flatten',
});
/* eslint-disable @typescript-eslint/no-unused-vars */
export const flattenOperator: PostProcessingFactory<PostProcessingFlatten> = (
formData,
queryObject,
) => ({
operation: 'flatten',
});
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,25 @@ import {
} from '@superset-ui/core';
import { PostProcessingFactory } from './types';

export const prophetOperator: PostProcessingFactory<PostProcessingProphet> =
formData => {
const index = getColumnLabel(formData.x_axis || DTTM_ALIAS);
if (formData.forecastEnabled) {
return {
operation: 'prophet',
options: {
time_grain: formData.time_grain_sqla,
periods: parseInt(formData.forecastPeriods, 10),
confidence_interval: parseFloat(formData.forecastInterval),
yearly_seasonality: formData.forecastSeasonalityYearly,
weekly_seasonality: formData.forecastSeasonalityWeekly,
daily_seasonality: formData.forecastSeasonalityDaily,
index,
},
};
}
return undefined;
};
/* eslint-disable @typescript-eslint/no-unused-vars */
export const prophetOperator: PostProcessingFactory<PostProcessingProphet> = (
formData,
queryObject,
) => {
const index = getColumnLabel(formData.x_axis || DTTM_ALIAS);
if (formData.forecastEnabled) {
return {
operation: 'prophet',
options: {
time_grain: formData.time_grain_sqla,
periods: parseInt(formData.forecastPeriods, 10),
confidence_interval: parseFloat(formData.forecastInterval),
yearly_seasonality: formData.forecastSeasonalityYearly,
weekly_seasonality: formData.forecastSeasonalityWeekly,
daily_seasonality: formData.forecastSeasonalityDaily,
index,
},
};
}
return undefined;
};
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,23 @@
import { PostProcessingResample } from '@superset-ui/core';
import { PostProcessingFactory } from './types';

export const resampleOperator: PostProcessingFactory<PostProcessingResample> =
formData => {
const resampleZeroFill = formData.resample_method === 'zerofill';
const resampleMethod = resampleZeroFill
? 'asfreq'
: formData.resample_method;
const resampleRule = formData.resample_rule;
if (resampleMethod && resampleRule) {
return {
operation: 'resample',
options: {
method: resampleMethod,
rule: resampleRule,
fill_value: resampleZeroFill ? 0 : null,
},
};
}
return undefined;
};
/* eslint-disable @typescript-eslint/no-unused-vars */
export const resampleOperator: PostProcessingFactory<PostProcessingResample> = (
formData,
queryObject,
) => {
const resampleZeroFill = formData.resample_method === 'zerofill';
const resampleMethod = resampleZeroFill ? 'asfreq' : formData.resample_method;
const resampleRule = formData.resample_rule;
if (resampleMethod && resampleRule) {
return {
operation: 'resample',
options: {
method: resampleMethod,
rule: resampleRule,
fill_value: resampleZeroFill ? 0 : null,
},
};
}
return undefined;
};

0 comments on commit 7f0c604

Please sign in to comment.