@@ -252,9 +252,9 @@ def trunc_convert_value(self, value, expression, connection):
252252 return _trunc_convert_value (self , value , expression , connection )
253253
254254
255- def trunc_date (self , compiler , connection , ** extra ): # noqa: ARG001
255+ def trunc_date (self , compiler , connection ):
256256 # Cast to date rather than truncate to date.
257- lhs_mql = process_lhs (self , compiler , connection )
257+ lhs_mql = process_lhs (self , compiler , connection , as_path = False )
258258 tzname = self .get_tzname ()
259259 if tzname and tzname != "UTC" :
260260 raise NotSupportedError (f"TruncDate with tzinfo ({ tzname } ) isn't supported on MongoDB." )
@@ -320,7 +320,7 @@ def register_functions():
320320 Substr .as_mql_expr = substr
321321 Trim .as_mql_expr = trim ("trim" )
322322 TruncBase .as_mql_expr = trunc
323- TruncBase .convert_value_expr = trunc_convert_value
323+ TruncBase .convert_value = trunc_convert_value
324324 TruncDate .as_mql_expr = trunc_date
325325 TruncTime .as_mql_expr = trunc_time
326326 Upper .as_mql_expr = preserve_null ("toUpper" )
0 commit comments