Skip to content

Commit

Permalink
Revert schema change
Browse files Browse the repository at this point in the history
  • Loading branch information
webjunkie committed Mar 21, 2024
1 parent 60b37b0 commit d438806
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
9 changes: 8 additions & 1 deletion frontend/src/queries/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2659,7 +2659,14 @@
"type": "string"
},
"day": {
"type": "string"
"anyOf": [
{
"type": "string"
},
{
"$ref": "#/definitions/Day"
}
]
},
"includeRecordings": {
"type": "boolean"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/queries/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,7 @@ export interface InsightActorsQueryBase {
export interface InsightActorsQuery<T extends InsightsQueryBase = InsightQuerySource> extends InsightActorsQueryBase {
kind: NodeKind.InsightActorsQuery
source: T
day?: string
day?: string | Day
status?: string
/** An interval selected out of available intervals in source query. */
interval?: integer
Expand Down
4 changes: 2 additions & 2 deletions posthog/hogql_queries/insights/insight_actors_query_runner.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from datetime import timedelta
from typing import cast
from typing import cast, Optional

from posthog.hogql import ast
from posthog.hogql.query import execute_hogql_query
Expand Down Expand Up @@ -37,7 +37,7 @@ def to_query(self) -> ast.SelectQuery | ast.SelectUnionQuery:
trends_runner = cast(TrendsQueryRunner, self.source_runner)
query = cast(InsightActorsQuery, self.query)
return trends_runner.to_actors_query(
time_frame=query.day,
time_frame=cast(Optional[str], query.day), # Other runner accept day as int, but not this one
series_index=query.series or 0,
breakdown_value=query.breakdown,
compare=query.compare,
Expand Down
2 changes: 1 addition & 1 deletion posthog/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -2806,7 +2806,7 @@ class InsightActorsQuery(BaseModel):
)
breakdown: Optional[Union[str, int]] = None
compare: Optional[Compare] = None
day: Optional[str] = None
day: Optional[Union[str, int]] = None
includeRecordings: Optional[bool] = None
interval: Optional[int] = Field(
default=None, description="An interval selected out of available intervals in source query."
Expand Down

0 comments on commit d438806

Please sign in to comment.