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(ci): use supported HogQL float function (#96230)

Paul D'Ambracddc55b084a5
diff --git a/.github/scripts/weekly-slow-tests-report.mjs b/.github/scripts/weekly-slow-tests-report.mjs
index 6927ac6186ec..eec85a1c54e5 100644
--- a/.github/scripts/weekly-slow-tests-report.mjs
+++ b/.github/scripts/weekly-slow-tests-report.mjs
@@ -47,8 +47,8 @@ const SLOW_TESTS_QUERY = `
if(attributes['test.runner'] = 'jest' OR service_name = 'ci-frontend', 'jest', 'pytest') AS runner,
attributes['test.selector'] AS selector,
any(attributes['test.file']) AS file,
- round(median(toFloat64(duration_nano)) / 1000000000, 1) AS p50_seconds,
- round(max(toFloat64(duration_nano)) / 1000000000, 1) AS max_seconds,
+ round(median(toFloat(duration_nano)) / 1000000000, 1) AS p50_seconds,
+ round(max(toFloat(duration_nano)) / 1000000000, 1) AS max_seconds,
uniq(resource_attributes['ci.run_id']) AS builds
FROM posthog.trace_spans
WHERE service_name IN {service_names}
diff --git a/.github/scripts/weekly-slow-tests-report.test.mjs b/.github/scripts/weekly-slow-tests-report.test.mjs
index 93590be75925..1da8323d76eb 100644
--- a/.github/scripts/weekly-slow-tests-report.test.mjs
+++ b/.github/scripts/weekly-slow-tests-report.test.mjs
@@ -38,6 +38,8 @@ describe('weekly slow tests report', () => {
assert.deepEqual(items, [expected])
assert.match(captured.query, /attributes\['test\.outcome'\] = 'passed'/)
+ assert.match(captured.query, /median\(toFloat\(duration_nano\)\)/)
+ assert.doesNotMatch(captured.query, /toFloat64/)
assert.match(captured.query, /lower\(resource_attributes\['ci\.repository'\]\) = lower\(\{repository\}\)/)
assert.match(captured.query, /ci\.branch'\] = {for_branch} OR resource_attributes\['ci\.branch'\] LIKE {merge_queue_glob}/)
assert.match(captured.query, /GROUP BY/)