posthog
posthog copied to clipboard
fix: return query column aliases
Problem
Helps to cleanup a lot in https://github.com/PostHog/posthog/pull/23330
For a query like this:
source: {
kind: NodeKind.EventsQuery,
select: [
'any(properties) as "columns.context.error"',
'properties.$exception_type',
`sparkline(reverse(arrayMap(x -> countEqual(groupArray(dateDiff('hour', now() - INTERVAL 1 day, timestamp)), x), range(24)))) as volume`,
'count() as unique_occurrences -- Occurrences',
'count(distinct $session_id) as unique_sessions -- Sessions',
'count(distinct distinct_id) as unique_users -- Users',
'max(timestamp) as last_seen',
'min(timestamp) as first_seen',
],
orderBy: [order],
...defaultProperties({ dateRange, filterTestAccounts, filterGroup }),
},
the column aliases were not being returned
Changes
| Before | After |
|---|---|