File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change 2
2
import pprint
3
3
from collections import defaultdict
4
4
5
- from bson import SON
5
+ from bson import json_util , SON
6
6
from django .core .exceptions import EmptyResultSet , FieldError , FullResultSet
7
7
from django .db import IntegrityError , NotSupportedError
8
8
from django .db .models import Count
@@ -652,12 +652,8 @@ def explain_query(self):
652
652
{"aggregate" : self .collection_name , "pipeline" : pipeline , "cursor" : {}},
653
653
** kwargs ,
654
654
)
655
- # Generate the output: a list of lines that Django joins with newlines.
656
- result = []
657
- for key , value in explain .items ():
658
- formatted_value = pprint .pformat (value , indent = 4 )
659
- result .append (f"{ key } : { formatted_value } " )
660
- return result
655
+ # explain() expects a list and joins on a newline. Concatenate no lines
656
+ return [json_util .dumps (explain )]
661
657
662
658
663
659
class SQLInsertCompiler (SQLCompiler ):
You can’t perform that action at this time.
0 commit comments