Skip to content

Commit

Permalink
check for DTTM_ALIAS
Browse files Browse the repository at this point in the history
  • Loading branch information
villebro committed Feb 2, 2022
1 parent 02a8510 commit 2a4dde5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import { DataRecord, NumberFormatter } from '@superset-ui/core';
import { DataRecord, DTTM_ALIAS, NumberFormatter } from '@superset-ui/core';
import { CallbackDataParams, OptionName } from 'echarts/types/src/util/types';
import { TooltipMarker } from 'echarts/types/src/util/format';
import {
Expand Down Expand Up @@ -119,9 +119,10 @@ export function rebaseForecastDatum(
const newRow: DataRecord = {};
keys.forEach(key => {
const forecastContext = extractForecastSeriesContext(key);
const verboseKey = verboseMap[forecastContext.name]
? `${verboseMap[forecastContext.name]}${forecastContext.type}`
: key;
const verboseKey =
key !== DTTM_ALIAS && verboseMap[forecastContext.name]
? `${verboseMap[forecastContext.name]}${forecastContext.type}`
: key;

// check if key is equal to lower confidence level. If so, extract it
// from the upper bound
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ describe('rebaseForecastDatum', () => {
]);
});

it('should rename all series based on verboseMap', () => {
it('should rename all series based on verboseMap but leave __timestamp alone', () => {
expect(
rebaseForecastDatum(
[
Expand All @@ -128,6 +128,7 @@ describe('rebaseForecastDatum', () => {
],
{
abc: 'Abracadabra',
__timestamp: 'Time',
},
),
).toEqual([
Expand Down

0 comments on commit 2a4dde5

Please sign in to comment.