Skip to content

Commit

Permalink
fix types and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thmsobrmlr committed Sep 19, 2023
1 parent 4692a1c commit c8d1bde
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion posthog/hogql_queries/lifecycle_query_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def to_persons_query(self) -> ast.SelectQuery | ast.SelectUnionQuery:
placeholders={"events_query": self.events_query},
)

def calculate(self) -> LifecycleQueryResponse:
def calculate(self):
response = execute_hogql_query(
query_type="LifecycleQuery",
query=self.to_query(),
Expand Down
2 changes: 1 addition & 1 deletion posthog/hogql_queries/query_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def __init__(self, query: InsightQueryNode | Dict[str, Any], team: Team, timings
self.team = team
self.timings = timings or HogQLTimings()
if isinstance(query, self.query_type):
self.query = query
self.query = query # type: ignore
else:
self.query = self.query_type.model_validate(query)

Expand Down
2 changes: 2 additions & 0 deletions posthog/hogql_queries/test/test_query_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ def test_cache_key(self):
def test_cache_key_different_timezone(self):
TestQueryRunner = self.setup_test_query_runner_class()
team = Team.objects.create(pk=42, organization=self.organization)
team.timezone = "Europe/Vienna"
team.save()

runner = TestQueryRunner(query={"some_attr": "bla"}, team=team) # type: ignore

Expand Down

0 comments on commit c8d1bde

Please sign in to comment.