Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
jurajmajerik committed Mar 29, 2024
1 parent ef11a54 commit a3acece
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { capitalizeFirstLetter } from 'lib/utils'
import { filtersToQueryNode } from '~/queries/nodes/InsightQuery/utils/filtersToQueryNode'
import { Query } from '~/queries/Query/Query'
import { NodeKind } from '~/queries/schema'
import { ExperimentResults, InsightShortId, InsightType } from '~/types'
import { BaseExperimentResults, InsightShortId, InsightType } from '~/types'

import { SECONDARY_METRIC_INSIGHT_ID } from '../constants'
import { experimentLogic, TabularSecondaryMetricResults } from '../experimentLogic'
Expand Down Expand Up @@ -219,7 +219,7 @@ export function SecondaryMetricsTable({

const targetResults = secondaryMetricResults?.[idx]
const targetResultFilters = targetResults?.filters
const winningVariant = getHighestProbabilityVariant(targetResults as ExperimentResults['result'])
const winningVariant = getHighestProbabilityVariant(targetResults as BaseExperimentResults)

if (metric.filters.insight === InsightType.TRENDS) {
columns.push({
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/scenes/experiments/experimentLogic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { queryNodeToFilter } from '~/queries/nodes/InsightQuery/utils/queryNodeT
import { FunnelsQuery, InsightVizNode, TrendsQuery } from '~/queries/schema'
import {
ActionFilter as ActionFilterType,
BaseExperimentResults,
Breadcrumb,
CountPerActorMathType,
Experiment,
Expand Down Expand Up @@ -964,7 +965,7 @@ export const experimentLogic = kea<experimentLogicType>([
],
getHighestProbabilityVariant: [
() => [],
() => (results: ExperimentResults['result'] | null) => {
() => (results: BaseExperimentResults | null) => {
if (results) {
const maxValue = Math.max(...Object.values(results.probability))
return Object.keys(results.probability).find(
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2884,7 +2884,7 @@ export interface TrendExperimentVariant {
absolute_exposure: number
}

interface BaseExperimentResults {
export interface BaseExperimentResults {
probability: Record<string, number>
fakeInsightId: string
significant: boolean
Expand Down

0 comments on commit a3acece

Please sign in to comment.