Commit 3f6ab47
committed
Remove duplicate query logging that breaks Django's assertNumQueries
The SqlCommenter _QueryWrapper manually appends the SQL string to
queries_log when a CursorDebugWrapper is active. However,
CursorDebugWrapper.debug_sql already logs the query as a dict with
"sql" and "time" keys. This causes two problems:
1. Queries are double-counted in queries_log
2. The raw string entries cause a TypeError in Django's
assertNumQueries, which expects dict entries with a "sql" key
Remove the manual append and let Django handle query logging.1 parent 195bcdb commit 3f6ab47
1 file changed
Lines changed: 0 additions & 5 deletions
File tree
- instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/middleware
Lines changed: 0 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| |||
122 | 121 | | |
123 | 122 | | |
124 | 123 | | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | 124 | | |
0 commit comments