Commit 970353a
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 a912524 commit 970353a
File tree
2 files changed
+2
-5
lines changed- instrumentation/opentelemetry-instrumentation-django/src/opentelemetry/instrumentation/django/middleware
2 files changed
+2
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| |||
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