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(data-modeling): POST row count query to avoid URL field limit (#61867)

Jovan Sakovic133a7cf894a2
diff --git a/posthog/temporal/data_modeling/run_workflow.py b/posthog/temporal/data_modeling/run_workflow.py
index ca90567bcd75..2adcc78206fd 100644
--- a/posthog/temporal/data_modeling/run_workflow.py
+++ b/posthog/temporal/data_modeling/run_workflow.py
@@ -840,7 +840,12 @@ async def get_query_row_count(query: str, team: Team, logger: FilteringBoundLogg
await logger.adebug(f"Running count query: {printed}")
async with get_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