Skip to content

Commit 0c27833

Browse files
committed
try without deepcopy
1 parent 1da1bc1 commit 0c27833

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

django_mongodb_backend/query_conversion/query_optimizer.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
from copy import deepcopy
2-
31
from django_mongodb_backend.query_conversion.expression_converters import convert_expression
42

53

64
class QueryOptimizer:
7-
def convert_expr_to_match(self, expr):
5+
def convert_expr_to_match(self, expr_query):
86
"""
97
Takes an MQL query with $expr and optimizes it by extracting
108
optimizable conditions into separate $match stages.
@@ -15,8 +13,6 @@ def convert_expr_to_match(self, expr):
1513
Returns:
1614
List of optimized match conditions
1715
"""
18-
expr_query = deepcopy(expr)
19-
2016
if "$expr" not in expr_query:
2117
return [expr_query]
2218

0 commit comments

Comments
 (0)