Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(schema): stop emitting the legacy insight filter types (#124100)

Thomas Obermüller5bb0312d013b
diff --git a/frontend/src/queries/schema.json b/frontend/src/queries/schema.json
index a1d786bb6d8a..98ffe7512d66 100644
--- a/frontend/src/queries/schema.json
+++ b/frontend/src/queries/schema.json
@@ -28207,40 +28207,6 @@
"required": ["funnelFromStep", "funnelToStep", "kind"],
"type": "object"
},
- "FunnelExclusionLegacy": {
- "additionalProperties": false,
- "properties": {
- "custom_name": {
- "type": ["string", "null"]
- },
- "funnel_from_step": {
- "type": "number"
- },
- "funnel_to_step": {
- "type": "number"
- },
- "id": {
- "type": ["string", "number", "null"]
- },
- "index": {
- "type": "number"
- },
- "name": {
- "type": ["string", "null"]
- },
- "optionalInFunnel": {
- "type": "boolean"
- },
- "order": {
- "type": "number"
- },
- "type": {
- "$ref": "#/definitions/EntityType"
- }
- },
- "required": ["funnel_from_step", "funnel_to_step"],
- "type": "object"
- },
"FunnelExclusionSteps": {
"additionalProperties": false,
"properties": {
@@ -28622,68 +28588,6 @@
},
"type": "object"
},
- "FunnelsFilterLegacy": {
- "additionalProperties": false,
- "description": "`FunnelsFilterType` minus everything inherited from `FilterType` and persons modal related params",
- "properties": {
- "bin_count": {
- "$ref": "#/definitions/BinCountValue"
- },
- "breakdown_attribution_type": {
- "$ref": "#/definitions/BreakdownAttributionType"
- },
- "breakdown_attribution_value": {
- "type": "number"
- },
- "exclusions": {
- "items": {
- "$ref": "#/definitions/FunnelExclusionLegacy"
- },
- "type": "array"
- },
- "funnel_aggregate_by_hogql": {
- "type": ["string", "null"]
- },
- "funnel_from_step": {
- "type": "number"
- },
- "funnel_order_type": {
- "$ref": "#/definitions/StepOrderValue"
- },
- "funnel_step_reference": {
- "$ref": "#/definitions/FunnelStepReference"
- },
- "funnel_to_step": {
- "type": "number"
- },
- "funnel_viz_type": {
- "$ref": "#/definitions/FunnelVizType"
- },
- "funnel_window_interval": {
- "type": "number"
- },
- "funnel_window_interval_unit": {
- "$ref": "#/definitions/FunnelConversionWindowTimeUnit"
- },
- "hidden_legend_keys": {
- "additionalProperties": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "not": {}
- }
- ]
- },
- "type": "object"
- },
- "layout": {
- "$ref": "#/definitions/FunnelLayout"
- }
- },
- "type": "object"
- },
"FunnelsQuery": {
"additionalProperties": false,
"properties": {
@@ -31521,25 +31425,6 @@
},
"type": "object"
},
- "LifecycleFilterLegacy": {
- "additionalProperties": false,
- "description": "`LifecycleFilterType` minus everything inherited from `FilterType`",
- "properties": {
- "show_legend": {
- "type": "boolean"
- },
- "show_values_on_series": {
- "type": "boolean"
- },
- "toggledLifecycles": {
- "items": {
- "$ref": "#/definitions/LifecycleToggle"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
"LifecycleQuery": {
"additionalProperties": false,
"properties": {
@@ -40422,77 +40307,6 @@
},
"type": "object"
},
- "PathsFilterLegacy": {
- "additionalProperties": false,
- "description": "`PathsFilterType` minus everything inherited from `FilterType` and persons modal related params",
- "properties": {
- "edge_limit": {
- "type": "integer"
- },
- "end_point": {
- "type": "string"
- },
- "exclude_events": {
- "items": {
- "type": "string"
- },
- "type": "array"
- },
- "funnel_filter": {
- "type": "object"
- },
- "funnel_paths": {
- "$ref": "#/definitions/FunnelPathType"
- },
- "include_event_types": {
- "items": {
- "$ref": "#/definitions/PathType"
- },
- "type": "array"
- },
- "local_path_cleaning_filters": {
- "anyOf": [
- {
- "items": {
- "$ref": "#/definitions/PathCleaningFilter"
- },
- "type": "array"
- },
- {
- "type": "null"
- }
- ]
- },
- "max_edge_weight": {
- "type": "integer"
- },
- "min_edge_weight": {
- "type": "integer"
- },
- "path_groupings": {
- "items": {
- "type": "string"
- },
- "type": "array"
- },
- "path_replacements": {
- "type": "boolean"
- },
- "path_type": {
- "$ref": "#/definitions/PathType"
- },
- "paths_hogql_expression": {
- "type": "string"
- },
- "start_point": {
- "type": "string"
- },
- "step_limit": {
- "type": "integer"
- }
- },
- "type": "object"
- },
"PathsLink": {
"additionalProperties": false,
"properties": {
@@ -51733,43 +51547,6 @@
},
"type": "object"
},
- "RetentionFilterLegacy": {
- "additionalProperties": false,
- "description": "`RetentionFilterType` minus everything inherited from `FilterType`",
- "properties": {
- "cumulative": {
- "type": "boolean"
- },
- "mean_retention_calculation": {
- "enum": ["simple", "weighted", "none"],
- "type": "string"
- },
- "period": {
- "$ref": "#/definitions/RetentionPeriod"
- },
- "retention_reference": {
- "description": "Whether retention is with regard to initial cohort size, or that of the previous period.",
- "enum": ["total", "previous"],
- "type": "string"
- },
- "retention_type": {
- "$ref": "#/definitions/RetentionType"
- },
- "returning_entity": {
- "$ref": "#/definitions/RetentionEntity"
- },
- "show_mean": {
- "type": "boolean"
- },
- "target_entity": {
- "$ref": "#/definitions/RetentionEntity"
- },
- "total_intervals": {
- "type": "integer"
- }
- },
- "type": "object"
- },
"RetentionPeriod": {
"enum": ["Hour", "Day", "Week", "Month"],
"type": "string"
@@ -53843,44 +53620,6 @@
},
"type": "object"
},
- "StickinessFilterLegacy": {
- "additionalProperties": false,
- "description": "`StickinessFilterType` minus everything inherited from `FilterType` and persons modal related params",
- "properties": {
- "compare": {
- "type": "boolean"
- },
- "compare_to": {
- "type": "string"
- },
- "display": {
- "$ref": "#/definitions/ChartDisplayType"
- },
- "hidden_legend_keys": {
- "additionalProperties": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "not": {}
- }
- ]
- },
- "type": "object"
- },
- "show_legend": {
- "type": "boolean"
- },
- "show_multiple_y_axes": {
- "type": "boolean"
- },
- "show_values_on_series": {
- "type": "boolean"
- }
- },
- "type": "object"
- },
"StickinessOperator": {
"enum": ["gte", "lte", "exact"],
"type": "string"
@@ -56495,87 +56234,6 @@
},
"type": "object"
},
- "TrendsFilterLegacy": {
- "additionalProperties": false,
- "description": "`TrendsFilterType` minus everything inherited from `FilterType` and `shown_as`",
- "properties": {
- "aggregation_axis_format": {
- "$ref": "#/definitions/AggregationAxisFormat"
- },
- "aggregation_axis_postfix": {
- "type": "string"
- },
- "aggregation_axis_prefix": {
- "type": "string"
- },
- "breakdown_histogram_bin_count": {
- "type": "number"
- },
- "compare": {
- "type": "boolean"
- },
- "compare_to": {
- "type": "string"
- },
- "decimal_places": {
- "type": "number"
- },
- "display": {
- "$ref": "#/definitions/ChartDisplayType"
- },
- "formula": {
- "type": "string"
- },
- "hidden_legend_keys": {
- "additionalProperties": {
- "anyOf": [
- {
- "type": "boolean"
- },
- {
- "not": {}
- }
- ]
- },
- "type": "object"
- },
- "min_decimal_places": {
- "type": "number"
- },
- "show_alert_threshold_lines": {
- "type": "boolean"
- },
- "show_labels_on_series": {
- "type": "boolean"
- },
- "show_legend": {
- "type": "boolean"
- },
- "show_multiple_y_axes": {
- "type": "boolean"
- },
- "show_percent_stack_view": {
- "type": "boolean"
- },
- "show_values_on_series": {
- "type": "boolean"
- },
- "smoothing_intervals": {
- "type": "number"
- },
- "x_axis_label": {
- "type": "string"
- },
- "y_axis_label": {
- "type": "string"
- },
- "y_axis_scale_type": {
- "enum": ["log10", "linear"],
- "type": "string"
- }
- },
- "type": "object"
- },
"TrendsFormulaNode": {
"additionalProperties": false,
"properties": {
diff --git a/frontend/src/queries/schema/schema-assistant-queries.ts b/frontend/src/queries/schema/schema-assistant-queries.ts
index cef43ef8b99d..c6d640246c2d 100644
--- a/frontend/src/queries/schema/schema-assistant-queries.ts
+++ b/frontend/src/queries/schema/schema-assistant-queries.ts
@@ -1,14 +1,25 @@
+import type { FunnelLayout } from 'lib/constants'
+import type { AggregationAxisFormat } from 'scenes/insights/aggregationAxisFormat'
+
import {
BehavioralPropertyFilter,
+ BinCountValue,
+ BreakdownAttributionType,
BreakdownType,
ChartDisplayType,
FilterLogicalOperator,
+ FunnelConversionWindowTimeUnit,
FunnelMathType,
+ FunnelStepReference,
+ FunnelVizType,
IntervalType,
LifecycleToggle,
PathType,
PropertyFilterType,
PropertyOperator,
+ RetentionPeriod,
+ RetentionType,
+ StepOrderValue,
} from '~/types'
import {
@@ -21,20 +32,15 @@ import {
EventsNode,
EventsQuery,
FunnelExclusionSteps,
- FunnelsFilterLegacy,
InsightNodeKind,
- LifecycleFilterLegacy,
MultipleBreakdownType,
Node,
NodeKind,
PieChartSettings,
type RecordingOrder,
type RecordingOrderDirection,
- RetentionFilterLegacy,
StickinessComputationMode,
- StickinessFilterLegacy,
StickinessCriteria,
- TrendsFilterLegacy,
TrendsFormulaNode,
} from './schema-general'
import { integer, positive_integer } from './type-utils'
@@ -529,7 +535,7 @@ export interface AssistantTrendsFilter {
* Whether to show the legend describing series and breakdowns.
* @default false
*/
- showLegend?: TrendsFilterLegacy['show_legend']
+ showLegend?: boolean
/**
* Formats the trends value axis. Do not use the formatting unless you are absolutely sure that formatting will match the data.
@@ -541,47 +547,47 @@ export interface AssistantTrendsFilter {
* `currency` - formats the value as a currency, e.g., `1000` becomes `$1,000`.
* @default numeric
*/
- aggregationAxisFormat?: TrendsFilterLegacy['aggregation_axis_format']
+ aggregationAxisFormat?: AggregationAxisFormat
/**
* Custom prefix to add to the aggregation axis, e.g., `$` for USD dollars. You may need to add a space after prefix.
*/
- aggregationAxisPrefix?: TrendsFilterLegacy['aggregation_axis_prefix']
+ aggregationAxisPrefix?: string
/**
* Custom postfix to add to the aggregation axis, e.g., ` clicks` to format 5 as `5 clicks`. You may need to add a space before postfix.
* Never set a postfix that `aggregationAxisFormat` already renders: `percentage` and `percentage_scaled` already append the `%` sign, so a `%` postfix would render values as `50%%`.
*/
- aggregationAxisPostfix?: TrendsFilterLegacy['aggregation_axis_postfix']
+ aggregationAxisPostfix?: string
/**
* Number of decimal places to show. Do not add this unless you are sure that values will have a decimal point.
*/
- decimalPlaces?: TrendsFilterLegacy['decimal_places']
+ decimalPlaces?: number
/**
* Whether to show a value on each data point.
* @default false
*/
- showValuesOnSeries?: TrendsFilterLegacy['show_values_on_series']
+ showValuesOnSeries?: boolean
/**
* Whether to show a percentage of each series. Use only with
* @default false
*/
- showPercentStackView?: TrendsFilterLegacy['show_percent_stack_view']
+ showPercentStackView?: boolean
/**
* Whether to scale the y-axis.
* @default linear
*/
- yAxisScaleType?: TrendsFilterLegacy['y_axis_scale_type']
+ yAxisScaleType?: 'log10' | 'linear'
/** Custom label rendered under the X axis. */
- xAxisLabel?: TrendsFilterLegacy['x_axis_label']
+ xAxisLabel?: string
/** Custom label rendered alongside the Y axis. */
- yAxisLabel?: TrendsFilterLegacy['y_axis_label']
+ yAxisLabel?: string
/**
* Whether to show alert threshold lines on the chart.
@@ -593,13 +599,13 @@ export interface AssistantTrendsFilter {
* Whether to show labels on each series.
* @default false
*/
- showLabelsOnSeries?: TrendsFilterLegacy['show_labels_on_series']
+ showLabelsOnSeries?: boolean
/**
* Whether to show multiple y-axes for different series.
* @default false
*/
- showMultipleYAxes?: TrendsFilterLegacy['show_multiple_y_axes']
+ showMultipleYAxes?: boolean
/**
* Only applies when `display` is `Metric`. Show the change pill next to the big number. What it
@@ -782,7 +788,7 @@ export interface AssistantFunnelsFilter {
* `any` - order doesn't matter. Steps can be completed in any sequence.
* @default ordered
*/
- funnelOrderType?: FunnelsFilterLegacy['funnel_order_type']
+ funnelOrderType?: StepOrderValue
/**
* Defines the type of visualization to use.
* `steps` - one bar per step with the conversion between them (default). Use for "what's the conversion rate" and "where do users drop off".
@@ -790,7 +796,7 @@ export interface AssistantFunnelsFilter {
* `time_to_convert` - a histogram of how long users took to complete the funnel.
* @default steps
*/
- funnelVizType?: FunnelsFilterLegacy['funnel_viz_type']
+ funnelVizType?: FunnelVizType
/**
* Users may want to use exclusion events to filter out conversions in which a particular event occurred between specific steps. These events must not be included in the main sequence.
* This doesn't exclude users who have completed the event before or after the funnel sequence, but often this is what users want. (If not sure, worth clarifying.)
@@ -804,12 +810,12 @@ export interface AssistantFunnelsFilter {
* Controls how the funnel chart is displayed: vertically (preferred) or horizontally.
* @default vertical
*/
- layout?: FunnelsFilterLegacy['layout']
+ layout?: FunnelLayout
/**
* Use this setting only when `funnelVizType` is `time_to_convert`: number of bins to show in histogram.
* @asType integer
*/
- binCount?: FunnelsFilterLegacy['bin_count']
+ binCount?: BinCountValue
/**
* Controls a time frame value for a conversion to be considered. Select a reasonable value based on the user's query.
* If needed, this can be practically unlimited by setting a large value, though it's rare to need that.
@@ -822,12 +828,12 @@ export interface AssistantFunnelsFilter {
* Use in combination with `funnelWindowInterval`. The default value is 14 days.
* @default day
*/
- funnelWindowIntervalUnit?: FunnelsFilterLegacy['funnel_window_interval_unit']
+ funnelWindowIntervalUnit?: FunnelConversionWindowTimeUnit
/**
* Whether conversion shown in the graph should be across all steps or just relative to the previous step.
* @default total
*/
- funnelStepReference?: FunnelsFilterLegacy['funnel_step_reference']
+ funnelStepReference?: FunnelStepReference
/**
* Use this field only if the user explicitly asks to aggregate the funnel by unique sessions.
* @default null
@@ -841,7 +847,7 @@ export interface AssistantFunnelsFilter {
* `step` - the breakdown value is the property value found at a specific step defined by `breakdownAttributionValue`.
* @default first_touch
*/
- breakdownAttributionType?: FunnelsFilterLegacy['breakdown_attribution_type']
+ breakdownAttributionType?: BreakdownAttributionType
/**
* When `breakdownAttributionType` is `step`, this is the step number (0-indexed) to attribute the breakdown value to.
* @asType integer
@@ -942,8 +948,9 @@ export interface AssistantRetentionFilter {
* Recurring retention counts a user as part of a cohort if they performed the cohort event during that time period, irrespective of it was their first time or not.
* First time retention only counts a user as part of the cohort if it was their first time performing the cohort event.
*/
- retentionType?: RetentionFilterLegacy['retention_type']
- retentionReference?: RetentionFilterLegacy['retention_reference']
+ retentionType?: RetentionType
+ /** Whether retention is with regard to initial cohort size, or that of the previous period. */
+ retentionReference?: 'total' | 'previous'
/**
* How many intervals to show in the chart. The default value is 8 (meaning 7 periods after initial cohort).
* @default 8
@@ -959,14 +966,14 @@ export interface AssistantRetentionFilter {
* Retention period, the interval to track cohorts by.
* @default Day
*/
- period?: RetentionFilterLegacy['period']
+ period?: RetentionPeriod
/** Whether an additional series should be shown, showing the mean conversion for each period across cohorts. */
- meanRetentionCalculation?: RetentionFilterLegacy['mean_retention_calculation']
+ meanRetentionCalculation?: 'simple' | 'weighted' | 'none'
/**
* Whether retention should be rolling (aka unbounded, cumulative).
* Rolling retention means that a user coming back in period 5 makes them count towards all the previous periods.
*/
- cumulative?: RetentionFilterLegacy['cumulative']
+ cumulative?: boolean
/**
* The time window mode to use for retention calculations.
*/
@@ -1096,13 +1103,13 @@ export interface AssistantStickinessFilter {
* Whether to show the legend describing series.
* @default false
*/
- showLegend?: StickinessFilterLegacy['show_legend']
+ showLegend?: boolean
/**
* Whether to show a value on each data point.
* @default false
*/
- showValuesOnSeries?: StickinessFilterLegacy['show_values_on_series']
+ showValuesOnSeries?: boolean
/**
* Filter which intervals count based on event frequency within each interval.
@@ -1308,7 +1315,7 @@ export interface AssistantLifecycleFilter {
* Whether to show a value on each data point.
* @default false
*/
- showValuesOnSeries?: LifecycleFilterLegacy['show_values_on_series']
+ showValuesOnSeries?: boolean
/**
* Lifecycles that have been removed from display are not included in this array.
* Available values: `new`, `returning`, `resurrecting`, `dormant`.
@@ -1322,7 +1329,7 @@ export interface AssistantLifecycleFilter {
* Whether to show the legend describing series.
* @default false
*/
- showLegend?: LifecycleFilterLegacy['show_legend']
+ showLegend?: boolean
/**
* Whether the lifecycle bars should be stacked.
* @default true
diff --git a/frontend/src/queries/schema/schema-general.ts b/frontend/src/queries/schema/schema-general.ts
index bee4689948a4..7f23c11a6fbe 100644
--- a/frontend/src/queries/schema/schema-general.ts
+++ b/frontend/src/queries/schema/schema-general.ts
@@ -1,6 +1,8 @@
import { DataColorToken } from 'lib/colors'
// eslint-disable-next-line import/no-cycle
import { TaxonomicFilterGroupType } from 'lib/components/TaxonomicFilter/types'
+import type { FunnelLayout } from 'lib/constants'
+import type { AggregationAxisFormat } from 'scenes/insights/aggregationAxisFormat'
import { ConversionGoalSchema } from '~/taxonomy/marketingAnalytics'
import {
@@ -10,6 +12,7 @@ import {
AnyPersonScopeFilter,
AnyPropertyFilter,
BaseMathType,
+ BinCountValue,
BreakdownAttributionType,
BreakdownKeyType,
BreakdownType,
@@ -31,19 +34,20 @@ import {
FilterType,
FunnelConversionWindowTimeUnit,
FunnelMathType,
- FunnelsFilterType,
+ FunnelPathType,
+ FunnelStepReference,
+ FunnelVizType,
GroupMathType,
HogQLMathType,
InsightShortId,
InsightType,
IntegrationType,
IntervalType,
- LifecycleFilterType,
LifecycleToggle,
LogEntryPropertyFilter,
MatchedRecordingEvent,
PathCleaningFilter,
- PathsFilterType,
+ PathType,
PersonPropertyFilter,
PropertyGroupFilter,
PropertyGroupFilterValue,
@@ -51,13 +55,13 @@ import {
PropertyOperator,
RecordingPropertyFilter,
RetentionDashboardDisplayType,
- RetentionFilterType,
+ RetentionEntity,
+ RetentionPeriod,
+ RetentionType,
SessionPropertyFilter,
SessionRecordingType,
SlackIntegrationScope,
StepOrderValue,
- StickinessFilterType,
- TrendsFilterType,
} from '~/types'
import { BIVisualizationNode } from './schema-business-intelligence'
@@ -1793,9 +1797,6 @@ export interface InsightsQueryBase<R extends AnalyticsQueryResponseBase> extends
tags?: QueryLogTags
}
-/** `TrendsFilterType` minus everything inherited from `FilterType` and `shown_as` */
-export type TrendsFilterLegacy = Omit<TrendsFilterType, keyof FilterType | 'shown_as'>
-
export enum ResultCustomizationBy {
Value = 'value',
Position = 'position',
@@ -1820,21 +1821,21 @@ export type TrendsFilter = {
/** @default 1 */
smoothingIntervals?: integer
/** @deprecated Use formulaNodes instead. */
- formula?: TrendsFilterLegacy['formula']
+ formula?: string
/** @deprecated Use formulaNodes instead. */
formulas?: string[]
/** List of formulas with optional custom names. Takes precedence over formula/formulas if set. */
formulaNodes?: TrendsFormulaNode[]
/** @default ActionsLineGraph */
- display?: TrendsFilterLegacy['display']
+ display?: ChartDisplayType
/** @default false */
- showLegend?: TrendsFilterLegacy['show_legend']
+ showLegend?: boolean
/** Where the in-chart legend sits relative to the plot. Only applies to the in-chart legend.
* @default bottom */
legendPosition?: 'top' | 'bottom' | 'left' | 'right'
/** @default false */
showAlertThresholdLines?: boolean
- breakdown_histogram_bin_count?: TrendsFilterLegacy['breakdown_histogram_bin_count'] // TODO: fully move into BreakdownFilter
+ breakdown_histogram_bin_count?: number // TODO: fully move into BreakdownFilter
// The aggregation-axis description below is duplicated, intentionally and divergently, on
// `AssistantTrendsFilter` in schema-assistant-queries.ts. The assistant copy is deliberately
// more cautious ("do not use unless absolutely sure") because Max picks formats without explicit
@@ -1852,28 +1853,28 @@ export type TrendsFilter = {
* - `short`: compact notation for large counts (`1.2K`, `3.4M`).
* @default numeric
*/
- aggregationAxisFormat?: TrendsFilterLegacy['aggregation_axis_format']
+ aggregationAxisFormat?: AggregationAxisFormat
/** Literal prefix applied to every value (e.g. `$`). Use to pin a unit or currency symbol that does not depend on `aggregationAxisFormat` — for example, when values are denominated in a fixed currency regardless of the project's base currency. Include any trailing space yourself. */
- aggregationAxisPrefix?: TrendsFilterLegacy['aggregation_axis_prefix']
+ aggregationAxisPrefix?: string
/** Literal suffix applied to every value (e.g. ` req`). Reserve for units that `aggregationAxisFormat` cannot express. Do not use ` mins`, ` s`, ` ms`, `%` etc. — pick the matching `aggregationAxisFormat` instead so the underlying values stay numerically correct for breakdowns, formulas, and alerts. Include any leading space yourself. */
- aggregationAxisPostfix?: TrendsFilterLegacy['aggregation_axis_postfix']
+ aggregationAxisPostfix?: string
/** Maximum number of decimal places shown. 1 or 2 is usually right for percentages and currency. */
- decimalPlaces?: TrendsFilterLegacy['decimal_places']
- minDecimalPlaces?: TrendsFilterLegacy['min_decimal_places']
+ decimalPlaces?: number
+ minDecimalPlaces?: number
/** Custom label rendered under the X axis. */
- xAxisLabel?: TrendsFilterLegacy['x_axis_label']
+ xAxisLabel?: string
/** Custom label rendered alongside the Y axis. */
- yAxisLabel?: TrendsFilterLegacy['y_axis_label']
+ yAxisLabel?: string
/** @default false */
- showValuesOnSeries?: TrendsFilterLegacy['show_values_on_series']
- showLabelsOnSeries?: TrendsFilterLegacy['show_labels_on_series']
+ showValuesOnSeries?: boolean
+ showLabelsOnSeries?: boolean
/** @default false */
- showPercentStackView?: TrendsFilterLegacy['show_percent_stack_view']
+ showPercentStackView?: boolean
/** On the horizontal bar-value chart, stack a series' breakdown values into a single bar
* instead of rendering one bar per breakdown value.
* @default false */
stackBreakdownValues?: boolean
- yAxisScaleType?: TrendsFilterLegacy['y_axis_scale_type']
+ yAxisScaleType?: 'log10' | 'linear'
/** Y-axis baseline. When false the axis floats to the data range instead of starting at zero.
* Ignored on bar displays (bars always draw from zero), on a logarithmic scale, and while
* showing percentages.
@@ -1886,7 +1887,7 @@ export type TrendsFilter = {
* `yAxisStartAtZero`, and when `yAxisMin` is not below it. */
yAxisMax?: number
/** @default false */
- showMultipleYAxes?: TrendsFilterLegacy['show_multiple_y_axes']
+ showMultipleYAxes?: boolean
hiddenLegendIndexes?: integer[]
/**
* Wether result datasets are associated by their values or by their order.
@@ -2127,17 +2128,6 @@ export interface IntegrationFilter {
includeNonIntegrated?: boolean
}
-/** `FunnelsFilterType` minus everything inherited from `FilterType` and persons modal related params */
-export type FunnelsFilterLegacy = Omit<
- FunnelsFilterType,
- | keyof FilterType
- | 'funnel_step_breakdown'
- | 'entrance_period_start'
- | 'drop_off'
- | 'funnel_step'
- | 'funnel_custom_steps'
->
-
export interface FunnelExclusionSteps {
funnelFromStep: integer
funnelToStep: integer
@@ -2153,29 +2143,29 @@ export type FunnelsFilter = {
/** @default [] */
exclusions?: FunnelExclusion[]
/** @default vertical */
- layout?: FunnelsFilterLegacy['layout']
+ layout?: FunnelLayout
/** @asType integer */
- binCount?: FunnelsFilterLegacy['bin_count']
+ binCount?: BinCountValue
/** @default first_touch */
- breakdownAttributionType?: FunnelsFilterLegacy['breakdown_attribution_type']
+ breakdownAttributionType?: BreakdownAttributionType
breakdownAttributionValue?: integer
- funnelAggregateByHogQL?: FunnelsFilterLegacy['funnel_aggregate_by_hogql']
+ funnelAggregateByHogQL?: string | null
/** For data warehouse based funnel insights when the aggregation target can't be mapped to persons or groups. */
customAggregationTarget?: boolean
/** To select the range of steps for trends & time to convert funnels, 0-indexed */
funnelToStep?: integer
funnelFromStep?: integer
/** @default ordered */
- funnelOrderType?: FunnelsFilterLegacy['funnel_order_type']
+ funnelOrderType?: StepOrderValue
/** @default steps */
- funnelVizType?: FunnelsFilterLegacy['funnel_viz_type']
+ funnelVizType?: FunnelVizType
/** @default 14 */
funnelWindowInterval?: integer
/** @default day */
- funnelWindowIntervalUnit?: FunnelsFilterLegacy['funnel_window_interval_unit']
+ funnelWindowIntervalUnit?: FunnelConversionWindowTimeUnit
hiddenLegendBreakdowns?: string[]
/** @default total */
- funnelStepReference?: FunnelsFilterLegacy['funnel_step_reference']
+ funnelStepReference?: FunnelStepReference
useUdf?: boolean
/** Customizations for the appearance of result datasets. */
resultCustomizations?: Record<string, ResultCustomizationByValue>
@@ -2258,20 +2248,18 @@ export interface FunnelsQueryResponse extends AnalyticsQueryResponseBase {
export type CachedFunnelsQueryResponse = CachedQueryResponse<FunnelsQueryResponse>
-/** `RetentionFilterType` minus everything inherited from `FilterType` */
-export type RetentionFilterLegacy = Omit<RetentionFilterType, keyof FilterType>
-
export type RetentionFilter = {
- retentionType?: RetentionFilterLegacy['retention_type']
- retentionReference?: RetentionFilterLegacy['retention_reference']
+ retentionType?: RetentionType
+ /** Whether retention is with regard to initial cohort size, or that of the previous period. */
+ retentionReference?: 'total' | 'previous'
/** @default 8 */
totalIntervals?: integer
minimumOccurrences?: integer
- returningEntity?: RetentionFilterLegacy['returning_entity']
- targetEntity?: RetentionFilterLegacy['target_entity']
+ returningEntity?: RetentionEntity
+ targetEntity?: RetentionEntity
/** @default Day */
- period?: RetentionFilterLegacy['period']
- cumulative?: RetentionFilterLegacy['cumulative']
+ period?: RetentionPeriod
+ cumulative?: boolean
/** @description The time window mode to use for retention calculations */
timeWindowMode?: 'strict_calendar_dates' | '24_hour_windows'
/** @description Custom brackets for retention calculations */
@@ -2288,7 +2276,7 @@ export type RetentionFilter = {
customAggregationTarget?: boolean
//frontend only
- meanRetentionCalculation?: RetentionFilterLegacy['mean_retention_calculation']
+ meanRetentionCalculation?: 'simple' | 'weighted' | 'none'
/** controls the display of the retention graph */
display?: ChartDisplayType
dashboardDisplay?: RetentionDashboardDisplayType
@@ -2347,27 +2335,23 @@ export interface PathsQueryResponse extends AnalyticsQueryResponseBase {
export type CachedPathsQueryResponse = CachedQueryResponse<PathsQueryResponse>
-/** `PathsFilterType` minus everything inherited from `FilterType` and persons modal related params */
-export type PathsFilterLegacy = Omit<
- PathsFilterType,
- keyof FilterType | 'path_start_key' | 'path_end_key' | 'path_dropoff_key'
->
-
export type PathsFilter = {
/** @default 50 */
edgeLimit?: integer
- pathsHogQLExpression?: PathsFilterLegacy['paths_hogql_expression']
- includeEventTypes?: PathsFilterLegacy['include_event_types']
- startPoint?: PathsFilterLegacy['start_point']
- endPoint?: PathsFilterLegacy['end_point']
- pathGroupings?: PathsFilterLegacy['path_groupings']
- excludeEvents?: PathsFilterLegacy['exclude_events']
+ pathsHogQLExpression?: string
+ includeEventTypes?: PathType[]
+ startPoint?: string
+ endPoint?: string
+ pathGroupings?: string[]
+ excludeEvents?: string[]
/** @default 5 */
stepLimit?: integer
- pathReplacements?: PathsFilterLegacy['path_replacements']
- localPathCleaningFilters?: PathsFilterLegacy['local_path_cleaning_filters'] | null
- minEdgeWeight?: PathsFilterLegacy['min_edge_weight']
- maxEdgeWeight?: PathsFilterLegacy['max_edge_weight']
+ pathReplacements?: boolean
+ localPathCleaningFilters?: PathCleaningFilter[] | null
+ /** @asType integer */
+ minEdgeWeight?: number
+ /** @asType integer */
+ maxEdgeWeight?: number
showFullUrls?: boolean
/** Remove the query string from page view URLs, so pages that differ only in query parameters become one path item */
stripQueryString?: boolean
@@ -2380,7 +2364,7 @@ export type PathsFilter = {
}
export type FunnelPathsFilter = {
- funnelPathType: PathsFilterLegacy['funnel_paths']
+ funnelPathType: FunnelPathType | undefined
funnelSource: FunnelsQuery
funnelStep?: integer
}
@@ -2578,9 +2562,6 @@ export interface PathsV2Query extends Omit<
pathsV2Filter?: PathsV2Filter
}
-/** `StickinessFilterType` minus everything inherited from `FilterType` and persons modal related params */
-export type StickinessFilterLegacy = Omit<StickinessFilterType, keyof FilterType | 'stickiness_days' | 'shown_as'>
-
export type StickinessOperator =
| PropertyOperator.GreaterThanOrEqual
| PropertyOperator.LessThanOrEqual
@@ -2599,13 +2580,13 @@ export interface StickinessCriteria {
}
export type StickinessFilter = {
- display?: StickinessFilterLegacy['display']
- showLegend?: StickinessFilterLegacy['show_legend']
+ display?: ChartDisplayType
+ showLegend?: boolean
/** Where the in-chart legend sits relative to the plot. Only applies to the in-chart legend.
* @default bottom */
legendPosition?: 'top' | 'bottom' | 'left' | 'right'
- showValuesOnSeries?: StickinessFilterLegacy['show_values_on_series']
- showMultipleYAxes?: StickinessFilterLegacy['show_multiple_y_axes']
+ showValuesOnSeries?: boolean
+ showMultipleYAxes?: boolean
hiddenLegendIndexes?: integer[]
stickinessCriteria?: StickinessCriteria
computedAs?: StickinessComputationMode
@@ -2671,20 +2652,14 @@ export interface StickinessQuery extends Omit<
compareFilter?: CompareFilter
}
-/** `LifecycleFilterType` minus everything inherited from `FilterType` */
-export type LifecycleFilterLegacy = Omit<LifecycleFilterType, keyof FilterType | 'shown_as'> & {
- /** Lifecycles that have been removed from display are not included in this array */
- toggledLifecycles?: LifecycleToggle[]
-} // using everything except what it inherits from FilterType
-
export type LifecycleFilter = {
- showValuesOnSeries?: LifecycleFilterLegacy['show_values_on_series']
+ showValuesOnSeries?: boolean
/** Append per-band percentage to each value label (e.g. `580 (42%)`). Requires
* `showValuesOnSeries` — on its own it has no visible effect. */
showPercentagesOnSeries?: boolean
- toggledLifecycles?: LifecycleFilterLegacy['toggledLifecycles']
+ toggledLifecycles?: LifecycleToggle[]
/** @default false */
- showLegend?: LifecycleFilterLegacy['show_legend']
+ showLegend?: boolean
/** Where the in-chart legend sits relative to the plot. Only applies to the in-chart legend.
* @default bottom */
legendPosition?: 'top' | 'bottom' | 'left' | 'right'
diff --git a/posthog/schema.py b/posthog/schema.py
index 45ddb0105df1..416d2769eb16 100644
--- a/posthog/schema.py
+++ b/posthog/schema.py
@@ -1080,6 +1080,10 @@ class BiasRisk(BaseModel):
)
+class BinCountValue(RootModel[float | str]):
+ root: float | str
+
+
class BoxPlotSettings(BaseModel):
model_config = ConfigDict(
extra="forbid",
@@ -1830,21 +1834,6 @@ class FormDismissPayload(BaseModel):
action: Literal["dismiss_form"] = "dismiss_form"
-class FunnelExclusionLegacy(BaseModel):
- model_config = ConfigDict(
- extra="forbid",
- )
- custom_name: str | None = None
- funnel_from_step: float
- funnel_to_step: float
- id: str | float | None = None
- index: float | None = None
- name: str | None = None
- optionalInFunnel: bool | None = None
- order: float | None = None
- type: EntityType | None = None
-
-
class FunnelStepsBreakdownResults(RootModel[list[list[dict[str, Any]]]]):
root: list[list[dict[str, Any]]]
@@ -2892,27 +2881,6 @@ class PathCleaningFilter(BaseModel):
regex: str | None = None
-class PathsFilterLegacy(BaseModel):
- model_config = ConfigDict(
- extra="forbid",
- )
- edge_limit: int | None = None
- end_point: str | None = None
- exclude_events: list[str] | None = None
- funnel_filter: dict[str, Any] | None = None
- funnel_paths: FunnelPathType | None = None
- include_event_types: list[PathType] | None = None
- local_path_cleaning_filters: list[PathCleaningFilter] | None = None
- max_edge_weight: int | None = None
- min_edge_weight: int | None = None
- path_groupings: list[str] | None = None
- path_replacements: bool | None = None
- path_type: PathType | None = None
- paths_hogql_expression: str | None = None
- start_point: str | None = None
- step_limit: int | None = None
-
-
class PathsLink(BaseModel):
model_config = ConfigDict(
extra="forbid",
@@ -3387,19 +3355,6 @@ class SourceMap(BaseModel):
source: str | None = None
-class StickinessFilterLegacy(BaseModel):
- model_config = ConfigDict(
- extra="forbid",
- )
- compare: bool | None = None
- compare_to: str | None = None
- display: ChartDisplayType | None = None
- hidden_legend_keys: dict[str, bool | Any] | None = None
- show_legend: bool | None = None
- show_multiple_y_axes: bool | None = None
- show_values_on_series: bool | None = None
-
-
class SubagentUpdateEvent(BaseModel):
model_config = ConfigDict(
extra="forbid",
@@ -3501,33 +3456,6 @@ class TraceNeighborsQueryResponse(BaseModel):
)
-class TrendsFilterLegacy(BaseModel):
- model_config = ConfigDict(
- extra="forbid",
- )
- aggregation_axis_format: AggregationAxisFormat | None = None
- aggregation_axis_postfix: str | None = None
- aggregation_axis_prefix: str | None = None
- breakdown_histogram_bin_count: float | None = None
- compare: bool | None = None
- compare_to: str | None = None
- decimal_places: float | None = None
- display: ChartDisplayType | None = None
- formula: str | None = None
- hidden_legend_keys: dict[str, bool | Any] | None = None
- min_decimal_places: float | None = None
- show_alert_threshold_lines: bool | None = None
- show_labels_on_series: bool | None = None
- show_legend: bool | None = None
- show_multiple_y_axes: bool | None = None
- show_percent_stack_view: bool | None = None
- show_values_on_series: bool | None = None
- smoothing_intervals: float | None = None
- x_axis_label: str | None = None
- y_axis_label: str | None = None
- y_axis_scale_type: YAxisScaleType | None = YAxisScaleType.LINEAR
-
-
class TrendsFormulaNode(BaseModel):
model_config = ConfigDict(
extra="forbid",
@@ -6187,26 +6115,6 @@ class FunnelsAlertConfig(BaseModel):
type: Literal["FunnelsAlertConfig"] = "FunnelsAlertConfig"
-class FunnelsFilterLegacy(BaseModel):
- model_config = ConfigDict(
- extra="forbid",
- )
- bin_count: float | str | None = None
- breakdown_attribution_type: BreakdownAttributionType | None = None
- breakdown_attribution_value: float | None = None
- exclusions: list[FunnelExclusionLegacy] | None = None
- funnel_aggregate_by_hogql: str | None = None
- funnel_from_step: float | None = None
- funnel_order_type: StepOrderValue | None = None
- funnel_step_reference: FunnelStepReference | None = None
- funnel_to_step: float | None = None
- funnel_viz_type: FunnelVizType | None = None
- funnel_window_interval: float | None = None
- funnel_window_interval_unit: FunnelConversionWindowTimeUnit | None = None
- hidden_legend_keys: dict[str, bool | Any] | None = None
- layout: FunnelLayout | None = None
-
-
class GroupPropertyFilter(BaseModel):
model_config = ConfigDict(
extra="forbid",
@@ -6527,15 +6435,6 @@ class LifecycleFilter(BaseModel):
toggledLifecycles: list[LifecycleToggle] | None = None
-class LifecycleFilterLegacy(BaseModel):
- model_config = ConfigDict(
- extra="forbid",
- )
- show_legend: bool | None = None
- show_values_on_series: bool | None = None
- toggledLifecycles: list[LifecycleToggle] | None = None
-
-
class LogEntryPropertyFilter(BaseModel):
model_config = ConfigDict(
extra="forbid",
@@ -30599,24 +30498,6 @@ class RetentionFilter(BaseModel):
totalIntervals: int | None = 8
-class RetentionFilterLegacy(BaseModel):
- model_config = ConfigDict(
- extra="forbid",
- )
- cumulative: bool | None = None
- mean_retention_calculation: MeanRetentionCalculation | None = None
- period: RetentionPeriod | None = None
- retention_reference: RetentionReference | None = Field(
- default=None,
- description=("Whether retention is with regard to initial cohort size, or that of the previous period."),
- )
- retention_type: RetentionType | None = None
- returning_entity: RetentionEntity | None = None
- show_mean: bool | None = None
- target_entity: RetentionEntity | None = None
- total_intervals: int | None = None
-
-
class TeamTaxonomyQuery(BaseModel):
model_config = ConfigDict(
extra="forbid",