From 6d0ec1a8a8a522c52abc8ed7244126982d232d31 Mon Sep 17 00:00:00 2001 From: Michael Matloka Date: Tue, 21 May 2024 21:05:36 +0200 Subject: [PATCH] Update schema with `HogQLPropertyFilter` --- frontend/src/queries/schema.json | 22 ++++++++++++++++++---- frontend/src/queries/schema.ts | 9 +++++---- posthog/schema.py | 8 ++++---- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/frontend/src/queries/schema.json b/frontend/src/queries/schema.json index c0b512ee683bb..c08f223598dc8 100644 --- a/frontend/src/queries/schema.json +++ b/frontend/src/queries/schema.json @@ -55,9 +55,16 @@ "additionalProperties": false, "properties": { "fixedProperties": { - "description": "Currently only person filters supported, see `filter_conditions()` in actor_strategies.py.", + "description": "Currently only person filters supported (including via HogQL), See `filter_conditions()` in actor_strategies.py.", "items": { - "$ref": "#/definitions/PersonPropertyFilter" + "anyOf": [ + { + "$ref": "#/definitions/PersonPropertyFilter" + }, + { + "$ref": "#/definitions/HogQLPropertyFilter" + } + ] }, "type": "array" }, @@ -82,9 +89,16 @@ "type": "array" }, "properties": { - "description": "Currently only person filters supported, see `filter_conditions()` in actor_strategies.py.", + "description": "Currently only person filters supported (including via HogQL). see `filter_conditions()` in actor_strategies.py.", "items": { - "$ref": "#/definitions/PersonPropertyFilter" + "anyOf": [ + { + "$ref": "#/definitions/PersonPropertyFilter" + }, + { + "$ref": "#/definitions/HogQLPropertyFilter" + } + ] }, "type": "array" }, diff --git a/frontend/src/queries/schema.ts b/frontend/src/queries/schema.ts index 4e562fdc1ebc3..73f693daeda7e 100644 --- a/frontend/src/queries/schema.ts +++ b/frontend/src/queries/schema.ts @@ -13,6 +13,7 @@ import { FunnelsFilterType, GroupMathType, HogQLMathType, + HogQLPropertyFilter, InsightShortId, InsightType, IntervalType, @@ -986,10 +987,10 @@ export interface ActorsQuery extends DataNode { source?: InsightActorsQuery | FunnelsActorsQuery | FunnelCorrelationActorsQuery | HogQLQuery select?: HogQLExpression[] search?: string - /** Currently only person filters supported, see `filter_conditions()` in actor_strategies.py. */ - properties?: PersonPropertyFilter[] - /** Currently only person filters supported, see `filter_conditions()` in actor_strategies.py. */ - fixedProperties?: PersonPropertyFilter[] + /** Currently only person filters supported (including via HogQL). see `filter_conditions()` in actor_strategies.py. */ + properties?: (PersonPropertyFilter | HogQLPropertyFilter)[] + /** Currently only person filters supported (including via HogQL), See `filter_conditions()` in actor_strategies.py. */ + fixedProperties?: (PersonPropertyFilter | HogQLPropertyFilter)[] orderBy?: string[] limit?: integer offset?: integer diff --git a/posthog/schema.py b/posthog/schema.py index 3a158f55fc605..634464cae9e41 100644 --- a/posthog/schema.py +++ b/posthog/schema.py @@ -4036,9 +4036,9 @@ class ActorsQuery(BaseModel): model_config = ConfigDict( extra="forbid", ) - fixedProperties: Optional[list[PersonPropertyFilter]] = Field( + fixedProperties: Optional[list[Union[PersonPropertyFilter, HogQLPropertyFilter]]] = Field( default=None, - description="Currently only person filters supported, see `filter_conditions()` in actor_strategies.py.", + description="Currently only person filters supported (including via HogQL), See `filter_conditions()` in actor_strategies.py.", ) kind: Literal["ActorsQuery"] = "ActorsQuery" limit: Optional[int] = None @@ -4047,9 +4047,9 @@ class ActorsQuery(BaseModel): ) offset: Optional[int] = None orderBy: Optional[list[str]] = None - properties: Optional[list[PersonPropertyFilter]] = Field( + properties: Optional[list[Union[PersonPropertyFilter, HogQLPropertyFilter]]] = Field( default=None, - description="Currently only person filters supported, see `filter_conditions()` in actor_strategies.py.", + description="Currently only person filters supported (including via HogQL). see `filter_conditions()` in actor_strategies.py.", ) response: Optional[ActorsQueryResponse] = None search: Optional[str] = None