Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: Cache the hogql parsing part of setting up the channel type fields #27768

Merged
merged 4 commits into from
Jan 22, 2025

Conversation

robbie-c
Copy link
Member

@robbie-c robbie-c commented Jan 22, 2025

Problem

See #27757

I like this particular approach because if it works, we can generalise it to anywhere we parse static HogQL.

Best viewed while hiding whitespace changes, due to indent changes when adding timings

Changes

Memoize the HogQL parsing part of setting up the channel type fields

Does this work well for both Cloud and self-hosted?

Yes

How did you test this code?

Tests still work despite adding the memoization

Copy link

sentry-io bot commented Jan 22, 2025

🔍 Existing Issues For Review

Your pull request is modifying functions with the following pre-existing issues:

📄 File: posthog/hogql/database/database.py

Function Unhandled Issue
create_hogql_database TypeError: unhashable type: 'list' posthog.tasks....
Event Count: 191
create_hogql_database TypeError: unhashable type: 'list' posthog.tasks....
Event Count: 1

Did you find this useful? React with a 👍 or 👎

@robbie-c robbie-c merged commit e89eeb3 into master Jan 22, 2025
92 checks passed
@robbie-c robbie-c deleted the feat/cache-expensive-part-of-channel-type-parsing branch January 22, 2025 12:46
Copy link

sentry-io bot commented Jan 22, 2025

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ UnboundLocalError: cannot access local variable 'span' where it is not associated with a value posthog.tasks.tasks.process_query_task View Issue

Did you find this useful? React with a 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants