Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(temporal): POST query when reading row count, so we dont put query in URL params (#61398)

Jovan Sakovice1dfbb081db6
diff --git a/posthog/temporal/data_modeling/activities/materialize_view.py b/posthog/temporal/data_modeling/activities/materialize_view.py
index 2a4f7cf6710a..2b563d223409 100644
--- a/posthog/temporal/data_modeling/activities/materialize_view.py
+++ b/posthog/temporal/data_modeling/activities/materialize_view.py
@@ -298,7 +298,12 @@ async def get_query_row_count(
await logger.adebug(f"Running count query: {printed}")
async with _clickhouse_query_semaphore, get_clickhouse_client() as client:
- result = await client.read_query(printed, query_parameters=context.values)
+ async with client.apost_query(
+ query=printed,
+ query_parameters=context.values,
+ query_id=str(uuid.uuid4()),
+ ) as response:
+ result = await response.content.read()
count = int(result.decode("utf-8").strip())
return count