Skip to content

Commit

Permalink
Update schema with HogQLPropertyFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
Twixes committed May 21, 2024
1 parent c4a2dc0 commit 6d0ec1a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 12 deletions.
22 changes: 18 additions & 4 deletions frontend/src/queries/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand All @@ -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"
},
Expand Down
9 changes: 5 additions & 4 deletions frontend/src/queries/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
FunnelsFilterType,
GroupMathType,
HogQLMathType,
HogQLPropertyFilter,
InsightShortId,
InsightType,
IntervalType,
Expand Down Expand Up @@ -986,10 +987,10 @@ export interface ActorsQuery extends DataNode<ActorsQueryResponse> {
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
Expand Down
8 changes: 4 additions & 4 deletions posthog/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 6d0ec1a

Please sign in to comment.