From 7bd46a3e29b1ce39e3cff64f3541c22b7c5da44f Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Mon, 20 Dec 2021 13:21:07 +0530 Subject: [PATCH] fix: Escape matching pattern for substitution Tested on PY3.9.7 and PY3.9.9 --- frappe/patches/v14_0/remove_db_aggregation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/patches/v14_0/remove_db_aggregation.py b/frappe/patches/v14_0/remove_db_aggregation.py index 25a170f362..a8fa5b2ba1 100644 --- a/frappe/patches/v14_0/remove_db_aggregation.py +++ b/frappe/patches/v14_0/remove_db_aggregation.py @@ -27,6 +27,6 @@ def execute(): name, script = server_script["name"], server_script["script"] for agg in ["avg", "max", "min", "sum"]: - script = re.sub(f"frappe.db.{agg}(", f"frappe.qb.{agg}(", script) + script = re.sub(f"frappe.db.{agg}\(", f"frappe.qb.{agg}(", script) frappe.db.update("Server Script", name, "script", script)