diff --git a/posthog/hogql_queries/hogql_query_runner.py b/posthog/hogql_queries/hogql_query_runner.py index acc404ac9519a..7f30ae435803c 100644 --- a/posthog/hogql_queries/hogql_query_runner.py +++ b/posthog/hogql_queries/hogql_query_runner.py @@ -45,7 +45,7 @@ def to_actors_query(self) -> ast.SelectQuery: def calculate(self) -> HogQLQueryResponse: query = self.to_query() paginator = None - if not query.limit: + if isinstance(query, ast.SelectQuery) and not query.limit: paginator = HogQLHasMorePaginator.from_limit_context(limit_context=self.limit_context) func = cast( Callable[..., HogQLQueryResponse],