Closed aspicer closed 1 day ago
Your pull request is modifying functions with the following pre-existing issues:
📄 File: posthog/hogql/timings.py
Function | Unhandled Issue |
---|---|
to_dict |
RuntimeError: dictionary changed size during iteration posthog.tasks.tasks.process_quer... Event Count: 96 |
to_dict |
TypeError: unsupported operand type(s) for -: 'float' and 'StringDatabaseField' posthog... Event Count: 1 |
Did you find this useful? React with a 👍 or 👎
Problem
We're getting runtime errors in trends queries for dictionary changed size during iteration: Fixes #23306
We're using the same timings object in multi threaded queries and its getting all jumbled up.
Changes
Modify the timings object to handle cloning in order to pass to a thread while maintaining the current key stack.
Change the trends query to not return redundant timing info and to stack it correctly.
How did you test this code?
Wrote a test for it to make sure it's working as intended. Tested in dev. Can't test multi threaded behavior directly (easily).